Beispiel #1
0
        private bool SaveData()
        {
            IssueByEntryController  ctlIssue      = new IssueByEntryController();
            List <IssueByOrderUIDM> uidmIssueList = new List <IssueByOrderUIDM>();


            NZString FromLocCD   = new NZString(cboFromLoc, cboFromLoc.SelectedValue);
            NZString ToLocCD     = new NZString(cboToLoc, cboToLoc.SelectedValue);
            NZString TranSubCls  = new NZString(cboSubType, cboSubType.SelectedValue);
            NZString RefSlipNo   = new NZString(txtRefDocNo, txtRefDocNo.Text);
            NZString RefSlipNo2  = new NZString(txtJobOrderNo, txtJobOrderNo.Text);
            NZString ForCustomer = new NZString(cboForCustomer, cboForCustomer.SelectedValue);

            int row = shtIssueList.Rows.Count;

            for (int i = 0; i < row; i++)
            {
                IssueByOrderUIDM uidm   = new IssueByOrderUIDM();
                NZString         ItemCD = new NZString(null,
                                                       shtIssueList.Cells[i, (int)eColView.ITEM_CODE].
                                                       Text);
                NZString   LotNo     = new NZString(null, shtIssueList.Cells[i, (int)eColView.LOT_NO].Value);
                NZDecimal  Qty       = new NZDecimal(null, shtIssueList.Cells[i, (int)eColView.ISSUE_QTY].Value);
                NZString   Remark    = new NZString(txtRemark, txtRemark.Text.Trim());
                NZDateTime TransDate = new NZDateTime(dtIssueDate, dtIssueDate.Value);
                uidm.ITEM_CD      = ItemCD;
                uidm.FROM_LOC_CD  = FromLocCD;
                uidm.TO_LOC_CD    = ToLocCD;
                uidm.LOT_NO       = LotNo;
                uidm.QTY          = Qty;
                uidm.REMARK       = Remark;
                uidm.TRANS_DATE   = TransDate;
                uidm.TRANS_CLS    = DataDefine.Convert2ClassCode(DataDefine.eTRANS_TYPE.Issuing).ToNZString();//TransCls;
                uidm.TRAN_SUB_CLS = TranSubCls;
                uidm.REF_SLIP_NO  = RefSlipNo;
                uidm.REF_SLIP_NO2 = RefSlipNo2;
                uidm.FOR_CUSTOMER = ForCustomer;

                uidmIssueList.Add(uidm);
            }

            ctlIssue.SaveAddIssue(uidmIssueList);

            return(true);
        }
Beispiel #2
0
        private bool SaveDataEditMode()
        {
            RemoveRowUnused();
            // ต้องเรียกก่อน Save เสมอ  เพื่อ Commit ข้อมูลการแก้ไขล่าสุดบน Grid
            // ใช้ได้เฉพาะกับ Sheet ที่ผูก DataSource
            //int row = shtIssueList.Rows.Count;
            for (int i = 0; i < shtIssueList.Rows.Count; i++)
            {
                CtrlUtil.SpreadSheetRowEndEdit(shtIssueList, shtIssueList.ActiveRowIndex);
            }

            IssueByOrderUIDM newModel = dmcIssue.SaveData(new IssueByOrderUIDM());

            newModel.DATA_VIEW = m_uidm.DATA_VIEW;


            //== Save Process
            IssueByEntryController ctl = new IssueByEntryController();

            ctl.SaveDataEditMode(newModel);
            return(true);
        }
Beispiel #3
0
        private void LoadIssueListForEdit(NZString SLIP_NO)
        {
            if (SLIP_NO.IsNull)
            {
                return;
            }
            shtIssueList.Rows.Count = 0;
            IssueByEntryController ctlIssue = new IssueByEntryController();

            m_uidm.DATA_VIEW = ctlIssue.LoadIssueListForEdit(SLIP_NO);

            m_uidm.DATA_VIEW.AcceptChanges();
            shtIssueList.DataSource = m_uidm.DATA_VIEW;

            // load lot no
            int row = shtIssueList.Rows.Count;

            for (int i = 0; i < row; i++)
            {
                shtIssueList.Cells[i, (int)eColView.LOT_NO].Value =
                    m_uidm.DATA_VIEW.Rows[i][eColView.LOT_NO.ToString()].ToString();
            }
        }