Example #1
0
 /// <summary>
 /// Checking invalid entries For save or Update function
 /// </summary>
 public void SaveOrEdit()
 {
     try
     {
         if (txtServiceName.Text.Trim() == string.Empty)
         {
             Messages.InformationMessage("Enter service name");
             txtServiceName.Focus();
         }
         else if (cmbCategory.SelectedIndex == -1)
         {
             Messages.InformationMessage("Select category name");
             cmbCategory.Focus();
         }
         else if (txtRate.Text.Trim() == string.Empty)
         {
             Messages.InformationMessage("Enter rate");
             txtRate.Focus();
         }
         else
         {
             if (btnSave.Text == "Save")
             {
                 if (PublicVariables.isMessageAdd)
                 {
                     if (Messages.SaveMessage())
                     {
                         SaveFunction();
                     }
                 }
                 else
                 {
                     SaveFunction();
                 }
             }
             else
             {
                 if (PublicVariables.isMessageEdit)
                 {
                     if (Messages.UpdateMessage())
                     {
                         EditFunction();
                     }
                 }
                 else
                 {
                     EditFunction();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "Ser13:" + ex.Message;
     }
 }
 /// <summary>
 /// Checking invalid entries For save or Update function
 /// </summary>
 public void SaveOrEdit()
 {
     try
     {
         if (txtServiceName.Text.Trim() == string.Empty)
         {
             Messages.InformationMessage("Enter service name");
             txtServiceName.Focus();
         }
         else if (cmbCategory.SelectedIndex == -1)
         {
             Messages.InformationMessage("Select category name");
             cmbCategory.Focus();
         }
         else if (txtRate.Text.Trim() == string.Empty)
         {
             Messages.InformationMessage("Enter rate");
             txtRate.Focus();
         }
         else
         {
             if (btnSave.Text == "Save")
             {
                 if (PublicVariables.isMessageAdd)
                 {
                     if (Messages.SaveMessage())
                     {
                         SaveFunction();
                     }
                 }
                 else
                 {
                     SaveFunction();
                 }
             }
             else
             {
                 if (PublicVariables.isMessageEdit)
                 {
                     if (Messages.UpdateMessage())
                     {
                         EditFunction();
                     }
                 }
                 else
                 {
                     EditFunction();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Ser13:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// Function to call Save or Edit
 /// </summary>
 public void SaveOrEdit()
 {
     try
     {
         if (btnSave.Text == "Save")
         {
             decimal decRowCount = 0;
             decRowCount = dgvMonthySalarySettings.Rows.Count;
             if (decRowCount >= 1)
             {
                 if (PublicVariables.isMessageAdd)
                 {
                     if (Messages.SaveMessage())
                     {
                         SaveFunction();
                     }
                 }
                 else
                 {
                     SaveFunction();
                 }
             }
             else
             {
                 MessageBox.Show("Can't save Monthly salary settings without atleast one employee with complete details", "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
         else
         {
             decimal decRowCount = 0;
             decRowCount = dgvMonthySalarySettings.Rows.Count;
             if (decRowCount >= 1)
             {
                 if (PublicVariables.isMessageEdit)
                 {
                     if (Messages.UpdateMessage())
                     {
                         EditFunction();
                     }
                 }
                 else
                 {
                     EditFunction();
                 }
             }
             else
             {
                 MessageBox.Show("Can't Update Monthly salary settings without atleast one employee with complete details", "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("MSS9" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #4
0
 /// <summary>
 /// Function to call save or edit
 /// </summary>
 public void SaveOrEdit()
 {
     try
     {
         if (cmbEmployeeCode.SelectedIndex == -1)
         {
             Messages.InformationMessage("Select employee code");
             cmbEmployeeCode.Focus();
         }
         else if (Convert.ToDecimal(txtBonusAmount.Text.Trim()) == 0 && Convert.ToDecimal(txtDeductionAmount.Text.Trim()) == 0)
         {
             Messages.InformationMessage("Enter bonus/deduction Amount");
             txtBonusAmount.Focus();
         }
         else
         {
             if (btnSave.Text == "Save")
             {
                 if (PublicVariables.isMessageAdd)
                 {
                     if (Messages.SaveMessage())
                     {
                         SaveFunction();
                     }
                 }
                 else
                 {
                     SaveFunction();
                 }
             }
             else
             {
                 if (PublicVariables.isMessageEdit)
                 {
                     if (Messages.UpdateMessage())
                     {
                         EditFunction();
                     }
                     else
                     {
                         txtDate.Focus();
                     }
                 }
                 else
                 {
                     EditFunction();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "BD4:" + ex.Message;
     }
 }
Example #5
0
 /// <summary>
 /// Checking Invalid entries for Save Or Update
 /// </summary>
 public void SaveOrEdit()
 {
     try
     {
         if (txtSize.Text.Trim() == string.Empty)
         {
             Messages.InformationMessage("Enter Size");
             txtSize.Focus();
         }
         else
         {
             if (btnSave.Text == "Save")
             {
                 if (PublicVariables.isMessageAdd)
                 {
                     if (Messages.SaveMessage())
                     {
                         SaveFunction();
                     }
                 }
                 else
                 {
                     SaveFunction();
                 }
                 decIdForOtherForms = decIdentity;
                 if (frmProductCreationObj != null)
                 {
                     this.Close();
                 }
                 if (frmMultipleProductCreationObj != null)
                 {
                     this.Close();
                 }
             }
             else
             {
                 if (PublicVariables.isMessageEdit)
                 {
                     if (Messages.UpdateMessage())
                     {
                         EditFunction();
                     }
                 }
                 else
                 {
                     EditFunction();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SZ4" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #6
0
 /// <summary>
 /// Function to call save or edit
 /// </summary>
 public void SaveOrEdit()
 {
     try
     {
         if (txtModalNo.Text.Trim() == string.Empty)
         {
             Messages.InformationMessage("Enter model number");
             txtModalNo.Focus();
         }
         else
         {
             if (btnSave.Text == "Save")
             {
                 if (PublicVariables.isMessageAdd)
                 {
                     if (Messages.SaveMessage())
                     {
                         SaveFunction();
                         if (frmProductCreationObj != null)
                         {
                             this.Close();
                         }
                         if (frmMultipleProductCreationObj != null)
                         {
                             this.Close();
                         }
                     }
                 }
                 else
                 {
                     SaveFunction();
                 }
             }
             else
             {
                 if (PublicVariables.isMessageEdit)
                 {
                     if (Messages.UpdateMessage())
                     {
                         EditFunction();
                     }
                 }
                 else
                 {
                     EditFunction();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "MN5" + ex.Message;
     }
 }
Example #7
0
 /// <summary>
 /// Function to call save or edit
 /// </summary>
 public void SaveOrEdit()
 {
     try
     {
         if (txtRemindAbout.Text.Trim() == string.Empty)
         {
             Messages.InformationMessage("Enter remind About:");
             txtRemindAbout.Focus();
         }
         else
         {
             if (btnSave.Text == "Save")
             {
                 if (PublicVariables.isMessageAdd)
                 {
                     if (Messages.SaveMessage())
                     {
                         if (dtpFromDate.Value <= dtpToDate.Value)
                         {
                             SaveFunction();
                         }
                         else
                         {
                             Messages.InformationMessage(" Can't save reminder with from date greater than to date");
                             txtFromDate.Select();
                         }
                     }
                 }
                 else
                 {
                     SaveFunction();
                 }
             }
             else
             {
                 if (PublicVariables.isMessageEdit)
                 {
                     if (Messages.UpdateMessage())
                     {
                         EditFunction();
                     }
                 }
                 else
                 {
                     EditFunction();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "PREM1:" + ex.Message;
     }
 }
Example #8
0
 /// <summary>
 /// Function to call Save or Edit
 /// </summary>
 public void SaveorEdit()
 {
     try
     {
         if (txtPayheadName.Text.Trim() == string.Empty)
         {
             Messages.InformationMessage("Enter payhead name");
             txtPayheadName.Focus();
         }
         else if (cmbPayheadType.Text == string.Empty)
         {
             Messages.InformationMessage("Select type");
             cmbPayheadType.Focus();
         }
         else
         {
             if (btnPayheadSave.Text == "Save")
             {
                 if (PublicVariables.isMessageAdd)
                 {
                     if (Messages.SaveMessage())
                     {
                         SaveFunction();
                     }
                 }
                 else
                 {
                     SaveFunction();
                 }
             }
             else
             {
                 if (PublicVariables.isMessageEdit)
                 {
                     if (Messages.UpdateMessage())
                     {
                         EditFunction();
                     }
                 }
                 else
                 {
                     EditFunction();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "PH3:" + ex.Message;
     }
 }
 /// <summary>
 /// Function to call Save or Edit
 /// </summary>
 public void SaveorEdit()
 {
     try
     {
         if (txtPayheadName.Text.Trim() == string.Empty)
         {
             Messages.InformationMessage("Enter payhead name");
             txtPayheadName.Focus();
         }
         else if (cmbPayheadType.Text == string.Empty)
         {
             Messages.InformationMessage("Select type");
             cmbPayheadType.Focus();
         }
         else
         {
             if (btnPayheadSave.Text == "Save")
             {
                 if (PublicVariables.isMessageAdd)
                 {
                     if (Messages.SaveMessage())
                     {
                         SaveFunction();
                     }
                 }
                 else
                 {
                     SaveFunction();
                 }
             }
             else
             {
                 if (PublicVariables.isMessageEdit)
                 {
                     if (Messages.UpdateMessage())
                     {
                         EditFunction();
                     }
                 }
                 else
                 {
                     EditFunction();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PH3:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// Function to call save or edit
 /// </summary>
 public void SaveOrEdit()
 {
     try
     {
         if (cmbCurrency.SelectedIndex == -1)
         {
             Messages.InformationMessage("Select currency");
             cmbCurrency.Focus();
         }
         else if (txtExchangeRate.Text.Trim() == string.Empty)
         {
             Messages.InformationMessage("Enter exchange rate");
             txtExchangeRate.Focus();
         }
         else
         {
             if (btnSave.Text == "Save")
             {
                 if (PublicVariables.isMessageAdd)
                 {
                     if (Messages.SaveMessage())
                     {
                         SaveFunction();
                     }
                 }
                 else
                 {
                     SaveFunction();
                 }
             }
             else
             {
                 if (PublicVariables.isMessageEdit)
                 {
                     if (Messages.UpdateMessage())
                     {
                         Editfunction();
                     }
                 }
                 else
                 {
                     Editfunction();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("ER4:" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #11
0
 /// <summary>
 /// Function to call save or edit
 /// </summary>
 public void SaveOrEdit()
 {
     try
     {
         if (cmbCurrency.SelectedIndex == -1)
         {
             Messages.InformationMessage("Select currency");
             cmbCurrency.Focus();
         }
         else if (txtExchangeRate.Text.Trim() == string.Empty)
         {
             Messages.InformationMessage("Enter exchange rate");
             txtExchangeRate.Focus();
         }
         else
         {
             if (btnSave.Text == "Save")
             {
                 if (PublicVariables.isMessageAdd)
                 {
                     if (Messages.SaveMessage())
                     {
                         SaveFunction();
                     }
                 }
                 else
                 {
                     SaveFunction();
                 }
             }
             else
             {
                 if (PublicVariables.isMessageEdit)
                 {
                     if (Messages.UpdateMessage())
                     {
                         Editfunction();
                     }
                 }
                 else
                 {
                     Editfunction();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "ER4:" + ex.Message;
     }
 }
 /// <summary>
 /// Function to call save or edit function after user confirmation and also checks invalid entries
 /// </summary>
 public void SaveOrEdit()
 {
     try
     {
         if (txtServiceCategory.Text.Trim() == string.Empty)
         {
             Messages.InformationMessage("Enter service category name");
             txtServiceCategory.Focus();
         }
         else
         {
             if (btnSave.Text == "Save")
             {
                 if (PublicVariables.isMessageAdd)
                 {
                     if (Messages.SaveMessage())
                     {
                         SaveFunction();
                     }
                 }
                 else
                 {
                     SaveFunction();
                 }
                 if (frmServicesObj != null)
                 {
                     this.Close();
                 }
             }
             else
             {
                 if (PublicVariables.isMessageEdit)
                 {
                     if (Messages.UpdateMessage())
                     {
                         EditFunction();
                     }
                 }
                 else
                 {
                     EditFunction();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SC5" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #13
0
 /// <summary>
 /// Save Or Update Function, to checking invalid entries
 /// </summary>
 public void SaveOrEditFunction()
 {
     try
     {
         if (txtRole.Text.Trim() == string.Empty)
         {
             Messages.InformationMessage("Enter role");
             txtRole.Focus();
         }
         else
         {
             if (btnSave.Text == "Save")
             {
                 if (PublicVariables.isMessageAdd)
                 {
                     if (Messages.SaveMessage())
                     {
                         SaveFunction();
                     }
                 }
                 else
                 {
                     SaveFunction();
                 }
                 if (frmUserCreationobj != null)
                 {
                     this.Close();
                 }
             }
             else
             {
                 if (PublicVariables.isMessageEdit)
                 {
                     if (Messages.UpdateMessage())
                     {
                         EditFunction();
                     }
                 }
                 else
                 {
                     EditFunction();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "RL:5" + ex.Message;
     }
 }
Example #14
0
 /// <summary>
 /// Function to determine whether to call SaveFunction or EditFunction and also checking invalid entries
 /// </summary>
 public void SaveOrEdit()
 {
     try
     {
         if (btnSave.Text == "Save")
         {
             if (cmbBatch.Text.Trim() == string.Empty)
             {
                 Messages.InformationMessage("Enter batch");
                 cmbBatch.Focus();
                 cmbBatch.SelectionStart = 0;
             }
             else if (txtRate.Text.Trim() == String.Empty || Convert.ToDecimal(txtRate.Text.ToString()) == 0)
             {
                 Messages.InformationMessage("Enter rate");
                 txtRate.Focus();
             }
             else if (PublicVariables.isMessageAdd)
             {
                 if (Messages.SaveMessage())
                 {
                     SaveFunction();
                 }
             }
             else
             {
                 SaveFunction();
             }
         }
         else
         {
             if (PublicVariables.isMessageEdit)
             {
                 if (Messages.UpdateMessage())
                 {
                     EditFunction();
                 }
             }
             else
             {
                 EditFunction();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PLP4" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #15
0
 /// <summary>
 /// Function to determine whether to call SaveFunction or EditFunction and also checking invalid entries
 /// </summary>
 public void SaveOrEdit()
 {
     try
     {
         if (btnSave.Text == "Save")
         {
             if (cmbBatch.Text.Trim() == string.Empty)
             {
                 Messages.InformationMessage("Enter batch");
                 cmbBatch.Focus();
                 cmbBatch.SelectionStart = 0;
             }
             else if (txtRate.Text.Trim() == String.Empty || Convert.ToDecimal(txtRate.Text.ToString()) == 0)
             {
                 Messages.InformationMessage("Enter rate");
                 txtRate.Focus();
             }
             else if (PublicVariables.isMessageAdd)
             {
                 if (Messages.SaveMessage())
                 {
                     SaveFunction();
                 }
             }
             else
             {
                 SaveFunction();
             }
         }
         else
         {
             if (PublicVariables.isMessageEdit)
             {
                 if (Messages.UpdateMessage())
                 {
                     EditFunction();
                 }
             }
             else
             {
                 EditFunction();
             }
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "PLP4" + ex.Message + ex.Message;
     }
 }
 /// <summary>
 /// Function to call Save or Edit
 /// </summary>
 public void SaveOrEdit()
 {
     try
     {
         if (txtCounterName.Text.Trim() == string.Empty)
         {
             Messages.InformationMessage("Enter counter name");
             txtCounterName.Focus();
         }
         else
         {
             if (btnSave.Text == "Save")
             {
                 if (PublicVariables.isMessageAdd)
                 {
                     if (Messages.SaveMessage())
                     {
                         SaveFunction();
                     }
                 }
                 else
                 {
                     SaveFunction();
                 }
             }
             else
             {
                 if (PublicVariables.isMessageEdit)
                 {
                     if (Messages.UpdateMessage())
                     {
                         EditFunction();
                     }
                 }
                 else
                 {
                     EditFunction();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("CT5" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #17
0
 /// <summary>
 /// Function to call Save or Edit
 /// </summary>
 public void SaveOrEdit()
 {
     try
     {
         if (txtCounterName.Text.Trim() == string.Empty)
         {
             Messages.InformationMessage("Enter counter name");
             txtCounterName.Focus();
         }
         else
         {
             if (btnSave.Text == "Save")
             {
                 if (PublicVariables.isMessageAdd)
                 {
                     if (Messages.SaveMessage())
                     {
                         SaveFunction();
                     }
                 }
                 else
                 {
                     SaveFunction();
                 }
             }
             else
             {
                 if (PublicVariables.isMessageEdit)
                 {
                     if (Messages.UpdateMessage())
                     {
                         EditFunction();
                     }
                 }
                 else
                 {
                     EditFunction();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "CT5" + ex.Message;
     }
 }
Example #18
0
 /// <summary>
 /// Function to call save or edit
 /// </summary>
 public void SaveOrEdit()
 {
     try
     {
         if (btnSave.Text == "Save")
         {
             if (PublicVariables.isMessageAdd)
             {
                 if (Messages.SaveMessage())
                 {
                     SaveFunction();
                 }
             }
             else
             {
                 SaveFunction();
             }
         }
         else
         {
             if (PublicVariables.isMessageEdit)
             {
                 if (Messages.UpdateMessage())
                 {
                     EditFunction();
                 }
             }
             else
             {
                 EditFunction();
             }
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "A4:" + ex.Message;
     }
 }
Example #19
0
 /// <summary>
 /// Function to call save or edit
 /// </summary>
 public void SaveOrEdit()
 {
     try
     {
         if (btnSave.Text == "Save")
         {
             if (PublicVariables.isMessageAdd)
             {
                 if (Messages.SaveMessage())
                 {
                     SaveFunction();
                 }
             }
             else
             {
                 SaveFunction();
             }
         }
         else
         {
             if (PublicVariables.isMessageEdit)
             {
                 if (Messages.UpdateMessage())
                 {
                     EditFunction();
                 }
             }
             else
             {
                 EditFunction();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("A4" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #20
0
 /// <summary>
 /// Edit Function
 /// </summary>
 public void EditFunction()
 {
     try
     {
         if (RemoveIncompleteRowsFromGrid())
         {
             if (PublicVariables.isMessageEdit)
             {
                 if (Messages.UpdateMessage())
                 {
                     SendTableForUpdate();
                 }
             }
             else
             {
                 SendTableForUpdate();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PB:11" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #21
0
 /// <summary>
 /// Edit Function
 /// </summary>
 public void EditFunction()
 {
     try
     {
         if (RemoveIncompleteRowsFromGrid())
         {
             if (PublicVariables.isMessageEdit)
             {
                 if (Messages.UpdateMessage())
                 {
                     SendTableForUpdate();
                 }
             }
             else
             {
                 SendTableForUpdate();
             }
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "PB:11" + ex.Message;
     }
 }
 /// <summary>
 /// checking invalid entries for save or update function
 /// </summary>
 public void SaveOrEdit()
 {
     try
     {
         if (txtFromDate.Text == String.Empty)
         {
             Messages.InformationMessage("Enter from date");
             txtFromDate.Focus();
         }
         else if (txtToDate.Text == String.Empty)
         {
             Messages.InformationMessage("Enter to date");
             txtToDate.Focus();
         }
         else if (cmbVoucherType.Text.Trim() == String.Empty)
         {
             Messages.InformationMessage("Select voucher type");
             cmbVoucherType.Focus();
         }
         else if (txtStartIndex.Text.Trim() == String.Empty || Convert.ToDecimal(txtStartIndex.Text.ToString()) == 0)
         {
             Messages.InformationMessage("Start index should be greater than zero");
             txtStartIndex.Focus();
         }
         else if (cbxPrefillWithZero.Checked && txtWidthofNumericalPart.Text.Trim() == string.Empty)
         {
             Messages.InformationMessage(" Enter Width of numerical part");
             txtWidthofNumericalPart.Focus();
         }
         else if (Convert.ToDateTime(txtFromDate.Text.ToString()) > Convert.ToDateTime(txtToDate.Text.ToString()))
         {
             Messages.InformationMessage("Selected fromDate is greater than toDate.Select different fromDate");
             txtToDate.Focus();
         }
         else
         {
             if (btnSave.Text == "Save")
             {
                 if (PublicVariables.isMessageAdd)
                 {
                     if (Messages.SaveMessage())
                     {
                         SaveFunction();
                     }
                 }
                 else
                 {
                     SaveFunction();
                 }
             }
             else
             {
                 if (PublicVariables.isMessageEdit)
                 {
                     if (Messages.UpdateMessage())
                     {
                         EditFunction();
                     }
                 }
                 else
                 {
                     EditFunction();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SPS6" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #23
0
        /// <summary>
        /// Function to determine whether to call save or edit function and also checking invalid entries
        /// </summary>
        private void SaveOrEdit()
        {
            try
            {
                if (txtProductGroupName.Text.Trim() == string.Empty)
                {
                    Messages.InformationMessage("Enter product group name");
                    txtProductGroupName.Focus();
                }
                else if (cmbUnder.SelectedIndex == -1)
                {
                    Messages.InformationMessage("Select under");
                    cmbUnder.Focus();
                }
                else
                {
                    if (btnSave.Text == "Save")
                    {
                        if (PublicVariables.isMessageAdd)
                        {
                            if (Messages.SaveMessage())
                            {
                                SaveFunction();
                            }
                        }
                        else
                        {
                            SaveFunction();
                        }
                        if (frmMultipleProductCreationObj != null)
                        {
                            this.Close();
                        }


                        if (frmProductCreationObj != null)
                        {
                            this.Close();
                        }
                    }
                    else
                    {
                        if (PublicVariables.isMessageEdit)
                        {
                            if (Messages.UpdateMessage())
                            {
                                EditFunction();
                            }
                        }
                        else
                        {
                            EditFunction();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("PG3:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Example #24
0
        /// <summary>
        /// Function to call Save or Edit function after user confirmation and also checks the invalid entries
        /// </summary>
        public void SaveOrEdit()
        {
            try
            {
                if (txtRouteName.Text.Trim() == String.Empty)
                {
                    Messages.InformationMessage("Enter route name");
                    txtRouteName.Focus();
                }
                else if (cmbArea.Text.Trim() == string.Empty)
                {
                    Messages.InformationMessage(" Select area");
                    cmbArea.Focus();
                }
                else
                {
                    if (btnSave.Text == "Save")
                    {
                        if (PublicVariables.isMessageAdd)
                        {
                            if (Messages.SaveMessage())
                            {
                                SaveFunction();


                                if (frmSupplierobj != null)
                                {
                                    this.Close();
                                }
                            }
                        }
                        else
                        {
                            SaveFunction();

                            if (frmSupplierobj != null)
                            {
                                this.Close();
                            }
                        }
                    }
                    else
                    {
                        if (PublicVariables.isMessageEdit)
                        {
                            if (Messages.UpdateMessage())
                            {
                                EditFunction();
                            }
                        }
                        else
                        {
                            EditFunction();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("RT6" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Example #25
0
 /// <summary>
 /// Function to call save or edit function after user confirmation and also checks invalid entries
 /// </summary>
 public void SaveOrEdit()
 {
     try
     {
         EmployeeInfo infoEmployee = new EmployeeInfo();
         if (txtSalesmanCode.Text.Trim() == string.Empty)
         {
             Messages.InformationMessage("Enter salesman code");
             txtSalesmanCode.Focus();
         }
         else if (txtName.Text.Trim() == string.Empty)
         {
             Messages.InformationMessage("Enter salesman name");
             txtName.Focus();
         }
         else
         {
             if (btnSave.Text == "Save")
             {
                 if (PublicVariables.isMessageAdd)
                 {
                     if (Messages.SaveMessage())
                     {
                         SaveFunction();
                     }
                 }
                 else
                 {
                     SaveFunction();
                 }
                 decIdForOtherForm = decSalesManId;
                 if (frmServiceVoucherObj != null)
                 {
                     if (decIdForOtherForm != 0)
                     {
                         this.Close();
                     }
                     else
                     {
                         txtName.Focus();
                     }
                 }
                 if (frmDeliveryNoteObj != null)
                 {
                     if (decIdForOtherForm != 0)
                     {
                         this.Close();
                     }
                     else
                     {
                         txtName.Focus();
                     }
                 }
                 if (frmPOSObj != null)
                 {
                     if (decIdForOtherForm != 0)
                     {
                         this.Close();
                     }
                     else
                     {
                         txtName.Focus();
                     }
                 }
             }
             else
             {
                 if (PublicVariables.isMessageEdit)
                 {
                     if (Messages.UpdateMessage())
                     {
                         EditFunction();
                     }
                 }
                 else
                 {
                     EditFunction();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "S7" + ex.Message;
     }
 }
Example #26
0
        /// <summary>
        /// function for Save or Edit
        /// </summary>
        public void SaveOrEditFunction()
        {
            try
            {
                bool isSave = false;
                infoSalaryPackage.SalaryPackageName = txtPackageName.Text;
                if (cmbActive.Text == "Yes")
                {
                    infoSalaryPackage.IsActive = true;
                }
                else
                {
                    infoSalaryPackage.IsActive = false;
                }
                infoSalaryPackage.Narration   = txtNarration.Text;
                infoSalaryPackage.Extra1      = string.Empty;
                infoSalaryPackage.Extra2      = string.Empty;
                infoSalaryPackage.TotalAmount = Convert.ToDecimal(lblSalaryAmount.Text.ToString());
                if (btnSave.Text == "Save")
                {
                    if (PublicVariables.isMessageAdd)
                    {
                        if (Messages.SaveMessage())
                        {
                            decSalaryPackageId = spSalaryPackage.SalaryPackageAdd(infoSalaryPackage);
                            if (decSalaryPackageId != -1)
                            {
                                isSave = SavePayHeadDetails();
                                if (isSave)
                                {
                                    Messages.SavedMessage();
                                    if (frmEmployeeCreationObj != null)
                                    {
                                        this.Close();
                                    }
                                    Clear();
                                }
                                else
                                {
                                    spSalaryPackage.SalaryPackageDeleteAll(decSalaryPackageId);
                                }
                            }
                            else
                            {
                                Messages.InformationMessage("Package name already exists");
                                txtPackageName.Focus();
                            }
                        }
                    }
                    else
                    {
                        decSalaryPackageId = spSalaryPackage.SalaryPackageAdd(infoSalaryPackage);
                        if (decSalaryPackageId != -1)
                        {
                            isSave = SavePayHeadDetails();
                            if (isSave)
                            {
                                Messages.SavedMessage();
                                if (frmEmployeeCreationObj != null)
                                {
                                    this.Close();
                                }
                                Clear();
                            }
                            else
                            {
                                spSalaryPackage.SalaryPackageDeleteAll(decSalaryPackageId);
                            }
                        }
                        else
                        {
                            Messages.InformationMessage("Package name already exists");
                            txtPackageName.Focus();
                        }
                    }
                }
                else
                {
                    if (PublicVariables.isMessageEdit)
                    {
                        if (Messages.UpdateMessage())
                        {
                            if (txtPackageName.Text != strSalaryPackageName)
                            {
                                if (!spSalaryPackage.SalaryPackageNameCheckExistance(txtPackageName.Text))
                                {
                                    spSalaryPackage.SalaryPackageEdit(infoSalaryPackage);
                                    spSalarypackageDetails.SalaryPackageDetailsDeleteWithSalaryPackageId(decSalaryPackageId);
                                    isSave = SavePayHeadDetails();
                                    if (isSave)
                                    {
                                        Messages.UpdatedMessage();

                                        this.Close();
                                    }
                                    else
                                    {
                                        spSalaryPackage.SalaryPackageDeleteAll(decSalaryPackageId);
                                    }
                                }
                                else
                                {
                                    Messages.InformationMessage("Package name already exist");
                                    txtPackageName.Focus();
                                }
                            }
                            else
                            {
                                spSalaryPackage.SalaryPackageEdit(infoSalaryPackage);
                                spSalarypackageDetails.SalaryPackageDetailsDeleteWithSalaryPackageId(decSalaryPackageId);
                                isSave = SavePayHeadDetails();
                                if (isSave)
                                {
                                    Messages.UpdatedMessage();

                                    this.Close();
                                }
                                else
                                {
                                    spSalaryPackage.SalaryPackageDeleteAll(decSalaryPackageId);
                                }
                            }
                        }
                    }
                    else
                    {
                        if (txtPackageName.Text != strSalaryPackageName)
                        {
                            if (!spSalaryPackage.SalaryPackageNameCheckExistance(txtPackageName.Text))
                            {
                                spSalaryPackage.SalaryPackageEdit(infoSalaryPackage);
                                spSalarypackageDetails.SalaryPackageDetailsDeleteWithSalaryPackageId(decSalaryPackageId);
                                isSave = SavePayHeadDetails();
                                if (isSave)
                                {
                                    Messages.UpdatedMessage();

                                    this.Close();
                                }
                                else
                                {
                                    spSalaryPackage.SalaryPackageDeleteAll(decSalaryPackageId);
                                }
                            }
                            else
                            {
                                Messages.InformationMessage("Package name already exist");
                                txtPackageName.Focus();
                            }
                        }
                        else
                        {
                            spSalaryPackage.SalaryPackageEdit(infoSalaryPackage);
                            spSalarypackageDetails.SalaryPackageDetailsDeleteWithSalaryPackageId(decSalaryPackageId);
                            isSave = SavePayHeadDetails();
                            if (isSave)
                            {
                                Messages.UpdatedMessage();

                                this.Close();
                            }
                            else
                            {
                                spSalaryPackage.SalaryPackageDeleteAll(decSalaryPackageId);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                formMDI.infoError.ErrorString = "SPC10:" + ex.Message;
            }
        }
 /// <summary>
 /// checking the invalid entries and call asve function or edit function
 /// </summary>
 public void SaveOrEdit()
 {
     try
     {
         if (txtUnitname.Text.Trim() == string.Empty)
         {
             Messages.InformationMessage(" Enter unit name ");
             txtUnitname.Focus();
         }
         else if (txtFormalName.Text.Trim() == string.Empty)
         {
             Messages.InformationMessage(" Enter formal name");
             txtFormalName.Focus();
         }
         else if (txtDecimalPlaces.Text == string.Empty)
         {
             Messages.InformationMessage(" Enter no of decimal places");
             txtDecimalPlaces.Focus();
         }
         else
         {
             if (btnSave.Text == "Save")
             {
                 if (PublicVariables.isMessageAdd)
                 {
                     if (Messages.SaveMessage())
                     {
                         SaveFunction();
                         decIdforOtherForm = decUnit;
                         if (frmMultipleProductCreationObj != null)
                         {
                             this.Close();
                         }
                         if (frmProductCreationObj != null)
                         {
                             this.Close();
                         }
                     }
                 }
                 else
                 {
                     SaveFunction();
                     decIdforOtherForm = decUnit;
                     if (frmMultipleProductCreationObj != null)
                     {
                         this.Close();
                     }
                     if (frmProductCreationObj != null)
                     {
                         this.Close();
                     }
                 }
             }
             else
             {
                 if (PublicVariables.isMessageEdit)
                 {
                     if (Messages.UpdateMessage())
                     {
                         EditFunction();
                     }
                 }
                 else
                 {
                     EditFunction();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("U5:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
        /// <summary>
        /// checking invalid entries for Save and Update and call the curresponding function
        /// </summary>
        public void SaveOrEdit()
        {
            try
            {
                if (txtProductCode.Text == string.Empty)
                {
                    Messages.InformationMessage("Product not Selected");
                }
                else if (cmbBatch.Text.Trim() == string.Empty)
                {
                    Messages.InformationMessage("Enter batch");
                    cmbBatch.Focus();
                }
                else if (txtRate.Text.Trim() == string.Empty || Convert.ToDecimal(txtRate.Text.ToString()) == 0)
                {
                    Messages.InformationMessage("Enter rate");
                    txtRate.Focus();
                }
                else if (txtToDate.Text.ToString() == string.Empty)
                {
                    Messages.InformationMessage("Enter Valid Date");
                    txtToDate.Focus();
                }
                else if (Convert.ToDateTime(txtFromDate.Text.ToString()) > Convert.ToDateTime(txtToDate.Text.ToString()))
                {
                    Messages.InformationMessage("FromDate greater than ToDate");
                    txtFromDate.Focus();
                }

                else
                {
                    if (btnSave.Text == "Save")
                    {
                        if (PublicVariables.isMessageAdd)
                        {
                            if (Messages.SaveMessage())
                            {
                                SaveFunction();
                            }
                        }
                        else
                        {
                            SaveFunction();
                        }
                    }
                    else
                    {
                        if (PublicVariables.isMessageEdit)
                        {
                            if (Messages.UpdateMessage())
                            {
                                EditFunction();
                            }
                        }
                        else
                        {
                            EditFunction();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("SRP7:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Example #29
0
 /// <summary>
 /// Save Or Update Function
 /// </summary>
 public void SaveOrEdit()
 {
     try
     {
         if (txtUserName.Text.Trim() == string.Empty)
         {
             Messages.InformationMessage("Enter username");
             txtUserName.Focus();
         }
         else if (txtPassword.Text.Trim() == string.Empty)
         {
             Messages.InformationMessage("Enter password");
             txtPassword.Focus();
         }
         else if (txtPassword.Text != txtRetype.Text)
         {
             Messages.InformationMessage("Password and confirm password should match");
             txtRetype.Focus();
             txtRetype.Clear();
         }
         else if (cmbRole.SelectedIndex == -1)
         {
             Messages.InformationMessage("Select role");
             cmbRole.Focus();
         }
         else
         {
             if (btnSave.Text == "Save")
             {
                 if (PublicVariables.isMessageAdd)
                 {
                     if (Messages.SaveMessage())
                     {
                         SaveFunction();
                         cmbRole.SelectedIndex = -1;
                     }
                 }
                 else
                 {
                     SaveFunction();
                     cmbRole.SelectedIndex = -1;
                 }
             }
             else
             {
                 if (PublicVariables.isMessageEdit)
                 {
                     if (Messages.UpdateMessage())
                     {
                         EditFunction();
                         cmbRole.SelectedIndex = -1;
                     }
                 }
                 else
                 {
                     EditFunction();
                     cmbRole.SelectedIndex = -1;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("UC:5" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #30
0
        /// <summary>
        /// Function to call Save or Edit
        /// </summary>
        private void SaveOrEdit()
        {
            try
            {
                if (txtAdvanceAmount.Text == string.Empty)
                {
                    txtAdvanceAmount.Text = "0";
                }
                if (txtCLInMonth.Text == string.Empty)
                {
                    txtCLInMonth.Text = "0";
                }
                if (txtDesignationName.Text.Trim() == string.Empty)
                {
                    Messages.InformationMessage("Enter designation name");
                    txtDesignationName.Focus();
                }
                else if (decimal.Parse(txtCLInMonth.Text) > 30)
                {
                    Messages.InformationMessage("Maximum CL in a month is 30");
                    txtCLInMonth.Focus();
                }

                else
                {
                    if (btnSave.Text == "Save")
                    {
                        if (PublicVariables.isMessageAdd)// for message option
                        {
                            if (Messages.SaveMessage())
                            {
                                SaveFunction();
                                Clear();
                                GridFill();
                            }
                        }
                        else
                        {
                            SaveFunction();
                            Clear();
                            GridFill();
                        }

                        decIdForOtherForms = decIdentity;
                        if (frmEmployeeObj != null)
                        {
                            this.Close();
                        }
                    }

                    if (btnSave.Text == "Update")
                    {
                        if (PublicVariables.isMessageEdit)
                        {
                            if (Messages.UpdateMessage())
                            {
                                EditFunction();
                                Clear();
                                GridFill();
                            }
                        }

                        else
                        {
                            EditFunction();
                            Clear();
                            GridFill();
                        }
                    }
                    GridFill();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("D1:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }