Пример #1
0
        private void frmShipPlan_Load(object sender, EventArgs e)
        {
            baseForm.SetFace(this);
            baseForm.SetQueryGridStyle(this.grdDetail);

            DataTable custDt = GetAllCustomer().Tables[0];
            DropDown.InitCMB_DataTable(this.cmbCustomer, custDt, "customername", "customerid");

            custordernoDt = GetCustOrder();

            if (ShipingSysId != null)
            {
                UpdateMode = Public_UpdateMode.Update;
            }
            else
            {
                UpdateMode = Public_UpdateMode.Insert;
            }

            if (UpdateMode == Public_UpdateMode.Insert)
            {
                this.grdDetail.SetDataBinding(createEmptyTable(), "");
                BillLockRefId = Function.GetGUID();
                ReceivingNoNamingRule = baseForm.GetSystemConfig("SYS_SHIPPINGPLANNO");
                List<string> lstRecNo = baseForm.GetBillNoBatch(ReceivingNoNamingRule, 1, BillLockRefId);
                this.txtShippingPlanNo.Text = lstRecNo[0];
                IsNeedToUnlockBill = true;
            }
            else
            {
                shippingdtlDt = GetShippingDtlRecords();
                if (shippingdtlDt.Rows.Count > 0)
                {
                    this.txtShippingPlanNo.Text = shippingdtlDt.Rows[0]["shippingplanno"].ToString();
                    DropDown.SelectCMBValue(this.cmbCustomer, shippingdtlDt.Rows[0]["customerid"].ToString());
                    this.cmbCustomer.Enabled = false;
                }
                this.grdDetail.SetDataBinding(shippingdtlDt, "");

                tinpshippingplan shippingplan = GetShippingPlan(this.txtShippingPlanNo.Text);
                if (shippingplan != null)
                {
                    this.dtLoadingDt.Value = shippingplan.loadingdate;
                    this.txtBoxQty.Text = shippingplan.boxqty;
                    this.txtDeliveryBill.Text = shippingplan.deliverybill;
                    this.txtInShipNo.Text = shippingplan.inshipno;
                    this.numCommissionedQty.Value = Convert.ToDecimal(shippingplan.commissionedqty);
                    this.numCommissionedVolume.Value = Convert.ToDecimal(shippingplan.commissionedvolume);
                    this.numCommissionedWeight.Value = Convert.ToDecimal(shippingplan.commissionedweight);
                    this.txtStartPort.Text = shippingplan.startport;
                    this.txtDestinationPort.Text = shippingplan.destinationport;
                    this.txtUnloadPort.Text = shippingplan.unloadport;
                    this.txtVoyage.Text = shippingplan.voyage;
                    this.txtRemark.Text = shippingplan.remark;
                }
            }
            //this.txtShippingPlanNo.Enabled = false;
        }
Пример #2
0
        private void frmFunctionsEdit_Load(object sender, EventArgs e)
        {
            baseForm.SetFace(this);
            if (FuncId != null)
            {
                UpdateMode = Public_UpdateMode.Update;
            }
            else
            {
                UpdateMode = Public_UpdateMode.Insert;
            }
            SetLayout();

            if (UpdateMode == Public_UpdateMode.Update)
            {
                tsecfunctions functions = GetSingleFunctions(FuncId);
                baseForm.OriginalObject = functions;
                baseForm.ShowSingleObjectToUI<tsecfunctions>(functions, this);
            }
            else
            {
                baseForm.setDefaultValue(this);
            }
        }
Пример #3
0
        private void cboCustomer_SelectedIndexChanged(object sender, EventArgs e)
        {
            List<MESParameterInfo> lstParameters = new List<MESParameterInfo>() {
                new MESParameterInfo(){ParamName="customerid",ParamValue = (this.cboCustomer.SelectedItem as ValueInfo).ValueField}
            };
            DoShowSingleObject(lstParameters);

            if (this.grdDetail.Rows.Count > 0)
                UpdateMode = Public_UpdateMode.Update;
        }
Пример #4
0
        private void frmRoleEdit_Load(object sender, EventArgs e)
        {
            baseForm.SetFace(this);
            //baseForm.SetQueryGridStyle(this.gridEqpGroup);

            if (RoleId != null)
            {
                UpdateMode = Public_UpdateMode.Update;
            }
            else
            {
                UpdateMode = Public_UpdateMode.Insert;
            }
            SetLayout();

            baseForm.SetCursor();
            if (UpdateMode == Public_UpdateMode.Update)
            {
                tsecrole role = GetSingleRole(RoleId);
                baseForm.OriginalObject = role;
                baseForm.ShowSingleObjectToUI<tsecrole>(role, this);
            }
            else
            {
                baseForm.setDefaultValue(this);
            }
            InitFunctionTree();

            //InitStepTree();

            //InitEqpGroupGrid();
            baseForm.ResetCursor();
        }
