public static INProductClass1 Class1toInfo(DataRow dr)
 {
     INProductClass1 info = new INProductClass1();
     info.VendID = dr["VendID"].ToString();
     info.ClassID1 = dr["ClassID1"].ToString();
     info.POUnit = dr["POUnit"].ToString();
     info.SOUnit = dr["SOUnit"].ToString();
     info.DfltTaxID = dr["DfltTaxID"].ToString();
     info.DfltWhID = dr["DfltWhID"].ToString();
     return info;
 }
 public static int SaveINProductClass1(INProductClass1 info)
 {
     return ConnectDB.ExecuteScalar("sp_INProductClass1Save",
         new String[] {
                         "VendID",
                         "ClassID1",
                         "Descr",
                         "DfltTaxID",
                         "DfltWhID",
                         "POUnit",
                         "SOUnit",
                         "INUnit",
             "Crtd_DateTime", "Crtd_Prog", "Crtd_User", "LUpd_DateTime", "LUpd_Prog", "LUpd_User" },
         new Object[] {
                     info.VendID,
                     info.ClassID1,
                     info.Descr,
                     info.DfltTaxID,
                     info.DfltWhID,
                     info.POUnit,
                     info.SOUnit,
                     info.INUnit,
             info.Crtd_DateTime, info.Crtd_Prog, info.Crtd_User, info.LUpd_DateTime, info.LUpd_Prog, info.LUpd_User });
 }
 private void _SetClass1ToPanel(INProductClass1 info)
 {
     txtDfltWhID.Text = info.DfltWhID;
     txtTaxID.Text = info.DfltTaxID;
     txtPOUnit.Text = info.POUnit;
     txtSOUnit.Text = info.SOUnit;
     txtVendID.Text = info.VendID;
 }
 private INProductClass1 _GetClass1Info(string classid)
 {
     INProductClass1 productclass1 = new INProductClass1();
     DataRow[] dr = _dtINProductClass1.Select("ClassID1 = '" + classid + "'");
     if (dr.Count() > 0)
         productclass1 = IN106Ctrl.Class1toInfo(dr[0]);
     else
         productclass1 = null;
     return productclass1;
 }
        private void txtClassID1_TextChanged(object sender, EventArgs e)
        {
            string text = txtClassID1.Text.Trim();
            if (text != "")
            {
                INProductClass1 class1 = new INProductClass1();
                class1 = _GetClass1Info(text);
                if (class1 != null)
                {
                    _SetClass1ToPanel(class1);
                }

            }
        }