private void button3_Click(object sender, EventArgs e) { try { if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Update, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { string x = dgsaved.SelectedRows[0].Cells[0].Value.ToString(); T_SalesAllocDet det = new T_SalesAllocDet(); det.Docno = x.ToString(); List <T_SalesAllocDet> dets = new List <T_SalesAllocDet>(); dets = new T_SalesAllocDetDL().SelectT_SalesAllocDetMulti(det); foreach (T_SalesAllocDet de in dets) { new T_SalesAllocDetDL().Savet_SalesAllocDetSP(de, 4); } LoadDataSavedALLOCATIONS(); UserDefineMessages.ShowMsg1("All allocation breakdown Detleted for header allocation NO: " + x, UserDefineMessages.Msg_Information); } } catch (Exception ex) { } }
private void performButtons(xEnums.PerformanceType xenum) { try { switch (xenum) { case xEnums.PerformanceType.View: if (ActiveControl.Name.Trim() == txt_no.Name.Trim()) { int length = Convert.ToInt32(ConfigurationManager.AppSettings["POFieldLength"]); string[] strSearchField = new string[length]; string strSQL = ConfigurationManager.AppSettings["POSQL"].ToString(); for (int i = 0; i < length; i++) { string m; m = i.ToString(); strSearchField[i] = ConfigurationManager.AppSettings["POField" + m + ""].ToString(); } frmU_Search find = new frmU_Search(strSQL, strSearchField, this); find.ShowDialog(this); } break; case xEnums.PerformanceType.New: FunctionButtonStatus(xEnums.PerformanceType.New); formMode = 1; txt_no.Text = commonFunctions.GetSerial(formID.Trim()); txt_no.Focus(); txt_sourceLocId.Text = commonFunctions.GlobalLocation; txt_locationId_name.Text = findExisting.FindExisitingLoca(txt_sourceLocId.Text.Trim()); errorProvider1.Clear(); lbl_processes.Visible = false; break; case xEnums.PerformanceType.Edit: FunctionButtonStatus(xEnums.PerformanceType.Edit); formMode = 3; //txt_VehicleID.Enabled = false; //txt_VehicleNo.Focus(); errorProvider1.Clear(); break; case xEnums.PerformanceType.Save: errorProvider1.Clear(); if (formMode == 1) { if (txt_sourceLocId.Text.Trim().ToUpper() == txt_destinationLocId.Text.Trim().ToUpper()) { errorProvider1.SetError(txt_destinationLocId, "Destination location cannot same as login location"); return; } if (!M_LocaDL.ExistingM_Loca(txt_sourceLocId.Text.Trim())) { errorProvider1.SetError(txt_sourceLocId, "Location does not exists on the system "); commonFunctions.SetMDIStatusMessage("Location does not exists on the system", 1); return; } if (!M_LocaDL.ExistingM_Loca(txt_destinationLocId.Text.Trim())) { errorProvider1.SetError(txt_destinationLocId, "Destination Location does not exists on the system "); commonFunctions.SetMDIStatusMessage("Destination Location does not exists on the system", 1); return; } if (commonFunctions.GetNoofItems(dataGridView1) <= 0) { errorProvider1.SetError(dataGridView1, "Please enter some items to the details grid"); commonFunctions.SetMDIStatusMessage("Please enter some items to the details grid", 1); return; } if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Save, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { try { using (System.Transactions.TransactionScope transaction = new System.Transactions.TransactionScope()) { //u_DBConnection.BeginTrans(); //save header data t_trnsferInNote objt_trnsferInNote = new t_trnsferInNote(); objt_trnsferInNote.transinNo = txt_no.Text.Trim(); objt_trnsferInNote.sourceLocId = commonFunctions.GlobalLocation; objt_trnsferInNote.date = dte_date.Value; objt_trnsferInNote.refNo = txt_refNo.Text.Trim(); objt_trnsferInNote.remarks = txt_remarks.Text.Trim(); objt_trnsferInNote.destinationLocId = txt_destinationLocId.Text.Trim(); objt_trnsferInNote.purchaseReqNo = txt_purchaseReqNo.Text.Trim(); objt_trnsferInNote.noOfItems = commonFunctions.ToDecimal(txt_noOfItems.Text.Trim()); objt_trnsferInNote.noOfPeaces = commonFunctions.ToDecimal(txt_noOfPeaces.Text.Trim()); objt_trnsferInNote.grossAmount = commonFunctions.ToDecimal(txt_grossAmount.Text.Trim()); objt_trnsferInNote.isProcessed = false; objt_trnsferInNote.processDate = DateTime.Now; objt_trnsferInNote.processUser = ""; objt_trnsferInNote.GLUpdate = false; objt_trnsferInNote.triggerVal = 1; T_trnsferInNoteDL bal = new T_trnsferInNoteDL(); bal.Savet_trnsferInNoteSP(objt_trnsferInNote, 1); //save details foreach (DataGridViewRow drow in dataGridView1.Rows) { if (drow.Cells["Product Code"].Value.ToString().Trim() != null) { t_transferIn_detail objt_transferIn_detail = new t_transferIn_detail(); objt_transferIn_detail.transinrNo = txt_no.Text.Trim(); objt_transferIn_detail.sourceLocId = commonFunctions.GlobalLocation; objt_transferIn_detail.destinationLocId = txt_destinationLocId.Text.Trim(); objt_transferIn_detail.transferDate = dte_date.Value; objt_transferIn_detail.stockCode = drow.Cells["Product Code"].Value.ToString(); objt_transferIn_detail.description = drow.Cells["Product Name"].Value.ToString(); objt_transferIn_detail.quantity = commonFunctions.ToDecimal(drow.Cells["Quntity"].Value.ToString()); objt_transferIn_detail.costPrice = commonFunctions.ToDecimal(drow.Cells["Cost Price"].Value.ToString()); objt_transferIn_detail.amount = commonFunctions.ToDecimal(drow.Cells["Amount"].Value.ToString()); objt_transferIn_detail.triggerVal = 1; T_transferIn_detailDL bal2 = new T_transferIn_detailDL(); bal2.Savet_transferIn_detailSP(objt_transferIn_detail, 1); } } //increment the serial commonFunctions.IncrementSerial(formID); transaction.Complete(); //u_DBConnection.CommitTrans(); UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_Save_Sucess, commonFunctions.Softwarename.Trim()); } } catch (Exception ex) { // u_DBConnection.RollbackTrans(); LogFile.WriteErrorLog("Save Transactions", "Transfer In", ex.Message); LogFile.WriteErrorLog("Save Transactions", "Transfer Out", ex.Message); commonFunctions.SetMDIStatusMessage("Transfer Number you have entered already processed", 1); } if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Process, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { UpdateStock(); t_trnsferInNote objt_trnsferNote = new t_trnsferInNote(); objt_trnsferNote.transinNo = txt_no.Text.Trim(); T_trnsferInNoteDL balprocess = new T_trnsferInNoteDL(); objt_trnsferNote = balprocess.Selectt_trnsferInNote(objt_trnsferNote); objt_trnsferNote.isProcessed = true; objt_trnsferNote.processDate = DateTime.Now; objt_trnsferNote.processUser = commonFunctions.Loginuser; balprocess.Savet_trnsferInNoteSP(objt_trnsferNote, 3); UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_Update_Sucess, commonFunctions.Softwarename.Trim()); } //clear data in data grid dtx.Rows.Clear(); dataGridView1.Refresh(); //clear text fields textareaFunctions(true); FunctionButtonStatus(xEnums.PerformanceType.Save); //increment the serial txt_no.Text = commonFunctions.GetSerial(formID.Trim()); //txt_supplierId.Focus(); } } else if (formMode == 3) { t_trnsferInNote cat = new t_trnsferInNote(); cat.transinNo = txt_no.Text.Trim(); T_trnsferInNoteDL dl = new T_trnsferInNoteDL(); cat = dl.Selectt_trnsferInNote(cat); if (cat.isProcessed == false) { if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Process, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { UpdateStock(); t_trnsferInNote objt_trnsferNote = new t_trnsferInNote(); objt_trnsferNote.transinNo = txt_no.Text.Trim(); T_trnsferInNoteDL balprocess = new T_trnsferInNoteDL(); objt_trnsferNote = balprocess.Selectt_trnsferInNote(objt_trnsferNote); objt_trnsferNote.isProcessed = true; objt_trnsferNote.processDate = DateTime.Now; objt_trnsferNote.processUser = commonFunctions.Loginuser; balprocess.Savet_trnsferInNoteSP(objt_trnsferNote, 3); UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_Update_Sucess, commonFunctions.Softwarename.Trim()); //clear data in data grid dtx.Rows.Clear(); dataGridView1.Refresh(); //clear text fields textareaFunctions(true); FunctionButtonStatus(xEnums.PerformanceType.Save); txt_no.Text = commonFunctions.GetSerial(formID.Trim()); txt_refNo.Focus(); } } else { errorProvider1.SetError(txt_no, "Transfer IN Number you have entered already processed."); } } break; case xEnums.PerformanceType.Cancel: txt_no.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Default); errorProvider1.Clear(); //clear text fields textareaFunctions(true); //clear Datagrid dtx.Clear(); dataGridView1.Refresh(); //txt_supplierId.Text = ""; txt_remarks.Text = ""; lbl_processes.Visible = false; break; case xEnums.PerformanceType.Print: UserDefineMessages.ShowMsg1("Print still in process", UserDefineMessages.Msg_Information); break; } } catch (Exception ex) { LogFile.WriteErrorLog(System.Reflection.MethodBase.GetCurrentMethod().Name, this.Name, ex.Message.ToString(), "Exception"); commonFunctions.SetMDIStatusMessage("Genaral Error on loading data", 1); } }
private void performButtons(xEnums.PerformanceType xenum) { try { switch (xenum) { case xEnums.PerformanceType.View: if (ActiveControl.Name.Trim() == txt_no.Name.Trim()) { int length = Convert.ToInt32(ConfigurationManager.AppSettings["POFieldLength"]); string[] strSearchField = new string[length]; string strSQL = ConfigurationManager.AppSettings["POSQL"].ToString(); for (int i = 0; i < length; i++) { string m; m = i.ToString(); strSearchField[i] = ConfigurationManager.AppSettings["POField" + m + ""].ToString(); } frmU_Search find = new frmU_Search(strSQL, strSearchField, this); find.ShowDialog(this); } break; case xEnums.PerformanceType.New: FunctionButtonStatus(xEnums.PerformanceType.New); formMode = 1; txt_no.Text = commonFunctions.GetSerial(formID.Trim()); txt_no.Focus(); txt_sourceLocId.Text = commonFunctions.GlobalLocation; txt_locationId_name.Text = findExisting.FindExisitingLoca(txt_sourceLocId.Text.Trim()); errorProvider1.Clear(); lbl_processes.Visible = false; break; case xEnums.PerformanceType.Edit: FunctionButtonStatus(xEnums.PerformanceType.Edit); formMode = 3; //txt_VehicleID.Enabled = false; //txt_VehicleNo.Focus(); errorProvider1.Clear(); break; case xEnums.PerformanceType.Save: errorProvider1.Clear(); if (formMode == 1) { if (!M_LocaDL.ExistingM_Loca(txt_sourceLocId.Text.Trim())) { errorProvider1.SetError(txt_sourceLocId, "Location does not exists on the system "); commonFunctions.SetMDIStatusMessage("Location does not exists on the system", 1); return; } if (commonFunctions.GetNoofItems(dataGridView1) <= 0) { errorProvider1.SetError(dataGridView1, "Please enter some items to the details grid"); commonFunctions.SetMDIStatusMessage("Please enter some items to the details grid", 1); return; } if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Save, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { try { using (System.Transactions.TransactionScope transaction = new System.Transactions.TransactionScope()) { //u_DBConnection.BeginTrans(); //save header data t_adjustment_head objt_adjustment_head = new t_adjustment_head(); objt_adjustment_head.adju_no = txt_no.Text.Trim(); objt_adjustment_head.location_id = commonFunctions.GlobalLocation; objt_adjustment_head.adjsment_date = dte_date.Value; objt_adjustment_head.remarks = txt_remarks.Text.Trim(); objt_adjustment_head.user_id = commonFunctions.Loginuser; objt_adjustment_head.batch_no = txt_batch_no.Text.Trim(); objt_adjustment_head.process = false; objt_adjustment_head.process_user = commonFunctions.Loginuser; objt_adjustment_head.process_date = DateTime.Now; objt_adjustment_head.triggerVal = 1; T_adjustment_headDL bal = new T_adjustment_headDL(); bal.Savet_adjustment_headSP(objt_adjustment_head, 1); //save details foreach (DataGridViewRow drow in dataGridView1.Rows) { if (drow.Cells["Product Code"].Value.ToString().Trim() != null) { //have to implement the logic. this is only saving the data to the system t_adjustment_details objt_adjustment_detail = new t_adjustment_details(); objt_adjustment_detail.adju_no = txt_no.Text.Trim(); objt_adjustment_detail.location_id = commonFunctions.GlobalLocation; objt_adjustment_detail.line_no = 1; objt_adjustment_detail.item_code = drow.Cells["Product Code"].Value.ToString(); objt_adjustment_detail.cost = commonFunctions.ToDecimal(drow.Cells["Cost Price"].Value.ToString()); objt_adjustment_detail.stock = commonFunctions.ToDecimal(drow.Cells["Quntity"].Value.ToString()); objt_adjustment_detail.physical_quantity = commonFunctions.ToDecimal(drow.Cells["Quntity"].Value.ToString()); //txt_physical_quantity.Text.Trim(); objt_adjustment_detail.variance = commonFunctions.ToDecimal(drow.Cells["Quntity"].Value.ToString()); if (rdo_add.Checked) { objt_adjustment_detail.triggerVal = 1; } if (rdo_reduce.Checked) { objt_adjustment_detail.triggerVal = 2; } T_adjustment_detailDL bal2 = new T_adjustment_detailDL(); bal2.Savet_adjustment_detailSP(objt_adjustment_detail, 1); } } //increment the serial commonFunctions.IncrementSerial(formID); transaction.Complete(); } //u_DBConnection.CommitTrans(); UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_Save_Sucess, commonFunctions.Softwarename.Trim()); } catch (Exception ex) { // u_DBConnection.RollbackTrans(); LogFile.WriteErrorLog(System.Reflection.MethodBase.GetCurrentMethod().Name, this.Name, ex.Message.ToString(), "Exception"); commonFunctions.SetMDIStatusMessage("Genaral Error on loading data", 1); } if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Process, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { UpdateStock(); t_adjustment_head objt_trnsferNote = new t_adjustment_head(); objt_trnsferNote.adju_no = txt_no.Text.Trim(); T_adjustment_headDL balprocess = new T_adjustment_headDL(); objt_trnsferNote = balprocess.Selectt_adjustment_head(objt_trnsferNote); objt_trnsferNote.process = true; objt_trnsferNote.process_date = DateTime.Now; objt_trnsferNote.process_user = commonFunctions.Loginuser; balprocess.Savet_adjustment_headSP(objt_trnsferNote, 3); UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_Update_Sucess, commonFunctions.Softwarename.Trim()); } //clear data in data grid dtx.Rows.Clear(); dataGridView1.Refresh(); //clear text fields textareaFunctions(true); FunctionButtonStatus(xEnums.PerformanceType.Save); //increment the serial txt_no.Text = commonFunctions.GetSerial(formID.Trim()); //txt_supplierId.Focus(); } } else if (formMode == 3) { t_adjustment_head cat = new t_adjustment_head(); cat.adju_no = txt_no.Text.Trim(); T_adjustment_headDL dl = new T_adjustment_headDL(); cat = dl.Selectt_adjustment_head(cat); if (cat.process == false) { if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Process, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { cat.location_id = txt_sourceLocId.Text.Trim(); cat.adjsment_date = dte_date.Value; cat.remarks = txt_remarks.Text.Trim(); cat.user_id = commonFunctions.Loginuser; cat.batch_no = txt_batch_no.Text.Trim(); new T_adjustment_headDL().Savet_adjustment_headSP(cat, 3); List <t_adjustment_details> detsx = new List <t_adjustment_details>(); t_adjustment_details detx = new t_adjustment_details(); detx.adju_no = cat.adju_no.Trim(); detsx = new T_adjustment_detailDL().SelectT_adjustment_detailMulti(detx); foreach (t_adjustment_details det in detsx) { new T_adjustment_detailDL().Savet_adjustment_detailSP(det, 4); } //save details foreach (DataGridViewRow drow in dataGridView1.Rows) { if (drow.Cells["Product Code"].Value.ToString().Trim() != null) { //have to implement the logic. this is only saving the data to the system t_adjustment_details objt_adjustment_detail = new t_adjustment_details(); objt_adjustment_detail.adju_no = txt_no.Text.Trim(); objt_adjustment_detail.location_id = txt_sourceLocId.Text.Trim(); objt_adjustment_detail.line_no = 1; objt_adjustment_detail.item_code = drow.Cells["Product Code"].Value.ToString(); objt_adjustment_detail.cost = commonFunctions.ToDecimal(drow.Cells["Cost Price"].Value.ToString()); objt_adjustment_detail.stock = commonFunctions.ToDecimal(drow.Cells["Quntity"].Value.ToString()); objt_adjustment_detail.physical_quantity = commonFunctions.ToDecimal(drow.Cells["Quntity"].Value.ToString()); //txt_physical_quantity.Text.Trim(); objt_adjustment_detail.variance = commonFunctions.ToDecimal(drow.Cells["Quntity"].Value.ToString()); if (rdo_add.Checked) { objt_adjustment_detail.triggerVal = 1; } if (rdo_reduce.Checked) { objt_adjustment_detail.triggerVal = 2; } T_adjustment_detailDL bal2 = new T_adjustment_detailDL(); bal2.Savet_adjustment_detailSP(objt_adjustment_detail, 1); } } if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Process, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { cat.process = true; cat.process_date = DateTime.Now; cat.process_user = commonFunctions.Loginuser; new T_adjustment_headDL().Savet_adjustment_headSP(cat, 3); UpdateStock(); } UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_Update_Sucess, commonFunctions.Softwarename.Trim()); //clear data in data grid dtx.Rows.Clear(); dataGridView1.Refresh(); //clear text fields textareaFunctions(true); FunctionButtonStatus(xEnums.PerformanceType.Save); txt_no.Text = commonFunctions.GetSerial(formID.Trim()); txt_code.Focus(); } } else { errorProvider1.SetError(txt_no, "Adjustment Number you have entered already processed."); commonFunctions.SetMDIStatusMessage("Adjustment Number you have entered already processed", 1); } } break; case xEnums.PerformanceType.Cancel: txt_no.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Default); errorProvider1.Clear(); //clear text fields textareaFunctions(true); //clear Datagrid dtx.Clear(); dataGridView1.Refresh(); //txt_supplierId.Text = ""; //txt_remarks.Text = ""; lbl_processes.Visible = false; break; case xEnums.PerformanceType.Print: UserDefineMessages.ShowMsg1("Print still in process", UserDefineMessages.Msg_Information); break; } } catch (Exception ex) { LogFile.WriteErrorLog(System.Reflection.MethodBase.GetCurrentMethod().Name, this.Name, ex.Message.ToString(), "Exception"); commonFunctions.SetMDIStatusMessage("Genaral Error on updating data", 1); } }
private void performButtons(xEnums.PerformanceType xenum) { try { switch (xenum) { case xEnums.PerformanceType.View: if (ActiveControl.Name.Trim() == txt_reqno.Name.Trim()) { int length = Convert.ToInt32(ConfigurationManager.AppSettings["PurreqFieldLength"]); string[] strSearchField = new string[length]; string strSQL = ConfigurationManager.AppSettings["PurreqField"].ToString(); for (int i = 0; i < length; i++) { string m; m = i.ToString(); strSearchField[i] = ConfigurationManager.AppSettings["VehicleField" + m + ""].ToString(); } frmU_Search find = new frmU_Search(strSQL, strSearchField, this); find.ShowDialog(this); } break; case xEnums.PerformanceType.New: FunctionButtonStatus(xEnums.PerformanceType.New); formMode = 1; txt_reqno.Text = commonFunctions.GetSerial(formID.Trim()); txt_reqno.Focus(); errorProvider1.Clear(); lbl_processes.Visible = false; break; case xEnums.PerformanceType.Edit: FunctionButtonStatus(xEnums.PerformanceType.Edit); formMode = 3; //txt_VehicleID.Enabled = false; //txt_VehicleNo.Focus(); errorProvider1.Clear(); break; case xEnums.PerformanceType.Save: errorProvider1.Clear(); if (formMode == 1) { if (T_purchaseRequisitionDL.ExistingT_purchaseRequisition(txt_reqno.Text.Trim())) { errorProvider1.SetError(txt_reqno, "Selected request No already exists on the system "); commonFunctions.SetMDIStatusMessage("Selected request No already exists on the system ", 1); return; } if (!M_LocaDL.ExistingM_Loca(txt_location.Text.Trim())) { errorProvider1.SetError(txt_location, "Selected location does not exists on the system "); commonFunctions.SetMDIStatusMessage("Selected location does not exists on the system", 1); return; } if (!M_SupplierDL.ExistingM_Supplier(txt_Suplier.Text.Trim())) { errorProvider1.SetError(txt_Suplier, "Selected supplier does not exists on the system "); commonFunctions.SetMDIStatusMessage("Selected supplier does not exists on the system ", 1); return; } if (commonFunctions.GetNoofItems(dataGridView1) <= 0) { errorProvider1.SetError(dataGridView1, "Please enter some items to the details grid"); commonFunctions.SetMDIStatusMessage("Please enter some items to the details grid ", 1); return; } if (DateTime.Compare(dte_request.Value, dte_dilivary.Value) > -1) { errorProvider1.SetError(dte_dilivary, "Delivary date must be grater than request date"); commonFunctions.SetMDIStatusMessage("Delivary date must be grater than request date ", 1); return; } if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Save, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { using (TransactionScope transaction = new TransactionScope()) { //save header data t_purchaseRequisition objt_purchaseRequisition = new t_purchaseRequisition(); objt_purchaseRequisition.no = txt_reqno.Text.Trim(); objt_purchaseRequisition.date = dte_request.Value; objt_purchaseRequisition.deleveryDate = dte_dilivary.Value; objt_purchaseRequisition.remarks = txt_remark.Text.Trim(); objt_purchaseRequisition.processDate = DateTime.Now; objt_purchaseRequisition.processUser = ""; objt_purchaseRequisition.locationId = commonFunctions.GlobalLocation; objt_purchaseRequisition.supplierId = txt_Suplier.Text.Trim(); objt_purchaseRequisition.noOfItems = commonFunctions.ToDecimal(txt_items.Text.Trim()); objt_purchaseRequisition.noOfPeaces = commonFunctions.ToDecimal(txt_pices.Text.Trim()); objt_purchaseRequisition.grossAmount = commonFunctions.ToDecimal(txt_gross.Text.Trim()); objt_purchaseRequisition.isSaved = true; objt_purchaseRequisition.isProcessed = false; objt_purchaseRequisition.triggerVal = 1; T_purchaseRequisitionDL bal = new T_purchaseRequisitionDL(); bal.SaveT_purchaseRequisitionSP(objt_purchaseRequisition, 1); //save details foreach (DataGridViewRow drow in dataGridView1.Rows) { if (drow.Cells["Product Code"].Value.ToString().Trim() != null) { t_purchaseReq_detail objt_purchaseReq_detail = new t_purchaseReq_detail(); objt_purchaseReq_detail.purchaseReqNo = txt_reqno.Text.Trim(); objt_purchaseReq_detail.locationId = commonFunctions.GlobalLocation; objt_purchaseReq_detail.ReqDate = dte_request.Value; objt_purchaseReq_detail.deleveryDate = dte_dilivary.Value; objt_purchaseReq_detail.productId = drow.Cells["Product Code"].Value.ToString(); objt_purchaseReq_detail.description = drow.Cells["Product Name"].Value.ToString(); objt_purchaseReq_detail.quantity = commonFunctions.ToDecimal(drow.Cells["Quntity"].Value.ToString()); objt_purchaseReq_detail.costPrice = commonFunctions.ToDecimal(drow.Cells["Cost Price"].Value.ToString()); objt_purchaseReq_detail.amount = commonFunctions.ToDecimal(drow.Cells["Amount"].Value.ToString()); objt_purchaseReq_detail.release = 0; objt_purchaseReq_detail.r_value = 0; objt_purchaseReq_detail.triggerVal = 0; T_purchaseReq_detailDL bal2 = new T_purchaseReq_detailDL(); bal2.SaveT_purchaseReq_detailSP(objt_purchaseReq_detail, 1); } } //increment the serial commonFunctions.IncrementSerial(formID); transaction.Complete(); } UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_Save_Sucess, commonFunctions.Softwarename.Trim()); if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Process, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { t_purchaseRequisition objt_purchaseRequisitionxc = new t_purchaseRequisition(); objt_purchaseRequisitionxc.no = txt_reqno.Text.Trim(); T_purchaseRequisitionDL bal2 = new T_purchaseRequisitionDL(); objt_purchaseRequisitionxc = bal2.Selectt_purchaseRequisition(objt_purchaseRequisitionxc); objt_purchaseRequisitionxc.isProcessed = true; objt_purchaseRequisitionxc.processDate = DateTime.Now; objt_purchaseRequisitionxc.processUser = commonFunctions.Loginuser; bal2.SaveT_purchaseRequisitionSP(objt_purchaseRequisitionxc, 3); UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_Update_Sucess, commonFunctions.Softwarename.Trim()); } //clear data in data grid dtx.Rows.Clear(); dataGridView1.Refresh(); //clear text fields txt_Suplier.Text = ""; txt_suppliername.Text = ""; txt_location.Text = ""; txt_locaname.Text = ""; txt_remark.Text = ""; txt_code.Text = ""; txt_cost.Text = "0.00"; txt_selling.Text = "0.00"; txt_qty.Text = "0.00"; txt_amt.Text = "0.00"; txt_reqno.Enabled = true; txt_Suplier.Enabled = true; txt_location.Enabled = true; txt_remark.Enabled = true; dataGridView1.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Save); //increment the serial txt_reqno.Text = commonFunctions.GetSerial(formID.Trim()); txt_location.Focus(); } } else if (formMode == 3) { t_purchaseRequisition cat = new t_purchaseRequisition(); cat.no = txt_reqno.Text.Trim(); T_purchaseRequisitionDL dl = new T_purchaseRequisitionDL(); cat = dl.Selectt_purchaseRequisition(cat); if (cat.isProcessed == false) { if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Process, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { t_purchaseRequisition objt_purchaseRequisitionxc = new t_purchaseRequisition(); objt_purchaseRequisitionxc.no = txt_reqno.Text.Trim(); T_purchaseRequisitionDL bal2 = new T_purchaseRequisitionDL(); objt_purchaseRequisitionxc = bal2.Selectt_purchaseRequisition(objt_purchaseRequisitionxc); objt_purchaseRequisitionxc.isProcessed = true; objt_purchaseRequisitionxc.processDate = DateTime.Now; objt_purchaseRequisitionxc.processUser = commonFunctions.Loginuser; bal2.SaveT_purchaseRequisitionSP(objt_purchaseRequisitionxc, 3); UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_Update_Sucess, commonFunctions.Softwarename.Trim()); //clear data in data grid dtx.Rows.Clear(); dataGridView1.Refresh(); //clear text fields txt_Suplier.Text = ""; txt_suppliername.Text = ""; txt_location.Text = ""; txt_locaname.Text = ""; txt_remark.Text = ""; txt_reqno.Enabled = true; txt_Suplier.Enabled = true; txt_location.Enabled = true; txt_remark.Enabled = true; dataGridView1.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Save); //increment the serial txt_reqno.Text = commonFunctions.GetSerial(formID.Trim()); txt_location.Focus(); } } else { errorProvider1.SetError(txt_reqno, "Request Number you have entered already processed."); commonFunctions.SetMDIStatusMessage("Request Number you have entered already processed.", 1); } } break; case xEnums.PerformanceType.Cancel: txt_reqno.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Default); errorProvider1.Clear(); txt_Suplier.Enabled = true; txt_location.Enabled = true; txt_remark.Enabled = true; dataGridView1.Enabled = true; dtx.Clear(); dataGridView1.Refresh(); txt_Suplier.Text = ""; txt_location.Text = ""; txt_remark.Text = ""; lbl_processes.Visible = false; break; case xEnums.PerformanceType.Print: UserDefineMessages.ShowMsg1("Print still in process", UserDefineMessages.Msg_Information); break; } } catch (Exception ex) { LogFile.WriteErrorLog(System.Reflection.MethodBase.GetCurrentMethod().Name, this.Name, ex.Message.ToString(), "Exception"); commonFunctions.SetMDIStatusMessage("Genaral Error on updating data", 1); } }
private void performButtons(xEnums.PerformanceType xenum) { switch (xenum) { case xEnums.PerformanceType.View: if (ActiveControl.Name.Trim() == txt_SalesmanID.Name.Trim()) { int length = Convert.ToInt32(ConfigurationManager.AppSettings["SalesmanFieldLength"]); string[] strSearchField = new string[length]; string strSQL = ConfigurationManager.AppSettings["SalesmanSQL"].ToString(); for (int i = 0; i < length; i++) { string m; m = i.ToString(); strSearchField[i] = ConfigurationManager.AppSettings["SalesmanField" + m + ""].ToString(); } frmU_Search find = new frmU_Search(strSQL, strSearchField, this); find.ShowDialog(this); } break; case xEnums.PerformanceType.New: FunctionButtonStatus(xEnums.PerformanceType.New); //txt_IDX.Text = commonFunctions.GetSerial("A0009"); formMode = 1; txt_SalesmanID.Focus(); errorProvider1.Clear(); break; case xEnums.PerformanceType.Edit: FunctionButtonStatus(xEnums.PerformanceType.Edit); formMode = 3; txt_SalesmanID.Enabled = false; txt_SalesmanName.Focus(); errorProvider1.Clear(); break; case xEnums.PerformanceType.Save: errorProvider1.Clear(); if (txt_SalesmanID.Text.Trim().ToUpper() == "ADMIN") { errorProvider1.SetError(txt_SalesmanID, "This user is the system administrator. you cannot change the details."); commonFunctions.SetMDIStatusMessage("This user is the system administrator. you cannot change the details.", 1); return; } if (txt_SalesmanID.Text.Trim() == "") { errorProvider1.SetError(txt_SalesmanID, "User code cannot be a null value."); commonFunctions.SetMDIStatusMessage("User code cannot be a null value.", 1); return; } if (txt_SalesmanID.Text.Trim().Length < 5) { errorProvider1.SetError(txt_SalesmanID, "User code must be more than 6 charactors."); commonFunctions.SetMDIStatusMessage("User code must be more than 6 charactors", 1); return; } if (txt_SalesmanName.Text.Trim() == "") { errorProvider1.SetError(txt_SalesmanName, "User name cannot be a null value."); commonFunctions.SetMDIStatusMessage("User name cannot be a null value.", 1); return; } if (txtPw.Text == "") { errorProvider1.SetError(txtPw, "Password cannot be a null value."); commonFunctions.SetMDIStatusMessage("Password cannot be a null value.", 1); return; } if (txtPw.Text != txtRePw.Text) { errorProvider1.SetError(txtPw, "Password and the confirmation password must be same"); commonFunctions.SetMDIStatusMessage("Password and the confirmation password must be same.", 1); return; } if (!U_UserRolexDL.ExistingU_UserRole(txtusergroup.Text.Trim())) { errorProvider1.SetError(txtusergroup, "User group already exists."); commonFunctions.SetMDIStatusMessage("User group already exists.", 1); return; } if (txt_SalesmanName.Text.Trim() == "") { errorProvider1.SetError(txt_SalesmanName, "Please enter a employee name !"); commonFunctions.SetMDIStatusMessage("Please enter a employee name.", 1); return; } if (txt_SalesmanID.Text.Trim() == "") { errorProvider1.SetError(txt_SalesmanID, "Please enter a employee name !"); commonFunctions.SetMDIStatusMessage("Please enter a employee name.", 1); return; } if (formMode == 1) { if (U_UserxDL.ExistingU_User(txt_SalesmanID.Text.Trim())) { errorProvider1.SetError(txt_SalesmanID, "User code already exists."); commonFunctions.SetMDIStatusMessage("User code already exists.", 1); return; } if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Save, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { u_Userxcc obju_User = new u_Userxcc(); obju_User.userId = txt_SalesmanID.Text.Trim(); obju_User.userName = txt_SalesmanName.Text.Trim(); obju_User.password = commonFunctions.CreateCheckPassword(true, txtPw.Text.Trim()); obju_User.roleId = txtusergroup.Text.Trim(); obju_User.userCreated = commonFunctions.Loginuser; obju_User.dateCreated = DateTime.Now; obju_User.userModified = ""; obju_User.dateModified = DateTime.Now; obju_User.isActive = 1; obju_User.Type = txt_paymeth.Text.Trim().ToUpper(); obju_User.Compcode = commonFunctions.GlobalCompany; obju_User.Locacode = commonFunctions.GlobalLocation; obju_User.TP = txt_TP.Text.Trim(); obju_User.Fax = txt_Fax.Text.Trim(); obju_User.Email = txt_Email.Text.Trim(); obju_User.Address1 = txt_Address1.Text.Trim(); obju_User.Address2 = txt_Address2.Text.Trim(); obju_User.Address3 = txt_Address3.Text.Trim(); obju_User.ContactPerson = txt_ContactPerson.Text.Trim(); obju_User.ContactPersonNo = txt_ContactPersonNo.Text.Trim(); obju_User.CurrentStatus = "Active"; obju_User.Gradex = "Good"; obju_User.NICNo = txt_nic.Text.Trim(); new U_UserxDL().Saveu_UserSP(obju_User, 1); GetData(); txt_SalesmanID.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Save); commonFunctions.SetMDIStatusMessage(UserDefineMessages.Msg_Save_Sucess_string, 2); } } else if (formMode == 3) { if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Update, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { u_Userxcc obju_User = new u_Userxcc(); obju_User.userId = txt_SalesmanID.Text.Trim(); obju_User = new U_UserxDL().Selectu_User(obju_User); obju_User.userId = txt_SalesmanID.Text.Trim(); obju_User.userName = txt_SalesmanName.Text.Trim(); obju_User.password = commonFunctions.CreateCheckPassword(true, txtPw.Text.Trim()); obju_User.roleId = txtusergroup.Text.Trim(); obju_User.userCreated = commonFunctions.Loginuser; obju_User.dateCreated = DateTime.Now; obju_User.userModified = ""; obju_User.dateModified = DateTime.Now; obju_User.isActive = 1; obju_User.Type = txt_paymeth.Text.Trim().ToUpper(); obju_User.Compcode = commonFunctions.GlobalCompany; obju_User.Locacode = commonFunctions.GlobalLocation; obju_User.TP = txt_TP.Text.Trim(); obju_User.Fax = txt_Fax.Text.Trim(); obju_User.Email = txt_Email.Text.Trim(); obju_User.Address1 = txt_Address1.Text.Trim(); obju_User.Address2 = txt_Address2.Text.Trim(); obju_User.Address3 = txt_Address3.Text.Trim(); obju_User.ContactPerson = txt_ContactPerson.Text.Trim(); obju_User.ContactPersonNo = txt_ContactPersonNo.Text.Trim(); obju_User.CurrentStatus = "Active"; obju_User.Gradex = "Good"; obju_User.NICNo = txt_nic.Text.Trim(); new U_UserxDL().Saveu_UserSP(obju_User, 3); GetData(); txt_SalesmanID.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Save); commonFunctions.SetMDIStatusMessage(UserDefineMessages.Msg_Update_Sucess_string, 2); } } break; case xEnums.PerformanceType.Cancel: txt_SalesmanID.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Default); errorProvider1.Clear(); break; case xEnums.PerformanceType.Print: UserDefineMessages.ShowMsg1("Print still in process", UserDefineMessages.Msg_Information); break; } }
private void performButtons(xEnums.PerformanceType xenum) { switch (xenum) { case xEnums.PerformanceType.View: if (ActiveControl.Name.Trim() == txt_VehicleID.Name.Trim()) { int length = Convert.ToInt32(ConfigurationManager.AppSettings["VehicleFieldLength"]); string[] strSearchField = new string[length]; string strSQL = ConfigurationManager.AppSettings["VehicleSQL"].ToString(); for (int i = 0; i < length; i++) { string m; m = i.ToString(); strSearchField[i] = ConfigurationManager.AppSettings["VehicleField" + m + ""].ToString(); } frmU_Search find = new frmU_Search(strSQL, strSearchField, this); find.ShowDialog(this); } break; case xEnums.PerformanceType.New: FunctionButtonStatus(xEnums.PerformanceType.New); formMode = 1; txt_VehicleID.Focus(); errorProvider1.Clear(); break; case xEnums.PerformanceType.Edit: FunctionButtonStatus(xEnums.PerformanceType.Edit); formMode = 3; txt_VehicleID.Enabled = false; txt_VehicleNo.Focus(); errorProvider1.Clear(); break; case xEnums.PerformanceType.Save: errorProvider1.Clear(); if (txt_VehicleNo.Text.Trim() == "") { errorProvider1.SetError(txt_VehicleNo, "Please enter a vehicle number !"); return; } if (txt_VehicleID.Text.Trim() == "") { errorProvider1.SetError(txt_VehicleID, "Please enter a vehicle ID !"); return; } if (incomingvehicle.Trim().ToUpper() != txt_VehicleNo.Text.Trim()) { if (M_VehicleDL.ExistingM_VehicleNo(txt_VehicleNo.Text.Trim())) { errorProvider1.SetError(txt_VehicleNo, "The vehicle number you have entered already exists!"); return; } } if (formMode == 1) { if (M_VehicleDL.ExistingM_Vehicle(txt_VehicleID.Text.Trim())) { errorProvider1.SetError(txt_VehicleID, "The vehicle code you have entered already exists!"); return; } if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Save, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { M_Vehicles objm_Vehicle = new M_Vehicles(); objm_Vehicle.VehicleID = txt_VehicleID.Text.Trim(); objm_Vehicle.VehicleNo = txt_VehicleNo.Text.Trim(); objm_Vehicle.CompCode = commonFunctions.GlobalCompany; //txt_CompCode.Text.Trim(); objm_Vehicle.Locacode = commonFunctions.GlobalLocation; //txt_Locacode.Text.Trim(); objm_Vehicle.Make = txt_Make.Text.Trim(); objm_Vehicle.Model = txt_Model.Text.Trim(); objm_Vehicle.Driver = txt_Driver.Text.Trim(); objm_Vehicle.Milage = txt_Milage.Text.Trim(); objm_Vehicle.FuelEfficiency = commonFunctions.ToDecimal(txt_FuelEfficiency.Text.Trim()); objm_Vehicle.Status = txt_Status.Text.Trim(); objm_Vehicle.Route = txt_Route.Text.Trim(); objm_Vehicle.Userx = commonFunctions.Loginuser; //txt_Userx.Text.Trim(); objm_Vehicle.Datex = DateTime.Now; //txt_Datex.Text.Trim(); M_VehicleDL bal = new M_VehicleDL(); bal.SaveM_VehicleSP(objm_Vehicle, 1); GetData(); txt_VehicleID.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Save); commonFunctions.SetMDIStatusMessage(UserDefineMessages.Msg_Save_Sucess_string, 2); } } else if (formMode == 3) { if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Update, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { M_Vehicles objm_Vehicle = new M_Vehicles(); objm_Vehicle.VehicleID = txt_VehicleID.Text.Trim(); objm_Vehicle.VehicleNo = txt_VehicleNo.Text.Trim(); objm_Vehicle.CompCode = commonFunctions.GlobalCompany; //txt_CompCode.Text.Trim(); objm_Vehicle.Locacode = commonFunctions.GlobalLocation; //txt_Locacode.Text.Trim(); objm_Vehicle.Make = txt_Make.Text.Trim(); objm_Vehicle.Model = txt_Model.Text.Trim(); objm_Vehicle.Driver = txt_Driver.Text.Trim(); objm_Vehicle.Milage = txt_Milage.Text.Trim(); objm_Vehicle.FuelEfficiency = commonFunctions.ToDecimal(txt_FuelEfficiency.Text.Trim()); objm_Vehicle.Status = txt_Status.Text.Trim(); objm_Vehicle.Route = txt_Route.Text.Trim(); objm_Vehicle.Userx = commonFunctions.Loginuser; //txt_Userx.Text.Trim(); objm_Vehicle.Datex = DateTime.Now; //txt_Datex.Text.Trim(); M_VehicleDL bal = new M_VehicleDL(); bal.SaveM_VehicleSP(objm_Vehicle, 3); GetData(); txt_VehicleID.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Save); commonFunctions.SetMDIStatusMessage(UserDefineMessages.Msg_Update_Sucess_string, 2); } } break; case xEnums.PerformanceType.Cancel: txt_VehicleID.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Default); errorProvider1.Clear(); break; case xEnums.PerformanceType.Print: UserDefineMessages.ShowMsg1("Print still in process", UserDefineMessages.Msg_Information); break; } }
private void btn_save_Click(object sender, EventArgs e) { try { if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Update, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { if (dgsaved.SelectedRows.Count > 0) { bool exists = false; List <string> itemsx = new List <string>(); foreach (DataGridViewRow rowx in dgsaved.SelectedRows) { string x = rowx.Cells[0].Value.ToString(); T_SalesAllocDet det = new T_SalesAllocDet(); det.Docno = x.ToString(); List <T_SalesAllocDet> dets = new List <T_SalesAllocDet>(); dets = new T_SalesAllocDetDL().SelectT_SalesAllocDetMulti(det); if (dets.Count > 0) { itemsx.Add(x); exists = true; } else { T_SalesAllocHead head = new T_SalesAllocHead(); head.Docno = rowx.Cells[0].Value.ToString(); head = new T_SalesAllocHeadDL().Selectt_SalesAllocHead(head); new T_SalesAllocHeadDL().Savet_SalesAllocHeadSP(head, 4); } } GetAllocations(selectedsalesman); if (exists == true) { string numbers = ""; foreach (string x in itemsx) { numbers += "\n" + x; } UserDefineMessages.ShowMsg1("Selected Allocation headers deleted except these " + numbers + " \nbecouse they have breakdowns", UserDefineMessages.Msg_Warning); } else { UserDefineMessages.ShowMsg1("Selected Allocation headers were deleted ", UserDefineMessages.Msg_Information); } } else { string x = dgsaved.SelectedRows[0].Cells[0].Value.ToString(); T_SalesAllocDet det = new T_SalesAllocDet(); det.Docno = x.ToString(); List <T_SalesAllocDet> dets = new List <T_SalesAllocDet>(); dets = new T_SalesAllocDetDL().SelectT_SalesAllocDetMulti(det); if (dets.Count > 0) { UserDefineMessages.ShowMsg1("Cannot delete the allocation master: " + x + ". becouse it has breakdowns ", UserDefineMessages.Msg_Warning); } else { T_SalesAllocHead head = new T_SalesAllocHead(); head.Docno = dgsaved.SelectedRows[0].Cells[0].Value.ToString(); head = new T_SalesAllocHeadDL().Selectt_SalesAllocHead(head); new T_SalesAllocHeadDL().Savet_SalesAllocHeadSP(head, 4); GetAllocations(selectedsalesman); UserDefineMessages.ShowMsg1("Allocation header detleted NO: " + x, UserDefineMessages.Msg_Information); } } } } catch (Exception ex) { } }
private void performButtons(xEnums.PerformanceType xenum) { switch (xenum) { case xEnums.PerformanceType.View: if (ActiveControl.Name.Trim() == txt_AreaCode.Name.Trim()) { int length = Convert.ToInt32(ConfigurationManager.AppSettings["AreaFieldLength"]); string[] strSearchField = new string[length]; string strSQL = ConfigurationManager.AppSettings["AreaSQL"].ToString(); for (int i = 0; i < length; i++) { string m; m = i.ToString(); strSearchField[i] = ConfigurationManager.AppSettings["AreaField" + m + ""].ToString(); } frmU_Search find = new frmU_Search(strSQL, strSearchField, this); find.ShowDialog(this); } break; case xEnums.PerformanceType.New: FunctionButtonStatus(xEnums.PerformanceType.New); formMode = 1; txt_AreaCode.Focus(); errorProvider1.Clear(); break; case xEnums.PerformanceType.Edit: FunctionButtonStatus(xEnums.PerformanceType.Edit); formMode = 3; txt_AreaCode.Enabled = false; txt_Descri.Focus(); errorProvider1.Clear(); break; case xEnums.PerformanceType.Save: try { if (txt_AreaCode.Text.Trim() == "") { errorProvider1.SetError(txt_AreaCode, "Please enter a area Code !"); return; } if (txt_Descri.Text.Trim() == "") { errorProvider1.SetError(txt_Descri, "Please enter a area name !"); return; } if (formMode == 1) { if (M_AreaDL.ExistingM_Area(txt_AreaCode.Text.Trim())) { errorProvider1.SetError(txt_AreaCode, "The area code you have entered already exists!"); return; } if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Save, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { M_Area objm_Area = new M_Area(); objm_Area.AreaCode = txt_AreaCode.Text.Trim(); objm_Area.Compcode = commonFunctions.GlobalCompany; // txt_Compcode.Text.Trim(); objm_Area.Locacode = commonFunctions.GlobalLocation; // txt_Locacode.Text.Trim(); objm_Area.Descri = txt_Descri.Text.Trim(); objm_Area.Datex = DateTime.Now; //txt_Datex.Text.Trim(); objm_Area.Userx = commonFunctions.Loginuser; // txt_Userx.Text.Trim(); M_AreaDL bal = new M_AreaDL(); bal.SaveM_AreaSP(objm_Area, 1); GetData(); txt_AreaCode.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Save); UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_Save_Sucess, commonFunctions.Softwarename.Trim()); } } else if (formMode == 3) { if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Update, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { M_Area objm_Area = new M_Area(); objm_Area.AreaCode = txt_AreaCode.Text.Trim(); objm_Area.Compcode = commonFunctions.GlobalCompany; // txt_Compcode.Text.Trim(); objm_Area.Locacode = commonFunctions.GlobalLocation; // txt_Locacode.Text.Trim(); objm_Area.Descri = txt_Descri.Text.Trim(); objm_Area.Datex = DateTime.Now; //txt_Datex.Text.Trim(); objm_Area.Userx = commonFunctions.Loginuser; // txt_Userx.Text.Trim(); M_AreaDL bal = new M_AreaDL(); bal.SaveM_AreaSP(objm_Area, 3); GetData(); txt_AreaCode.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Save); UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_Update_Sucess, commonFunctions.Softwarename.Trim()); } } } catch (Exception ex) { LogFile.WriteErrorLog(System.Reflection.MethodBase.GetCurrentMethod().Name, this.Name, ex.Message.ToString(), "Exception"); commonFunctions.SetMDIStatusMessage("Genaral Error on updating data", 1); } break; case xEnums.PerformanceType.Cancel: txt_AreaCode.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Default); errorProvider1.Clear(); break; case xEnums.PerformanceType.Print: UserDefineMessages.ShowMsg1("Print still in process", UserDefineMessages.Msg_Information); break; } }
private void performButtons(xEnums.PerformanceType xenum) { switch (xenum) { case xEnums.PerformanceType.View: if (ActiveControl.Name.Trim() == txt_comcode.Name.Trim()) { int length = Convert.ToInt32(ConfigurationManager.AppSettings["BankFieldLength"]); string[] strSearchField = new string[length]; string strSQL = ConfigurationManager.AppSettings["BankSQL"].ToString(); for (int i = 0; i < length; i++) { string m; m = i.ToString(); strSearchField[i] = ConfigurationManager.AppSettings["BankField" + m + ""].ToString(); } frmU_Search find = new frmU_Search(strSQL, strSearchField, this); find.ShowDialog(this); } break; case xEnums.PerformanceType.New: FunctionButtonStatus(xEnums.PerformanceType.New); formMode = 1; txt_comcode.Focus(); break; case xEnums.PerformanceType.Edit: FunctionButtonStatus(xEnums.PerformanceType.Edit); formMode = 3; txt_name.Focus(); break; case xEnums.PerformanceType.Save: try { if (formMode == 1) { if (M_CompanyDL.ExistingBank(txt_comcode.Text.Trim())) { UserDefineMessages.ShowMsg("The company code you have entered already exists!", UserDefineMessages.Msg_Warning); return; } if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Save, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { M_Company objbank = new M_Company(); objbank.CompCode = txt_comcode.Text.Trim(); objbank.Descr = txt_name.Text.Trim().ToUpper(); objbank.Add1 = txt_add1.Text.Trim(); objbank.Add2 = txt_add2.Text.Trim(); objbank.Add3 = txt_add3.Text.Trim(); objbank.Datex = DateTime.Now; objbank.Emailx = txt_email.Text.Trim(); objbank.Fax = txt_fax.Text.Trim(); objbank.Tpno = txt_tp.Text.Trim(); objbank.Userx = commonFunctions.Loginuser; M_CompanyDL bal = new M_CompanyDL(); bal.SaveBankSP(objbank, 1); GetData(); FunctionButtonStatus(xEnums.PerformanceType.Save); commonFunctions.SetMDIStatusMessage(UserDefineMessages.Msg_Save_Sucess_string, 2); } } else if (formMode == 3) { if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Update, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { M_Company objbank = new M_Company(); objbank.CompCode = txt_comcode.Text.Trim(); objbank.Descr = txt_name.Text.Trim().ToUpper(); objbank.Add1 = txt_add1.Text.Trim(); objbank.Add2 = txt_add2.Text.Trim(); objbank.Add3 = txt_add3.Text.Trim(); objbank.Datex = DateTime.Now; objbank.Emailx = txt_email.Text.Trim(); objbank.Fax = txt_fax.Text.Trim(); objbank.Tpno = txt_tp.Text.Trim(); objbank.Userx = commonFunctions.Loginuser; M_CompanyDL bal = new M_CompanyDL(); bal.SaveBankSP(objbank, 3); GetData(); FunctionButtonStatus(xEnums.PerformanceType.Save); commonFunctions.SetMDIStatusMessage(UserDefineMessages.Msg_Update_Sucess_string, 2); } } } catch (Exception ex) { LogFile.WriteErrorLog(System.Reflection.MethodBase.GetCurrentMethod().Name, this.Name, ex.Message.ToString(), "Exception"); commonFunctions.SetMDIStatusMessage("Genaral Error on loading data", 1); } break; case xEnums.PerformanceType.Cancel: FunctionButtonStatus(xEnums.PerformanceType.Default); break; case xEnums.PerformanceType.Print: UserDefineMessages.ShowMsg1("Print still in process", UserDefineMessages.Msg_Information); break; } }
private void performButtons(xEnums.PerformanceType xenum) { switch (xenum) { case xEnums.PerformanceType.View: if (ActiveControl.Name.Trim() == txt_ID.Name.Trim()) { int length = Convert.ToInt32(ConfigurationManager.AppSettings["AreaFieldLength"]); string[] strSearchField = new string[length]; string strSQL = ConfigurationManager.AppSettings["AreaSQL"].ToString(); for (int i = 0; i < length; i++) { string m; m = i.ToString(); strSearchField[i] = ConfigurationManager.AppSettings["AreaField" + m + ""].ToString(); } frmU_Search find = new frmU_Search(strSQL, strSearchField, this); find.ShowDialog(this); } break; case xEnums.PerformanceType.New: FunctionButtonStatus(xEnums.PerformanceType.New); formMode = 1; txt_ID.Focus(); errorProvider1.Clear(); break; case xEnums.PerformanceType.Edit: FunctionButtonStatus(xEnums.PerformanceType.Edit); formMode = 3; txt_ID.Enabled = false; txt_Reason.Focus(); errorProvider1.Clear(); break; case xEnums.PerformanceType.Save: try { if (txt_ID.Text.Trim() == "") { errorProvider1.SetError(txt_ID, "Please enter a credit note code !"); return; } if (txt_Reason.Text.Trim() == "") { errorProvider1.SetError(txt_Reason, "Please enter a subcategory name !"); return; } if (formMode == 1) { if (M_CNReasonDL.ExistingM_CNReason(txt_ID.Text.Trim())) { errorProvider1.SetError(txt_ID, "The credit note reason you have entered already exists!"); return; } if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Save, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { M_CNReason objm_CNReason = new M_CNReason(); objm_CNReason.ID = txt_ID.Text.Trim(); objm_CNReason.Reason = txt_Reason.Text.Trim(); objm_CNReason.NeedToUpdateStock = Chk_NeedToUpdateStock.Checked; objm_CNReason.StockType = comboBox1.Text.Trim(); objm_CNReason.UserCode = commonFunctions.Loginuser; objm_CNReason.Datex = DateTime.Now; new M_CNReasonDL().Savem_CNReasonSP(objm_CNReason, 1); GetData(); txt_ID.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Save); commonFunctions.SetMDIStatusMessage(UserDefineMessages.Msg_Save_Sucess_string, 2); } } else if (formMode == 3) { if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Update, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { M_CNReason objm_CNReason = new M_CNReason(); objm_CNReason.ID = txt_ID.Text.Trim(); objm_CNReason.Reason = txt_Reason.Text.Trim(); objm_CNReason.NeedToUpdateStock = Chk_NeedToUpdateStock.Checked; objm_CNReason.StockType = comboBox1.Text.Trim(); objm_CNReason.UserCode = commonFunctions.Loginuser; objm_CNReason.Datex = DateTime.Now; new M_CNReasonDL().Savem_CNReasonSP(objm_CNReason, 3); GetData(); txt_ID.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Save); commonFunctions.SetMDIStatusMessage(UserDefineMessages.Msg_Update_Sucess_string, 2); } } } catch (Exception ex) { LogFile.WriteErrorLog(System.Reflection.MethodBase.GetCurrentMethod().Name, this.Name, ex.Message.ToString(), "Exception"); commonFunctions.SetMDIStatusMessage("Genaral Error on updating data", 1); } break; case xEnums.PerformanceType.Cancel: txt_ID.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Default); errorProvider1.Clear(); break; case xEnums.PerformanceType.Print: UserDefineMessages.ShowMsg1("Print still in process", UserDefineMessages.Msg_Information); break; } }
private void performButtons(xEnums.PerformanceType xenum) { switch (xenum) { case xEnums.PerformanceType.View: if (ActiveControl.Name.Trim() == txt_Routecode.Name.Trim()) { int length = Convert.ToInt32(ConfigurationManager.AppSettings["RouteFieldLength"]); string[] strSearchField = new string[length]; string strSQL = ConfigurationManager.AppSettings["RouteSQL"].ToString(); for (int i = 0; i < length; i++) { string m; m = i.ToString(); strSearchField[i] = ConfigurationManager.AppSettings["RouteField" + m + ""].ToString(); } frmU_Search find = new frmU_Search(strSQL, strSearchField, this); find.ShowDialog(this); } break; case xEnums.PerformanceType.New: FunctionButtonStatus(xEnums.PerformanceType.New); formMode = 1; txt_Routecode.Focus(); errorProvider1.Clear(); break; case xEnums.PerformanceType.Edit: FunctionButtonStatus(xEnums.PerformanceType.Edit); formMode = 3; txt_Routecode.Enabled = false; txt_Descr.Focus(); errorProvider1.Clear(); break; case xEnums.PerformanceType.Save: errorProvider1.Clear(); if (txt_Descr.Text.Trim() == "") { errorProvider1.SetError(txt_Descr, "Please enter a route name !"); return; } if (txt_Routecode.Text.Trim() == "") { errorProvider1.SetError(txt_Routecode, "Please enter a route code !"); return; } if (formMode == 1) { if (M_RouteDL.ExistingM_Route(txt_Routecode.Text.Trim())) { errorProvider1.SetError(txt_Routecode, "The route code you have entered already exists!"); return; } if (!M_AreaDL.ExistingM_Area(txt_AreaCode.Text.Trim())) { errorProvider1.SetError(txt_AreaCode, "The area code you have entered not exists!"); return; } if (!M_TerritoryDL.ExistingM_Territory(txt_TerritoryCode.Text.Trim())) { errorProvider1.SetError(txt_TerritoryCode, "The territory code you have entered not exists!"); return; } if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Save, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { M_Route objm_Route = new M_Route(); objm_Route.Routecode = txt_Routecode.Text.Trim(); objm_Route.Compcode = commonFunctions.GlobalCompany; //txt_Compcode.Text.Trim(); objm_Route.Locacode = commonFunctions.GlobalLocation; //txt_Locacode.Text.Trim(); objm_Route.TerritoryCode = txt_TerritoryCode.Text.Trim(); objm_Route.AreaCode = txt_AreaCode.Text.Trim(); objm_Route.Descr = txt_Descr.Text.Trim(); objm_Route.Datex = DateTime.Now; objm_Route.Userx = commonFunctions.Loginuser; M_RouteDL bal = new M_RouteDL(); bal.SaveM_RouteSP(objm_Route, 1); GetData(); txt_TerritoryCode.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Save); commonFunctions.SetMDIStatusMessage(UserDefineMessages.Msg_Save_Sucess_string, 2); } } else if (formMode == 3) { if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Update, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { M_Route objm_Route = new M_Route(); objm_Route.Routecode = txt_Routecode.Text.Trim(); objm_Route.Compcode = commonFunctions.GlobalCompany; //txt_Compcode.Text.Trim(); objm_Route.Locacode = commonFunctions.GlobalLocation; //txt_Locacode.Text.Trim(); objm_Route.TerritoryCode = txt_TerritoryCode.Text.Trim(); objm_Route.AreaCode = txt_AreaCode.Text.Trim(); objm_Route.Descr = txt_Descr.Text.Trim(); objm_Route.Datex = DateTime.Now; objm_Route.Userx = commonFunctions.Loginuser; M_RouteDL bal = new M_RouteDL(); bal.SaveM_RouteSP(objm_Route, 3); GetData(); txt_TerritoryCode.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Save); commonFunctions.SetMDIStatusMessage(UserDefineMessages.Msg_Update_Sucess_string, 2); } } break; case xEnums.PerformanceType.Cancel: txt_TerritoryCode.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Default); errorProvider1.Clear(); break; case xEnums.PerformanceType.Print: UserDefineMessages.ShowMsg1("Print still in process", UserDefineMessages.Msg_Information); break; } }
private void performButtons(xEnums.PerformanceType xenum) { switch (xenum) { case xEnums.PerformanceType.View: if (ActiveControl.Name.Trim() == txt_AgentCode.Name.Trim()) { int length = Convert.ToInt32(ConfigurationManager.AppSettings["AgentFieldLength"]); string[] strSearchField = new string[length]; string strSQL = ConfigurationManager.AppSettings["AgentSQL"].ToString(); for (int i = 0; i < length; i++) { string m; m = i.ToString(); strSearchField[i] = ConfigurationManager.AppSettings["AgentField" + m + ""].ToString(); } frmU_Search find = new frmU_Search(strSQL, strSearchField, this); find.ShowDialog(this); } break; case xEnums.PerformanceType.New: FunctionButtonStatus(xEnums.PerformanceType.New); formMode = 1; txt_AgentCode.Focus(); errorProvider1.Clear(); break; case xEnums.PerformanceType.Edit: FunctionButtonStatus(xEnums.PerformanceType.Edit); formMode = 3; txt_AgentCode.Enabled = false; txt_Namex.Focus(); errorProvider1.Clear(); break; case xEnums.PerformanceType.Save: errorProvider1.Clear(); try { if (txt_Namex.Text.Trim() == "") { errorProvider1.SetError(txt_Namex, "Please enter a agent name !"); return; } if (txt_AgentCode.Text.Trim() == "") { errorProvider1.SetError(txt_AgentCode, "Please enter a Agent Code !"); return; } if (formMode == 1) { if (M_AgentDL.ExistingM_Agent(txt_AgentCode.Text.Trim())) { errorProvider1.SetError(txt_AgentCode, "The agent code you have entered already exists!"); return; } if (!M_AreaDL.ExistingM_Area(txt_AreaCode.Text.Trim())) { errorProvider1.SetError(txt_AreaCode, "The area code you have entered already exists!"); return; } if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Save, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { M_Agents objm_Agent = new M_Agents(); objm_Agent.AgentCode = txt_AgentCode.Text.Trim(); objm_Agent.Namex = txt_Namex.Text.Trim(); objm_Agent.Address1 = txt_Address1.Text.Trim(); objm_Agent.Address2 = txt_Address2.Text.Trim(); objm_Agent.Address3 = txt_Address3.Text.Trim(); objm_Agent.TPOffice = txt_TPOffice.Text.Trim(); objm_Agent.TPPersonal = txt_TPPersonal.Text.Trim(); objm_Agent.Fax = txt_Fax.Text.Trim(); objm_Agent.Email = txt_Email.Text.Trim(); objm_Agent.AccNo = txt_AccNo.Text.Trim(); objm_Agent.NICno = txt_NICno.Text.Trim(); objm_Agent.PassportNo = txt_PassportNo.Text.Trim(); objm_Agent.Datex = DateTime.Now; // txt_Datex.Text.Trim(); objm_Agent.userx = commonFunctions.Loginuser; // txt_userx.Text.Trim(); objm_Agent.TimeFrom = dte_from.Value; objm_Agent.TimeTo = dte_to.Value; objm_Agent.District = txt_AreaCode.Text; objm_Agent.Remarks = txt_remarks.Text; M_AgentDL bal = new M_AgentDL(); bal.SaveM_AgentSP(objm_Agent, 1); GetData(); txt_AgentCode.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Save); commonFunctions.SetMDIStatusMessage(UserDefineMessages.Msg_Save_Sucess_string, 2); } } else if (formMode == 3) { if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Update, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { M_Agents objm_Agent = new M_Agents(); objm_Agent.AgentCode = txt_AgentCode.Text.Trim(); objm_Agent = new M_AgentDL().Selectm_Agent(objm_Agent); objm_Agent.Namex = txt_Namex.Text.Trim(); objm_Agent.Address1 = txt_Address1.Text.Trim(); objm_Agent.Address2 = txt_Address2.Text.Trim(); objm_Agent.Address3 = txt_Address3.Text.Trim(); objm_Agent.TPOffice = txt_TPOffice.Text.Trim(); objm_Agent.TPPersonal = txt_TPPersonal.Text.Trim(); objm_Agent.Fax = txt_Fax.Text.Trim(); objm_Agent.Email = txt_Email.Text.Trim(); objm_Agent.AccNo = txt_AccNo.Text.Trim(); objm_Agent.NICno = txt_NICno.Text.Trim(); objm_Agent.PassportNo = txt_PassportNo.Text.Trim(); objm_Agent.Datex = DateTime.Now; // txt_Datex.Text.Trim(); objm_Agent.userx = commonFunctions.Loginuser; // txt_userx.Text.Trim(); objm_Agent.TimeFrom = dte_from.Value; objm_Agent.TimeTo = dte_to.Value; objm_Agent.District = txt_AreaCode.Text; objm_Agent.Remarks = txt_remarks.Text; M_AgentDL bal = new M_AgentDL(); bal.SaveM_AgentSP(objm_Agent, 3); GetData(); txt_AgentCode.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Save); commonFunctions.SetMDIStatusMessage(UserDefineMessages.Msg_Update_Sucess_string, 2); } } } catch (Exception ex) { LogFile.WriteErrorLog(System.Reflection.MethodBase.GetCurrentMethod().Name, this.Name, ex.Message.ToString(), "Exception"); commonFunctions.SetMDIStatusMessage("Genaral Error on updating data", 1); } break; case xEnums.PerformanceType.Cancel: txt_AgentCode.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Default); errorProvider1.Clear(); break; case xEnums.PerformanceType.Print: UserDefineMessages.ShowMsg1("Print still in process", UserDefineMessages.Msg_Information); break; } }
private void performButtons(xEnums.PerformanceType xenum) { switch (xenum) { case xEnums.PerformanceType.View: if (ActiveControl.Name.Trim() == txt_Locacode.Name.Trim()) { int length = Convert.ToInt32(ConfigurationManager.AppSettings["BankFieldLength"]); string[] strSearchField = new string[length]; string strSQL = ConfigurationManager.AppSettings["BankSQL"].ToString(); for (int i = 0; i < length; i++) { string m; m = i.ToString(); strSearchField[i] = ConfigurationManager.AppSettings["BankField" + m + ""].ToString(); } frmU_Search find = new frmU_Search(strSQL, strSearchField, this); find.ShowDialog(this); } break; case xEnums.PerformanceType.New: FunctionButtonStatus(xEnums.PerformanceType.New); formMode = 1; txt_Locacode.Focus(); break; case xEnums.PerformanceType.Edit: FunctionButtonStatus(xEnums.PerformanceType.Edit); formMode = 3; txt_Locacode.Enabled = false; txt_Locaname.Focus(); break; case xEnums.PerformanceType.Save: if (formMode == 1) { if (M_LocaDL.ExistingM_Loca(txt_Locacode.Text.Trim())) { UserDefineMessages.ShowMsg("The location code you have entered already exists!", UserDefineMessages.Msg_Warning); return; } if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Save, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { M_Loca objm_Loca = new M_Loca(); objm_Loca.Locacode = txt_Locacode.Text.Trim(); objm_Loca.Companycode = commonFunctions.GlobalCompany.Trim(); objm_Loca.StockCode = txt_Locacode.Text.Trim(); objm_Loca.Locaname = txt_Locaname.Text.Trim(); objm_Loca.Add1 = txt_Add1.Text.Trim(); objm_Loca.Add2 = txt_Add2.Text.Trim(); objm_Loca.Add3 = txt_Add3.Text.Trim(); objm_Loca.Tpno = txt_Tpno.Text.Trim(); objm_Loca.Fax = txt_Fax.Text.Trim(); objm_Loca.Emailx = txt_Emailx.Text.Trim(); objm_Loca.Userx = commonFunctions.Loginuser; objm_Loca.Datex = DateTime.Now; M_LocaDL bal = new M_LocaDL(); bal.SaveM_LocaSP(objm_Loca, 1); GetData(); txt_Locacode.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Save); commonFunctions.SetMDIStatusMessage(UserDefineMessages.Msg_Save_Sucess_string, 2); } } else if (formMode == 3) { if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Update, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { M_Loca objm_Loca = new M_Loca(); objm_Loca.Locacode = txt_Locacode.Text.Trim(); objm_Loca.Companycode = commonFunctions.GlobalCompany.Trim(); objm_Loca.StockCode = txt_Locacode.Text.Trim(); objm_Loca.Locaname = txt_Locaname.Text.Trim(); objm_Loca.Add1 = txt_Add1.Text.Trim(); objm_Loca.Add2 = txt_Add2.Text.Trim(); objm_Loca.Add3 = txt_Add3.Text.Trim(); objm_Loca.Tpno = txt_Tpno.Text.Trim(); objm_Loca.Fax = txt_Fax.Text.Trim(); objm_Loca.Emailx = txt_Emailx.Text.Trim(); objm_Loca.Userx = commonFunctions.Loginuser; objm_Loca.Datex = DateTime.Now; M_LocaDL bal = new M_LocaDL(); bal.SaveM_LocaSP(objm_Loca, 3); GetData(); txt_Locacode.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Save); commonFunctions.SetMDIStatusMessage(UserDefineMessages.Msg_Update_Sucess_string, 2); } } break; case xEnums.PerformanceType.Cancel: txt_Locacode.Enabled = true; FunctionButtonStatus(xEnums.PerformanceType.Default); break; case xEnums.PerformanceType.Print: UserDefineMessages.ShowMsg1("Print still in process", UserDefineMessages.Msg_Information); break; } }