private void button1_Click(object sender, EventArgs e) { var list = _repo.GetAll(0).ToList(); using (StoreInPlanDialog frm = new StoreInPlanDialog(epiSession, list)) { frm.ShowDialog(); if (frm.HeadContent.StoreInPlanNum != null) { HeadContent = frm.HeadContent; ModelClone = (StoreInPlanHeadModel)HeadContent.Clone(); } } txtStoreInPlanNum.Text = HeadContent.StoreInPlanNum; SetHeaderContent(HeadContent); }
private void txtStoreInPlanNum_Leave(object sender, EventArgs e) { string code = txtStoreInPlanNum.Text.Trim(); if (code != ModelClone.StoreInPlanNum && txtStoreInPlanNum.Text != "") { var result = _repo.GetByID(code); if (result == null) { button1_Click(sender, e); } else { HeadContent = result; ModelClone = (StoreInPlanHeadModel)HeadContent.Clone(); } //SetHeaderContent(HeadContent); } }
private void GetNew(int ImportFlag) { //tabControl1.TabPages.Remove(tabPage1); //tabControl1.TabPages.Remove(tabPage2); HeadContent = new StoreInPlanHeadModel(); HeadContent.InsertState = true; HeadContent.StoreInPlanId = 0; HeadContent.StoreInPlanNum = ""; HeadContent.InvoiceDate = DateTime.Now; HeadContent.ETADate = DateTime.Now; HeadContent.ETDDate = DateTime.Now; HeadContent.StoreInFlag = "0"; HeadContent.Currencies = _repoCurr.GetAll().ToList(); HeadContent.ImportPorts = this._repoPort.GetAll().ToList(); HeadContent.ImportFlag = ImportFlag; HeadContent.OpenOrder = 1; ModelClone = (StoreInPlanHeadModel)HeadContent.Clone(); SetHeaderContent(HeadContent); }
private void tlbClear_Click(object sender, EventArgs e) { ClearHeaderContent(); ClearPOLineTrans(); dataGridView2.Rows.Clear(); dataGridView2.ReadOnly = true; txtFilePath.Clear(); cmdSheet.DataSource = null; this.HeadContent = new StoreInPlanHeadModel(); this.ModelClone = new StoreInPlanHeadModel(); HeadContent.StoreInFlag = null; HeadContent.InvoiceDate = DateTime.Now; HeadContent.ETADate = DateTime.Now; HeadContent.ETDDate = DateTime.Now; ModelClone = (StoreInPlanHeadModel)HeadContent.Clone(); LockHeaderControl(); }