Example #1
0
        private void frmVendorPriceLst_Load(object sender, EventArgs e)
        {
            dgvVendorPriceLst.AutoGenerateColumns = false;

            objBASEFILEDS.HTMAIN.Clear();
            objBASEFILEDS.dsBASEFIELDMAIN = objDBAdaper.dsquery("select * from " + objBASEFILEDS.Main_tbl_nm + " where 1=2");
            AddToHashTB(objBASEFILEDS.dsBASEFIELDMAIN, objBASEFILEDS.HTMAIN);

            objBASEFILEDS.htitem_details.Clear();
            objBASEFILEDS.dsBASEFIELDITEM = objDBAdaper.dsquery("select * from " + objBASEFILEDS.Item_tbl_nm + " where 1=2");
            AddToHashTB(objBASEFILEDS.dsBASEFIELDITEM, objBASEFILEDS.htitem_details);

            GetAdditionalFieldsDetails();

            foreach (DataGridViewColumn col in dgvVendorPriceLst.Columns)
            {
                if (col.Name == "prod_nm")
                {
                    POPUPTEXTBOX_FOR_GRID txtcol = (POPUPTEXTBOX_FOR_GRID)col;
                    txtcol.Dispddlfields = "prod_nm;Product Name";
                    txtcol.Primaryddl    = "prod_cd,prod_nm";
                    txtcol.Query_con     = "";
                    txtcol.Tbl_nm        = "PT_MAST";
                }
                if (col.Name == "rate")
                {
                    dgvVendorPriceLst.Columns[col.Name].Tag = "decimal";
                }
                else
                {
                    dgvVendorPriceLst.Columns[col.Name].Tag = "string";
                }
            }

            DisplayControlsonMode(objBASEFILEDS.Tran_mode);
            AddThemesToTitleBar((Form)this, ucToolBar1, objBASEFILEDS, "CustomMaster");
            AddTextBoxEvent();
        }
Example #2
0
 private void txt_key_down(object sender, KeyEventArgs e)
 {
     try
     {
         TextBox txt = (TextBox)sender;
         if (e.KeyData == Keys.F2)
         {
             POPUPTEXTBOX_FOR_GRID dgvVendorPriceLstcolumncod = (POPUPTEXTBOX_FOR_GRID)dgvVendorPriceLst.Columns[dgvVendorPriceLst.CurrentCell.ColumnIndex];
             frmPopup objfrmPopup = new frmPopup(((Hashtable)objBASEFILEDS.HTITEM[(dgvVendorPriceLst.CurrentRow.Cells["PTSERIAL"].Value)]), dgvVendorPriceLstcolumncod.Tbl_nm, dgvVendorPriceLstcolumncod.Reftbltran_cd, dgvVendorPriceLstcolumncod.Primaryddl, dgvVendorPriceLstcolumncod.Dispddlfields, "Please select", dgvVendorPriceLstcolumncod.Query_con, dgvVendorPriceLstcolumncod.IsQcd, dgvVendorPriceLstcolumncod.QcdCondition);
             //objfrmPopup.objCompany = objBASEFILEDS.ObjCompany;
             //objfrmPopup.objControlSet = objBASEFILEDS.ObjControlSet;
             objfrmPopup.ObjBFD = objBASEFILEDS;
             objfrmPopup.ShowDialog();
             txt.Text = ((Hashtable)objBASEFILEDS.HTITEM[(dgvVendorPriceLst.CurrentRow.Cells["PTSERIAL"].Value)])[txt.Name].ToString().Trim();
             foreach (string str in dgvVendorPriceLstcolumncod.Primaryddl.Split(','))
             {
                 dgvVendorPriceLst.CurrentRow.Cells[str].Value = ((Hashtable)objBASEFILEDS.HTITEM[(dgvVendorPriceLst.CurrentRow.Cells["PTSERIAL"].Value)])[str];
             }
         }
     }
     catch (Exception ex)
     {
     }
 }