Showing posts with label angularjs. Show all posts
Showing posts with label angularjs. Show all posts

Tuesday, 3 May 2016

How to replace double backslash('\\') using substring function in java script

I am describe ,how to use substring of string and replace the specific characters from strings. In below image, show sql server database table ,  Bloodpressure column contains backslash that is 120\80 .











When fetch record from sql then in c# programming language that contains double back slash 120\\80. In server side that automatically add double backslash "\\".



In below image, I am using String function that is convert Blood Pressure to java script Object that,s contain in index format. In next step ,I am using substring function that first part is 0 means it extract from beginning of string and second part using indexOf function that find the element of index then first part get the value 120 from backslash and in next step using replace function to replace the string upperpart value and "\\" from string with "" then we get next part of backslash.


var str=new String(param.BloodPressure);
var Upperpart=str.substring(0,str.indexOf('\\'));
var Lowerpart=str.replace(Upperpart + "\\","");








Saturday, 30 April 2016

Save date and time from dropdown in sql database table using javascripts

I will describe here to save hh and mm format dropdown value to database. Firstly , I have two dropdown first is Hours and second is Minutes .






When you will fill data then press F12 or inspect element . I will showing it value following as:


Here , you will show $scope._MinuteDataTypeModal contains value 30 and next image show Hours data as:



And I am concatenate both modal using ":" to time format.




In above picture, $scope.VisitTimeModal show actual time format that is "10:30:00".

And in c# or server side code automatically get data in class using get set property . And in below picture show highlighted section that is time is save in database.