public void ShowLookupForm() { FrmLookup_LookupHide(null, null); frmLookup = new LookupForm(); switch (lookupColName) { case QUOTATIONITEMS.PRODUCT_ID: { frmLookup.LookupColNames = new string[] { PRODUCT.PRODUCT_NAME }; frmLookup.SelectedPkValue = editgrid[QUOTATIONITEMS.PRODUCT_ID, lookupRow].Value; frmLookup.AllowNewEntry = true; frmLookup.AllowEmptySelection = true; if (txt_party_id.Text != "") { frmLookup.LookupList = CProduct_exten.GetforLookup(new DAL()); frmLookup.LoadLookupList(); } } break; case QUOTATIONITEMS.SIZES_ID: frmLookup.LookupColNames = new string[] { SIZES.SIZES_NAME }; frmLookup.SelectedPkValue = editgrid[QUOTATIONITEMS.SIZES_ID, lookupRow].Value; frmLookup.AllowNewEntry = true; frmLookup.AllowEmptySelection = true; frmLookup.LookupList = CSizes_exten.GetforLookup(new DAL()); 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 ShowLookupForm() { FrmLookup_LookupHide(null, null); frmLookup = new LookupForm(); switch (lookupColName) { //case PURCHASEITEMS.PO_ID: // { // if (Customise.Purchase_poid_dcid == true) // { // frmLookup.LookupColNames = new string[] { PO.PO_NO, DC.DC_NO, DCITEMS.PRODUCT_ID, DCITEMS.QTY, DCITEMS.REFERED_QTY, POITEMS.PRICE }; // frmLookup.SelectedPkValue = editgrid[PURCHASEITEMS.PO_ID, lookupRow].Value; // frmLookup.AllowNewEntry = true; // frmLookup.AllowEmptySelection = true; // // // if (txt_party_id.Text != "") // { // frmLookup.LookupList = CPo_lookup.LookupbyPono(txt_party_id.Text); // //frmLookup.LookupList = CPo_lookup.LookupPObyPartyforPurchase(CParty_exten.GetId_Name(txt_party_id.Text)); // frmLookup.LoadLookupList(); // } // // // } // } // break; //// //case PURCHASEITEMS.DC_ID: // { // if (Customise.Purchase_poid_dcid == true) // { // frmLookup.LookupColNames = new string[] { DC.DC_NO, DCITEMS.PRODUCT_ID, DCITEMS.QTY, DCITEMS.REFERED_QTY, POITEMS.PRICE }; // frmLookup.SelectedPkValue = editgrid[PURCHASEITEMS.DC_ID, lookupRow].Value; // frmLookup.AllowNewEntry = true; // frmLookup.AllowEmptySelection = true; // // // if (txt_party_id.Text != "") // { // if (editgrid[DCITEMS.PO_ID, lookupRow].Value != null) // { // if (editgrid[DCITEMS.PO_ID, lookupRow].Value.ToString() != "") // { // if (editgrid[DCITEMS.PO_ID, lookupRow].Value.ToString() != Core.Without_Po) // { } // else // { // frmLookup.LookupList = CDc_Lookup.LookupDC_Party_forPurchase(CParty_exten.GetId_Name(txt_party_id.Text)); // frmLookup.LoadLookupList(); // } // } // else // { // frmLookup.LookupList = CDc_Lookup.LookupDC_Party_forPurchase(CParty_exten.GetId_Name(txt_party_id.Text)); // frmLookup.LoadLookupList(); // } // } // else // { // frmLookup.LookupList = CDc_Lookup.LookupDC_Party_forPurchase(CParty_exten.GetId_Name(txt_party_id.Text)); // frmLookup.LoadLookupList(); // } // } // // // } // } // break; case PURCHASEITEMS.PRODUCT_ID: { frmLookup.LookupColNames = new string[] { PRODUCT.PRODUCT_NAME }; frmLookup.SelectedPkValue = editgrid[PURCHASEITEMS.PRODUCT_ID, lookupRow].Value; frmLookup.AllowNewEntry = true; frmLookup.AllowEmptySelection = true; if (txt_party_id.Text != "") { //if (Customise.Purchase_poid_dcid == true) //{ // if (editgrid[DCITEMS.PO_ID, lookupRow].Value != null) // { // if (editgrid[DCITEMS.DC_ID, lookupRow].Value != null) // { // if (editgrid[DCITEMS.PO_ID, lookupRow].Value.ToString() == Core.Without_Po) // { // if (editgrid[DCITEMS.DC_ID, lookupRow].Value.ToString() == Core.Without_Dc) // { // frmLookup.LookupList = CProduct_exten.GetforLookup(new DAL()); // frmLookup.LoadLookupList(); // } // } // } // else // { // frmLookup.LookupList = CProduct_exten.GetforLookup(new DAL()); // frmLookup.LoadLookupList(); // } // } // else // { frmLookup.LookupList = CProduct_exten.GetforLookup(new DAL()); frmLookup.LoadLookupList(); //} // } //if ((Customise.Purchase_pono_dcno == true) || (Customise.Purchase_Without_podc == true)) //{ // frmLookup.LookupList = CProduct_exten.GetforLookup(new DAL()); // 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); }
void Txt_product_LookupUpdate(object sender, EventArgs e) { txt_product_id.LookupList = CProduct_exten.GetforLookup(new DAL()); }
public void ShowLookupForm() { FrmLookup_LookupHide(null, null); frmLookup = new LookupForm(); switch (lookupColName) { case UPVC_INVOICEITEMS.PRODUCT_ID: { frmLookup.LookupColNames = new string[] { PRODUCT.PRODUCT_NAME }; frmLookup.SelectedPkValue = editgrid[UPVC_INVOICEITEMS.PRODUCT_ID, lookupRow].Value; frmLookup.AllowNewEntry = true; frmLookup.AllowEmptySelection = true; if (txt_party_id.Text != "") { frmLookup.LookupList = CProduct_exten.GetforLookup(new DAL()); frmLookup.LoadLookupList(); } } break; case UPVC_INVOICEITEMS.PCRATE: { frmLookup.LookupColNames = new string[] { UPVC_INVOICEITEMS.PCRATE }; frmLookup.SelectedPkValue = editgrid[UPVC_INVOICEITEMS.PCRATE, lookupRow].Value; frmLookup.AllowNewEntry = false; frmLookup.AllowEmptySelection = true; DataTable dt = new DataTable(); dt.Columns.Add(UPVC_INVOICEITEMS.PCRATE); dt.Rows.Add(Core.InSqFt); dt.Rows.Add(Core.Inpcsrate); if (txt_party_id.Text != "") { frmLookup.LookupList = dt; frmLookup.LoadLookupList(); } } break; case UPVC_INVOICEITEMS.MSM: { frmLookup.LookupColNames = new string[] { UPVC_INVOICEITEMS.MSM }; frmLookup.SelectedPkValue = editgrid[UPVC_INVOICEITEMS.MSM, lookupRow].Value; frmLookup.AllowNewEntry = false; frmLookup.AllowEmptySelection = true; DataTable dt1 = new DataTable(); dt1.Columns.Add(UPVC_INVOICEITEMS.MSM); dt1.Rows.Add(Core.InMM); dt1.Rows.Add(Core.InInch); if (txt_party_id.Text != "") { frmLookup.LookupList = dt1; 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); }