Saturday, October 18, 2014

coding for delete button in vb net

Posted by Gnani Palepu  |  No comments


 if you want more related search please click here  
 please help to other  
 http://scriptquery.blogspot.in/  


 if you want more related search please click here  
 please help to other  
 http://scriptquery.blogspot.in/  

 save update delete in one function only using c# .net  
 -----------------------------------------------------  
 #region Save Upadte Delete  
   protected Boolean SaveUpdateDelete(int argtype)  
   {  
     try  
     {  
       var request = new LMSEMPLeaveRequest();  
       var obj = new LMSBO();  
       request.EMPLEAVEID = !string.IsNullOrWhiteSpace(txtEmpLeaveid.Text) ? Convert.ToInt32(txtEmpLeaveid.Text) : 0;  
       request.EMPID = !string.IsNullOrWhiteSpace(txtEmpid.Text) ? Convert.ToInt32(txtEmpid.Text) : 0;  
       request.REASONFORLEAVE = Convert.ToInt32(radcbRFL.SelectedValue);  
       request.LEAVEPERIODFROM = Convert.ToDateTime(raddtLPF.SelectedDate.ToString()).ToString("yyyy-MM-dd");  
       request.LEAVEPERIODTO = Convert.ToDateTime(raddtLPT.SelectedDate.ToString()).ToString("yyyy-MM-dd");  
       request.DESCRIPTION = radtxtDescription.Text;  
       request.TOTALDAYS = !string.IsNullOrWhiteSpace(radtxtNodays.Text) ? Convert.ToInt32(radtxtNodays.Text) : 0;  
       request.Type = argtype;  
       var response = obj.AddEditDeleteLMSLeave(request);  
       if (response.ResponseCode == 1 || response.ResponseCode == 2 || response.ResponseCode == 3 || response.ResponseCode > 1)  
       {  
         lblLeaveID.Text = response.ResponseCode.ToString();  
         EnableDisableButtonControls(2);  
         txtEmpLeaveid.Text = response.ResponseCode.ToString();  
         RadWindowManagerAlert.RadAlert("Leave application has been saved successfully. ", 330, 150, "Leave Application", "", "");  
         return true;  
       }  
       else { return false; }  
     }  
     catch (Exception ex) { return false; }  
   }  
 #region GetData  
   protected void GetData(Int32 strType)  
   {  
     try  
     {  
       var request = new LMSEMPLeaveRequest();  
       var obj = new LMSBO();  
       request.Type = strType;  
       request.Cond = txtEmpLeaveid.Text;  
       request.EMPID = !string.IsNullOrWhiteSpace(txtEmpid.Text) ? Convert.ToInt32(txtEmpid.Text) : 0;  
       var response = obj.GetEMPLMSLeave(request);  
       if (response.EMPLEAVEDT.Rows.Count > 0)  
       {  
         txtEmpLeaveid.Text = response.EMPLEAVEDT.Rows[0]["EmpLeaveID"].ToString();  
         txtEmpid.Text = response.EMPLEAVEDT.Rows[0]["EMPID"].ToString();  
         radtxtEmpCode.Text = response.EMPLEAVEDT.Rows[0]["EmpCode"].ToString();  
         radtxtNameOfEmp.Text = response.EMPLEAVEDT.Rows[0]["EmpName"].ToString();  
         radtxtDepartment.Text = response.EMPLEAVEDT.Rows[0]["DepartmentName"].ToString();  
         raddtLPF.SelectedDate = Convert.ToDateTime(response.EMPLEAVEDT.Rows[0]["LeaveFromDate"].ToString());  
         raddtLPT.SelectedDate = Convert.ToDateTime(response.EMPLEAVEDT.Rows[0]["LeaveTodate"].ToString());  
         radcbRFL.SelectedValue = response.EMPLEAVEDT.Rows[0]["ReasonsID"].ToString();  
         radtxtNodays.Text = response.EMPLEAVEDT.Rows[0]["TotalDays"].ToString();  
         radtxtDescription.Text = response.EMPLEAVEDT.Rows[0]["Descrption"].ToString();  
       }  
       EnableDisableButtonControls(3);  
     }  
     catch (Exception ex) { }  
   }  
   #endregion GetData  

 if you want more related search please click here  
 please help to other  
 http://scriptquery.blogspot.in/  


 if you want more related search please click here  
 please help to other  
 http://scriptquery.blogspot.in/  


11:35 PM Share:

0 comments:

Get updates in your email box
Complete the form below, and we'll send you the best coupons.

Deliver via FeedBurner
Proudly Powered by Blogger.
back to top