/// <summary> /// this method is used for adding new and updating the information regarding the MVType which is /// called on clicking save button. /// </summary> private void UpdateMedicalVendorType() { //MedicalVendorTypeService service = new MedicalVendorTypeService(); //HealthYes.Web.UI.MedicalVendorTypeService.EMedicalVendorType medicalvendortype = new HealthYes.Web.UI.MedicalVendorTypeService.EMedicalVendorType(); EMedicalVendorType medicalvendortype = new EMedicalVendorType(); medicalvendortype.Description = txtDescription.Text; medicalvendortype.Name = txtName.Text; medicalvendortype.Active = true; Int64 returnresult; MedicalVendorDAL medicalVendorDal = new MedicalVendorDAL(); if (hfMedicalVendorTypeID.Value.ToString().Equals("")) { returnresult = medicalVendorDal.SaveMedicalVendorType(medicalvendortype, Convert.ToInt32(EOperationMode.Insert)); if (returnresult == 0) { returnresult = 9999990; } } else { medicalvendortype.MedicalVendorTypeID = Convert.ToInt32(((DataTable)(ViewState["DSGRID"])).Rows[grdMedicalVendorType.Rows[Convert.ToInt32(hfMedicalVendorTypeID.Value)].DataItemIndex]["MedicalVendorTypeID"]); returnresult = medicalVendorDal.SaveMedicalVendorType(medicalvendortype, Convert.ToInt32(EOperationMode.Update)); if (returnresult == 0) { returnresult = 9999991; } } errordiv.InnerHtml = (String)GetGlobalResourceObject("Resource", "msgDatabaseResult" + returnresult.ToString()); hfMedicalVendorTypeID.Value = ""; GetMedicalVendorType(); }
/// <summary> /// this method is used for deactivating the selected MedicalVendorType(s). /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnDeActivate_Click(object sender, ImageClickEventArgs e) { Int64 returnresult; string strSelectedMedicalVendorTypeIDs = GetSelectedMedicalVendorTypeIDs(); if (strSelectedMedicalVendorTypeIDs.Length > 0) { MedicalVendorDAL medicalVendorDal = new MedicalVendorDAL(); returnresult = medicalVendorDal.SaveMedicalVendorType(strSelectedMedicalVendorTypeIDs, Convert.ToInt32(EOperationMode.DeActivate)); if (returnresult == 0) { returnresult = 9999993; } errordiv.InnerHtml = (String)GetGlobalResourceObject("Resource", "msgDatabaseResult" + returnresult.ToString()); hfMedicalVendorTypeID.Value = ""; GetMedicalVendorType(); } }