Пример #5
0
        private void frmEmployeeTypeEdit_Load(object sender, EventArgs e)
        {
            baseForm.SetFace(this);
            if (EmployeeTypeId != null)
            {
                UpdateMode = Public_UpdateMode.Update;
            }
            else
            {
                UpdateMode = Public_UpdateMode.Insert;
            }

            if (UpdateMode == Public_UpdateMode.Update)
            {
                tmdlemployeetype employeetype = GetSingleEmployeeType(EmployeeTypeId);
                baseForm.OriginalObject = employeetype;
                baseForm.ShowSingleObjectToUI<tmdlemployeetype>(employeetype, this);
                this.txtEmployeeTypeId.Enabled = false;
            }
        }
Пример #6
0
        private void frmCustomerEdit_Load(object sender, EventArgs e)
        {
            baseForm.SetFace(this);
            baseForm.SetQueryGridStyle(this.grdContact);

            if (CustomerId != null)
            {
                UpdateMode = Public_UpdateMode.Update;
            }
            else
            {
                UpdateMode = Public_UpdateMode.Insert;
            }
            SetLayout();

            if (UpdateMode == Public_UpdateMode.Update)
            {
                tmdlcustomer customer = GetSingleCustomer(CustomerId);
                baseForm.OriginalObject = customer;
                baseForm.ShowSingleObjectToUI<tmdlcustomer>(customer, this);

                GetContactList(new List<MESParameterInfo>() {
                    new MESParameterInfo(){ParamName="customerid",ParamValue=customer.customerid }
                });
            }
            else
            {
                GetContactList(new List<MESParameterInfo>() {
                    new MESParameterInfo(){ParamName="customerid",ParamValue=MES_DummyData.Dummy_Data_XXX_111.ToString() }
                });
            }
        }
Пример #7
0
        private void frmReturn_Load(object sender, EventArgs e)
        {
            baseForm.SetFace(this);
            baseForm.SetQueryGridStyle(this.grdDetail);

            try
            {
                DataTable custDt = GetAllCustomer().Tables[0];
                DropDown.InitCMB_DataTable(this.cmbCustomer, custDt, "customername", "customerid");
                DropDown.InitCMB_StaticValue(this.cmbReturnType, MES_StaticValue_Type.ReturnType);

                if (retSysId != null)
                {
                    UpdateMode = Public_UpdateMode.Update;
                }
                else
                {
                    UpdateMode = Public_UpdateMode.Insert;
                }

                if (UpdateMode == Public_UpdateMode.Insert)
                {
                    BillLockRefId = Function.GetGUID();
                    ReceivingNoNamingRule = baseForm.GetSystemConfig("SYS_RETURNNO");
                    List<string> lstRecNo = baseForm.GetBillNoBatch(ReceivingNoNamingRule, 1, BillLockRefId);
                    this.txtReturnNo.Text = lstRecNo[0];
                    this.txtReturnNo.Enabled = false;
                    IsNeedToUnlockBill = true;
                }
                else
                {
                    inpreturn = GetSingleReturn(retSysId);
                    returndtlDt = GetReturnDtl(retSysId).Tables[0];
                    this.txtReturnNo.Text = inpreturn.returnno;
                    DropDown.SelectCMBValue(this.cmbCustomer,inpreturn.customerid);
                    DropDown.SelectCMBValue(this.cmbReturnType, inpreturn.returntype);
                    this.txtReturnNo.Enabled = false;
                    this.cmbCustomer.Enabled = false;

                }
            }
            catch (Exception ex)
            {
                baseForm.CreateMessageBox(Public_MessageBox.Error, MessageBoxButtons.OK, null, ex.Message);
            }
        }
Пример #8
0
 private void frmShiftEdit_Load(object sender, EventArgs e)
 {
     baseForm.SetFace(this);
     if (Shift != null)
     {
         UpdateMode = Public_UpdateMode.Update;
     }
     else
     {
         UpdateMode = Public_UpdateMode.Insert;
     }
     SetLayout();
       //  dtEndTime.Value = new DateTime();
       //  dtStartTime.Value = new DateTime();
     if (UpdateMode == Public_UpdateMode.Update)
     {
         tmdlshift shiftObj = GetSingleShift(Shift);
         baseForm.OriginalObject = shiftObj;
         baseForm.ShowSingleObjectToUI<tmdlshift>(shiftObj, this);
     }
 }
Пример #9
0
        private void frmEmployee_Load(object sender, EventArgs e)
        {
            baseForm.SetFace(this);
            if (EmployeeId != null)
            {
                UpdateMode = Public_UpdateMode.Update;
            }
            else
            {
                UpdateMode = Public_UpdateMode.Insert;
            }
            SetLayout();

            if (UpdateMode == Public_UpdateMode.Update)
            {
                tmdlemployee employee = GetSingleEmployee(EmployeeId);
                baseForm.OriginalObject = employee;
                baseForm.ShowSingleObjectToUI<tmdlemployee>(employee, this);
            }
            else
            {
                baseForm.setDefaultValue(this);
            }
        }