public void ShowLookupForm() { FrmLookup_LookupHide(null, null); frmLookup = new LookupForm(); switch (lookupColName) { case INWARDITEMS.STYLE_ID: frmLookup.LookupColNames = new string[] { STYLE.STYLE_NO }; frmLookup.SelectedPkValue = editgrid[INWARDITEMS.STYLE_ID, lookupRow].Value; frmLookup.AllowNewEntry = true; frmLookup.AllowEmptySelection = true; frmLookup.LookupList = CStyle_exten.LookupNo(); frmLookup.LoadLookupList(); break; case INWARDITEMS.ARTICLE_ID: frmLookup.LookupColNames = new string[] { ARTICLE.ARTICLE_NO }; frmLookup.SelectedPkValue = editgrid[INWARDITEMS.ARTICLE_ID, lookupRow].Value; frmLookup.AllowNewEntry = true; frmLookup.AllowEmptySelection = true; frmLookup.LookupList = CArticle_exten.GetforLookup(); frmLookup.LoadLookupList(); break; default: throw new Exception("'" + lookupColName + "' Not Found"); } frmLookup.LookupSelected += new EventHandler(FrmLookup_LookupSelected); frmLookup.AfterSelection += new EventHandler(FrmLookup_AfterSelection); frmLookup.LookupHide += new EventHandler(FrmLookup_LookupHide); frmLookup.NewEntryNeeded += new LookupForm.NewEntryHandler(FrmLookup_NewEntryNeeded); frmLookup.Owner = this.FindForm(); ////////// frmLookup.Show(); ////////// int vWidth = frmLookup.GetAutoWidth(); int vCellWidth = editgrid.Columns[lookupColName].Width; if (vWidth < vCellWidth) { vWidth = vCellWidth; } frmLookup.AutoFillLastColumn(); int vHeight = frmLookup.GetAutoHeight(); Rectangle screenRect = Global.GetScreenRect(editgrid); frmLookup.Bounds = Global.GetSnapRect(screenRect, vWidth, vHeight); }
public void List_Option(ListOption action) { fAction = action; switch (fAction) { case ListOption.active: if (chk_notactive.Checked == true) { LoadData(CArticle_exten.NotActive()); } else { LoadData(CArticle_exten.Active()); } break; case ListOption.notactive: if (chk_notactive.Checked == true) { LoadData(CArticle_exten.NotActive()); } else { LoadData(CArticle_exten.Active()); } break; case ListOption.Search: if (txt_article_no.Text != "") { List <Article> list = new List <Article> { CArticle_exten.SearchName(txt_article_no.Text) }; LoadData(list); } else { LoadData(CArticle_exten.Active()); } break; default: LoadData(CArticle_exten.Active()); break; } }
private List <Outwarditems> Collectitems(string vId) { List <Outwarditems> list = new List <Outwarditems>(); for (int r = 0; r < editgrid.RowCount; r++) { Outwarditems obj = new Outwarditems(); if ( (editgrid[OUTWARDITEMS.PRODUCT_ID, r].Value + "") == "" || (editgrid[OUTWARDITEMS.COLOURS_ID, r].Value + "") == "" || (editgrid[OUTWARDITEMS.SIZES_ID, r].Value + "") == "" || (editgrid[OUTWARDITEMS.QTY, r].Value + "") == "" ) { //==LEAVE IT(the empty row). } else { obj.Outwarditems_id = ""; obj.Outward_id = vId; obj.Style_id = CStyle_exten.GetId_Name(Checks.Escape(editgrid[OUTWARDITEMS.STYLE_ID, r].Value + "")); obj.Article_id = CArticle_exten.GetId_Name(Checks.Escape(editgrid[OUTWARDITEMS.ARTICLE_ID, r].Value + "")); obj.Product_id = CProduct_exten.GetId_Name(Checks.Escape(editgrid[OUTWARDITEMS.PRODUCT_ID, r].Value + "")); obj.Sizes_id = CSizes_exten.GetId_Name(editgrid[OUTWARDITEMS.SIZES_ID, r].Value + ""); obj.Colours_id = CColours_exten.GetId_Name(editgrid[OUTWARDITEMS.COLOURS_ID, r].Value + ""); obj.Qty = (editgrid[OUTWARDITEMS.QTY, r].Value + ""); //obj.Refered_id = ""; obj.Locked = Core.Unlocked; list.Add(obj); } } if (list.Count != 0) { return(list); } return(null); }
private List <Styleitems> Collectitems(string vId) { List <Styleitems> list = new List <Styleitems>(); for (int r = 0; r < editgrid.RowCount; r++) { Styleitems obj = new Styleitems(); if ( (editgrid[STYLEITEMS.PRODUCT_ID, r].Value + "") == "" || (editgrid[STYLEITEMS.QTY, r].Value + "") == "" || (editgrid[STYLEITEMS.PRICE, r].Value + "") == "" ) { //==LEAVE IT(the empty row). } else { obj.Styleitems_id = ""; obj.Style_id = vId; obj.Style_no = txt_style_no.Text; obj.Article_id = CArticle_exten.GetId_Name(editgrid[STYLEITEMS.ARTICLE_ID, r].Value + ""); obj.Product_id = CProduct_exten.GetId_Name(editgrid[STYLEITEMS.PRODUCT_ID, r].Value + ""); obj.Colours_id = CColours_exten.GetId_Name(editgrid[STYLEITEMS.COLOURS_ID, r].Value + ""); obj.Sizes_id = CSizes_exten.GetId_Name(editgrid[STYLEITEMS.SIZES_ID, r].Value + ""); obj.Qty = (editgrid[STYLEITEMS.QTY, r].Value + ""); obj.Price = ConvertTO.Decimal(editgrid[STYLEITEMS.PRICE, r].Value + ""); obj.Refered_id = ""; obj.Locked = Core.Unlocked; list.Add(obj); } } if (list.Count != 0) { return(list); } return(null); }
public void SetAction(BtnEvent action, string pk) { fAction = action; switch (fAction) { case BtnEvent.Open: btn_save.Text = "&CLOSE"; obj = CArticle_exten.PKId(pk); this.EnableControls(false); break; case BtnEvent.New: btn_save.Text = "&SAVE"; obj = CArticle.GetNew; this.EnableControls(true); break; case BtnEvent.Edit: btn_save.Text = "&UPDATE"; obj = CArticle_exten.PKId(pk); this.EnableControls(true); break; case BtnEvent.Delete: btn_save.Text = "CONFIRM\r\n&DELETE"; obj = CArticle_exten.PKId(pk); this.EnableControls(false); break; case BtnEvent.Print: btn_save.Text = "&PRINT"; obj = CArticle_exten.PKId(pk); this.EnableControls(false); break; } this.LoadData(); }
void txt_article_LookupUpdate(object sender, EventArgs e) { txt_article_no.LookupList = CArticle_exten.GetforLookup(); }
public void ShowLookupForm() { FrmLookup_LookupHide(null, null); frmLookup = new LookupForm(); switch (lookupColName) { case STYLEITEMS.ARTICLE_ID: { frmLookup.LookupColNames = new string[] { ARTICLE.ARTICLE_NO, PRODUCT.PRODUCT_NAME, COLOURS.COLOURS_NAME }; frmLookup.SelectedPkValue = editgrid[STYLEITEMS.ARTICLE_ID, lookupRow].Value; frmLookup.AllowNewEntry = true; frmLookup.AllowEmptySelection = true; if (txt_style_no.Text != "") { frmLookup.LookupList = CArticle_exten.GetforLookup(); frmLookup.LoadLookupList(); } } break; case STYLEITEMS.PRODUCT_ID: { frmLookup.LookupColNames = new string[] { PRODUCT.PRODUCT_NAME }; frmLookup.SelectedPkValue = editgrid[STYLEITEMS.PRODUCT_ID, lookupRow].Value; frmLookup.AllowNewEntry = true; frmLookup.AllowEmptySelection = true; if (txt_style_no.Text != "") { frmLookup.LookupList = CProduct_exten.GetforLookup(new DAL()); frmLookup.LoadLookupList(); } } break; case STYLEITEMS.COLOURS_ID: { frmLookup.LookupColNames = new string[] { COLOURS.COLOURS_NAME }; frmLookup.SelectedPkValue = editgrid[STYLEITEMS.COLOURS_ID, lookupRow].Value; frmLookup.AllowNewEntry = true; frmLookup.AllowEmptySelection = true; if (txt_style_no.Text != "") { frmLookup.LookupList = CColours_exten.GetforLookup(); frmLookup.LoadLookupList(); } } break; case STYLEITEMS.SIZES_ID: { frmLookup.LookupColNames = new string[] { SIZES.SIZES_NAME }; frmLookup.SelectedPkValue = editgrid[STYLEITEMS.SIZES_ID, lookupRow].Value; frmLookup.AllowNewEntry = true; frmLookup.AllowEmptySelection = true; if (txt_style_no.Text != "") { frmLookup.LookupList = CSizes_exten.GetforLookup(new DAL()); frmLookup.LoadLookupList(); } } break; default: throw new System.Exception("'" + lookupColName + "' Not Found"); } frmLookup.LookupSelected += new EventHandler(FrmLookup_LookupSelected); frmLookup.AfterSelection += new EventHandler(FrmLookup_AfterSelection); frmLookup.LookupHide += new EventHandler(FrmLookup_LookupHide); frmLookup.NewEntryNeeded += new LookupForm.NewEntryHandler(FrmLookup_NewEntryNeeded); frmLookup.Owner = this.FindForm(); ////////// frmLookup.Show(); ////////// int vWidth = frmLookup.GetAutoWidth(); int vCellWidth = editgrid.Columns[lookupColName].Width; if (vWidth < vCellWidth) { vWidth = vCellWidth; } frmLookup.AutoFillLastColumn(); int vHeight = frmLookup.GetAutoHeight(); Rectangle screenRect = Global.GetScreenRect(editgrid); frmLookup.Bounds = Global.GetSnapRect(screenRect, vWidth, vHeight); }