Exemplo n.º 1
0
 /// <summary>
 /// Save Function
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         ServiceSP   spService   = new ServiceSP();
         ServiceInfo infoService = new ServiceInfo();
         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.ExtraDate = PublicVariables._dtCurrentDate;
         infoService.Extra1    = string.Empty;
         infoService.Extra2    = string.Empty;
         if (spService.ServiceCheckExistence(txtServiceName.Text.Trim(), 0) == false)
         {
             decIdForOtherForms = spService.ServiceAddWithReturnIdentity(infoService);
             Messages.SavedMessage();
             Clear();
             GridFill();
         }
         else
         {
             Messages.InformationMessage("Service name already exist");
             txtServiceName.Focus();
         }
         if (frmServiceVoucherObj != null)
         {
             this.Close();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Ser11 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// ServiceName Checking Existance
        /// </summary>
        /// <returns></returns>
        public bool CheckExistenceOfServiceName()
        {
            bool isExist = false;

            try
            {
                ServiceSP spService = new ServiceSP();
                isExist = spService.ServiceCheckExistence(txtServiceName.Text.Trim(), 0);
                if (isExist)
                {
                    string strServiceNames = txtServiceName.Text.Trim();
                    if (strServiceNames.ToLower() == strServiceName.ToLower())
                    {
                        isExist = false;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Ser10:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(isExist);
        }