Exemple #1
0
        public StoreInPlan(SessionInfo _session = null, StoreInPlanHead model = null)
        {
            InitializeComponent();
            this._repo = new StoreInPlanRepo();
            this._repoIn = new StoreInRepo();
            this._repoCurr = new CurrenciesRepo();
            this._repoSupplier = new SupplierRepo();
            this._repoBT = new BussinessTypeRepo();
            this._repoMaker = new MakerRepo();
            this._repoMill = new MillRepo();
            this._repoCmdt = new Commodity();
            this._repoSpec = new SpecRepo();
            this._repoCoating = new CoatingRepo();
            this._repoWhse = new WharehouseRepo();
            this._repoPort = new ImportPortRepo();
            this._repoCust = new CustomerRepo();
            this._repoLookup = new LookupRepo();
            this.SourceStr = "";
            epiSession = _session;

            if (model == null || epiSession == null)
            {
                this.HeadContent = new StoreInPlanHead();
                this.IMEXReviewFlag = false;
            }
            else
            {
                this.HeadContent = model;                
                this.IMEXReviewFlag = true;
            }
            this.ModelClone = new StoreInPlanHead();
            this.POTrans = new POLineModel();
        }
Exemple #2
0
        //public int POLine;
        //public decimal POBalance;

        public POLineDialog(int PONum)
        {
            InitializeComponent();
            this._repo = new PORepo();
            this._repoSpl = new StoreInPlanRepo();
            this.paramLine = new POLineModel();
            this.PONUM = PONum;
            //this.POBalance = 0;
        }
Exemple #3
0
        private void txtPoNumber_Leave(object sender, EventArgs e)
        {
            string code = txtPoNumber.Text.Trim();
            int PONum = 0;
            string result = string.Empty;

            if (HeadContent.StoreInFlag == "0" && !string.IsNullOrEmpty(code))
            {
                if (string.IsNullOrEmpty(HeadContent.SupplierCode) && string.IsNullOrEmpty(HeadContent.MakerCode))
                {
                    GetHeader header = _repo.GetHeaderByPONum(txtPoNumber.Text.Trim());
                    if (header == null)
                    {
                        MessageBox.Show("PO Number : " + this.txtPoNumber.Text.ToString() + " doesn't exists.", "Please try agian.", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                        return;
                    }
                    HeadContent.SupplierCode = header.SupplierCode;
                    HeadContent.SupplierName = header.SupplierName;
                    HeadContent.MakerCode = header.MakerCode;
                    HeadContent.MakerName = header.MakerName;
                    HeadContent.MillCode = header.MillCode;
                    HeadContent.MillName = header.MillName;
                    HeadContent.CustID = header.CustID;
                    HeadContent.CustomerName = header.CustomerName;
                    HeadContent.ETADate = DateTime.Now;
                    HeadContent.ETDDate = DateTime.Now;
                    HeadContent.InvoiceDate = DateTime.Now;
                    HeadContent.CurrencyCode = header.CurrencyCode;
                    HeadContent.ExchangeRate = header.ExchangeRate;
                    SetHeaderContent(HeadContent);
                }

                bool getPO = _repo.GetPOByPONumber(epiSession.PlantID, code, HeadContent, out result, out PONum);
                if (!getPO)
                {
                    MessageBox.Show("PO Number : " + this.txtPoNumber.Text.ToString() + " doesn't exists.", "Please try agian.", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                    this.txtPoNumber.Focus();
                    this.txtPoNumber.SelectAll();
                }
                else
                {
                    txtSaleContract.Text = result;
                    using (POLineDialog frm = new POLineDialog(PONum))
                    {
                        frm.ShowDialog();
                        POTrans = frm.paramLine;
                        SetPOLineTrans(POTrans);
                    }
                    //txtNumberOfArticle.Focus();
                    //txtNumberOfArticle.SelectAll();
                }
            }
        }
Exemple #4
0
        private void SetPOLineTrans(POLineModel model)
        {
            txtPoLine.DataBindings.Clear();
            txtReceiptWeight.DataBindings.Clear();

            txtPoLine.DataBindings.Add("Text", model, "POLine", true, DataSourceUpdateMode.Never, 0, "#,##0");
            txtReceiptWeight.DataBindings.Add("Text", model, "BalanceWeight", true, DataSourceUpdateMode.Never, 0, "#,##0.###");
        }
Exemple #5
0
 private void ClearPOLineTrans()
 {
     POTrans = null;
     txtPoNumber.Clear();
     txtSaleContract.Clear();
     txtNumberOfArticle.Clear();
     txtPoLine.Clear();
     txtReceiptWeight.Clear();
 }