public object[] queryDataMstDataBasic(MST_DATA_BASIC param) { log.Info("Start log INFO... queryDataMstDataBasic"); MsgForm msgError = new MsgForm(); MST_DATA_BASIC form = new MST_DATA_BASIC(); try { using (var db = new PaknampoScaleDBEntities()) { form = (from row in db.MST_DATA_BASIC where row.BASIC_ID == param.BASIC_ID select row).FirstOrDefault(); db.Dispose(); msgError.statusFlag = MsgForm.STATUS_SUCCESS; } } catch (Exception ex) { log.Error(ex.ToString(), ex); msgError.statusFlag = MsgForm.STATUS_ERROR; msgError.messageDescription = ex.ToString(); } finally { log.Info("End log INFO... queryDataMstDataBasic"); } return(new object[] { msgError, form }); }
public object[] updateDataMstDataBasic(MST_DATA_BASIC param) { log.Info("Start log INFO... updateDataMstDataBasic"); MsgForm msgError = new MsgForm(); MST_DATA_BASIC form = new MST_DATA_BASIC(); try { using (var db = new PaknampoScaleDBEntities()) { form = (from row in db.MST_DATA_BASIC where row.BASIC_ID == param.BASIC_ID select row).FirstOrDefault(); if (Util.isNotEmpty(form)) { form.BASIC_CARD_NO = param.BASIC_CARD_NO; form.BASIC_CARD_NO_SCOOP = param.BASIC_CARD_NO_SCOOP; form.BASIC_RECEIPT_NO = param.BASIC_RECEIPT_NO; form.BASIC_DECIMAL = param.BASIC_DECIMAL; form.BASIC_MOVE_NO = param.BASIC_MOVE_NO; form.BASIC_DEDUCTION = param.BASIC_DEDUCTION; form.BASIC_FARE = param.BASIC_FARE; form.BASIC_STATUS_PRINT_CARD_NO = param.BASIC_STATUS_PRINT_CARD_NO; form.BASIC_STATUS_PRINT_CARD_SEND = param.BASIC_STATUS_PRINT_CARD_SEND; form.BASIC_STATIS_SHOW_CARD_FARE = param.BASIC_STATIS_SHOW_CARD_FARE; form.BASIC_STATUS_PRINT_OUTLOOK_VENDOR = param.BASIC_STATUS_PRINT_OUTLOOK_VENDOR; log.Info("Update Data form MST_DATA_BASIC WHERE " + form.BASIC_ID + " BASIC_CARD_NO : " + form.BASIC_CARD_NO + " BASIC_CARD_NO_SCOOP : " + form.BASIC_CARD_NO_SCOOP + " BASIC_RECEIPT_NO : " + form.BASIC_RECEIPT_NO + " BASIC_DECIMAL : " + form.BASIC_DECIMAL + " BASIC_MOVE_NO : " + form.BASIC_MOVE_NO + " BASIC_DEDUCTION : " + form.BASIC_DEDUCTION + " BASIC_FARE : " + form.BASIC_FARE + " BASIC_STATUS_PRINT_CARD_NO : " + form.BASIC_STATUS_PRINT_CARD_NO + " BASIC_STATUS_PRINT_CARD_SEND : " + form.BASIC_STATUS_PRINT_CARD_SEND + " BASIC_STATIS_SHOW_CARD_FARE : " + form.BASIC_STATIS_SHOW_CARD_FARE + " BASIC_STATUS_PRINT_OUTLOOK_VENDOR : " + form.BASIC_STATUS_PRINT_OUTLOOK_VENDOR ); } db.SaveChanges(); msgError.statusFlag = MsgForm.STATUS_SUCCESS; } } catch (Exception ex) { log.Error(ex.ToString(), ex); msgError.statusFlag = MsgForm.STATUS_ERROR; msgError.messageDescription = ex.ToString(); } finally { log.Info("End log INFO... updateDataMstDataBasic"); } return(new object[] { msgError }); }
public void updateDataMstDataBasic() { MST006Controller mst006Ctrl = new MST006Controller(); MST_DATA_BASIC form = new MST_DATA_BASIC(); try { form.BASIC_ID = formMstDataBasic.BASIC_ID; form.BASIC_CARD_NO = Int32.Parse(txtBasicCardNo.Text); form.BASIC_CARD_NO_SCOOP = Int32.Parse(txtBasicCardNoScoop.Text); form.BASIC_RECEIPT_NO = Int32.Parse(txtBasicReceiptNo.Text); form.BASIC_DECIMAL = Int32.Parse(txtBasicDecimal.Text); form.BASIC_MOVE_NO = Int32.Parse(txtBasicMoveNo.Text); form.BASIC_DEDUCTION = Int32.Parse(txtBasicDeduction.Text); form.BASIC_FARE = Int32.Parse(txtBasicFare.Text); form.BASIC_STATUS_PRINT_CARD_NO = Util.chkboxToNumber(chkStatusPrintCardNo.Checked); form.BASIC_STATUS_PRINT_CARD_SEND = Util.chkboxToNumber(chkStatusPrintCardSend.Checked); form.BASIC_STATIS_SHOW_CARD_FARE = Util.chkboxToNumber(chkStatusShowCardFare.Checked); form.BASIC_STATUS_PRINT_OUTLOOK_VENDOR = Util.chkboxToNumber(chkStatusPrintOutlookVendor.Checked); if (Util.isEmpty(form)) { return; } object[] result = mst006Ctrl.updateDataMstDataBasic(form); MsgForm msgForm = (MsgForm)result[0]; if (msgForm.statusFlag.Equals(1)) { MessageBox.Show(CommonUtil.SAVE_DATA_SUCCESS); } else { MessageBox.Show("Error : " + msgForm.messageDescription); } } catch (Exception ex) { log.Error(ex.ToString(), ex); MessageBox.Show("Error : " + ex.ToString()); } }
public void queryDataMstDataBasic() { MST006Controller mst006Ctrl = new MST006Controller(); formMstDataBasic.BASIC_ID = 1; try { object[] result = mst006Ctrl.queryDataMstDataBasic(formMstDataBasic); MsgForm msgForm = (MsgForm)result[0]; MST_DATA_BASIC data = (MST_DATA_BASIC)result[1]; if (msgForm.statusFlag.Equals(1)) { if (Util.isNotEmpty(data)) { formMstDataBasic = data; txtBasicCardNo.Text = data.BASIC_CARD_NO.ToString(); txtBasicReceiptNo.Text = data.BASIC_RECEIPT_NO.ToString(); txtBasicCardNoScoop.Text = data.BASIC_CARD_NO_SCOOP.ToString(); txtBasicDecimal.Text = data.BASIC_DECIMAL.ToString(); txtBasicMoveNo.Text = data.BASIC_MOVE_NO.ToString(); txtBasicDeduction.Text = data.BASIC_DEDUCTION.ToString(); txtBasicFare.Text = data.BASIC_FARE.ToString(); chkStatusPrintCardNo.Checked = Util.chkboxToBool(data.BASIC_STATUS_PRINT_CARD_NO); chkStatusPrintCardSend.Checked = Util.chkboxToBool(data.BASIC_STATUS_PRINT_CARD_SEND); chkStatusShowCardFare.Checked = Util.chkboxToBool(data.BASIC_STATIS_SHOW_CARD_FARE); chkStatusPrintOutlookVendor.Checked = Util.chkboxToBool(data.BASIC_STATUS_PRINT_OUTLOOK_VENDOR); } } else { MessageBox.Show("Error : " + msgForm.messageDescription); } } catch (Exception ex) { log.Error(ex.ToString(), ex); MessageBox.Show("Error : " + ex.ToString()); } }