/// <summary> /// Edit Function /// </summary> public void EditFunction() { try { ServiceSP spService = new ServiceSP(); ServiceInfo infoService = new ServiceInfo(); infoService.ServiceId = Convert.ToDecimal(dgvService.CurrentRow.Cells["dgvtxtServiceId"].Value.ToString()); infoService.ServiceName = txtServiceName.Text.Trim(); infoService.ServiceCategoryId = Convert.ToDecimal(cmbCategory.SelectedValue.ToString()); infoService.Rate = Convert.ToDecimal(txtRate.Text.ToString()); infoService.Narration = txtNarration.Text.Trim(); infoService.Extra1 = string.Empty; infoService.Extra2 = string.Empty; if (CheckExistenceOfServiceName() == false) { if (spService.ServiceEdit(infoService)) { Messages.UpdatedMessage(); Clear(); txtServiceName.Focus(); } } else { Messages.InformationMessage("Already exists"); txtServiceName.Focus(); } } catch (Exception ex) { MessageBox.Show("Ser12:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to Update values in Service Table /// </summary> /// <param name="serviceinfo"></param> /// <returns></returns> public bool ServiceEdit(ServiceInfo serviceinfo) { bool isEdit = false; try { isEdit = spService.ServiceEdit(serviceinfo); } catch (Exception ex) { MessageBox.Show("AL35:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } return(isEdit); }