Ejemplo n.º 1
0
 void LoadGrid(DataRow dr1)
 {
    
     if(dsPurchase1.PURCHASEREQUEST.Rows.Count==0)
     {
         var dm = new DataManager();
         int auto = dm.GetAutoId(16);
         dm.UpdateAutoNum(16);
         auto++;
         prno = dm.CreateFormatedAutoNo(auto);
     }
         var dr = dsPurchase1.PURCHASEREQUEST.NewRow();
         dr["PRNO"] = prno;
         dr["COMPANY"] = Utils.Company;
         if (comboBoxEdit1.SelectedIndex == 0)
         {
             dr["SUPPLIERNO"] = LookupSupplier.EditValue == null ? ClsGetData.GetDefaultSupplier(dr1[0].ToString()) : LookupSupplier.EditValue;
         }
         else
         {
             dr["SUPPLIERNO"] = ClsGetData.GetDefaultSupplier(dr1[0].ToString());
         }
         dr["ITEMNO"] = dr1[0];
         dr["QTY"] = string.IsNullOrEmpty(dr1[3].ToString())? 1 : int.Parse(dr1[3].ToString());
       //dr["REQDATE"] = null;
         dr["CDATE"] = DateTime.Now;
         dr["USERID"] = Utils.Userid;
         dr["INORDER"] = 0;
         dsPurchase1.PURCHASEREQUEST.Rows.Add(dr);
 }
Ejemplo n.º 2
0
        void LoadGrid(DataRow dr1)
        {
            if (boolprno)
            {
                var dm = new DataManager();
                int auto = dm.GetAutoId(16);
                dm.UpdateAutoNum(16);
                auto++;
                prno = dm.CreateFormatedAutoNo(auto);
                boolprno = false;

            }
            var dr = dsPurchase1.PURCHASEREQUEST.NewRow();
            dr["PRNO"] = prno;
            dr["COMPANY"] = Utils.Company;
            dr["SUPPLIERNO"] = dr1["SUPPLIERNO"].ToString();
            dr["ITEMNO"] = dr1["Itemno"];
            if (!string.IsNullOrEmpty(dr1["PURQTY"].ToString()))
            {
                if (int.Parse(dr1["PURQTY"].ToString()) == 0)
                    dr["QTY"] = 1;
                else
                    dr["QTY"] = dr1["PURQTY"];
            }
            else
            {
                dr["QTY"] = 1;
            }
            dr["USERID"] = Utils.Userid;
            dr["INORDER"] = 0;
            dsPurchase1.PURCHASEREQUEST.Rows.Add(dr);

        }