Ejemplo n.º 1
0
 public DsPurchase.PURCHASEREQUESTDataTable GetPurchaseRequestList(string company=null,bool inpo=false)
 {
     var ds = new DsPurchase().PURCHASEREQUEST;
     var ta = new PURCHASEREQUESTTableAdapter { Connection = { ConnectionString = _constr } };
     if (!inpo)
     {
         if (company == null)
         {
             ta.Fill(ds);
         }
         else
         {
             ta.FillByComp(ds, company);
         }
     }
     if (inpo)
         ta.FillByNotInPO(ds);
     return ds;
 }
Ejemplo n.º 2
0
 public string DoSave()
 {
     string retval = "0";
     SqlTransaction tran = null;
     try
     {
         var cn = new SqlConnection(_constr);
         cn.Open();
         tran = cn.BeginTransaction(IsolationLevel.ReadUncommitted);
         var ds = new DsPurchase();
         var dt = ds.PURCHASEREQUEST;
         var taPurMain = new  PURCHASEREQUESTTableAdapter();
         taPurMain.Connection.ConnectionString = _constr;
         taPurMain.Fill(dt);
         taPurMain.AssignConnection(cn,tran);
         taPurMain.Update(Purchaserequest);
         tran.Commit();
         retval = "1";
     }
     catch (Exception ex)
     {
         if (tran != null)
             tran.Rollback();
         retval = ex.ToString();
     }
     return retval;
 }