Ejemplo n.º 1
0
 /// <summary>
 /// update a warehouseinoutform
 /// <summary>
 /// <param name=id>id</param>
 /// <param name=mod>model object of warehouseinoutform</param>
 /// <param name=out emsg>return error message</param>
 /// <returns>true/false</returns>
 public bool Update(int id, modWarehouseInoutForm mod, out string emsg)
 {
     try
     {
         dalWarehouseInoutType daltype = new dalWarehouseInoutType();
         modWarehouseInoutType modtype = daltype.GetItem(mod.InoutType, out emsg);
         string sql = string.Format("update warehouse_inout_form set inout_type='{0}',inout_flag={1},inout_date='{2}',status={3},warehouse_id='{4}',product_id='{5}',product_name='{6}',size={7},qty={8},price={9},remark='{10}',no='{11}',price_status={12} where id={13}", mod.InoutType, modtype.InoutFlag, mod.InoutDate, mod.Status, mod.WarehouseId, mod.ProductId, mod.ProductName, mod.Size, mod.Qty, mod.CostPrice, mod.Remark, mod.No, 0, id);
         int    i   = SqlHelper.ExecuteNonQuery(sql);
         if (i > 0)
         {
             emsg = null;
             return(true);
         }
         else
         {
             emsg = "Unknown error when ExecuteNonQuery!";
             return(false);
         }
     }
     catch (Exception ex)
     {
         emsg = dalUtility.ErrorMessage(ex.Message);
         return(false);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// insert a warehouseinoutform
 /// <summary>
 /// <param name=mod>model object of warehouseinoutform</param>
 /// <param name=out emsg>return error message</param>
 /// <returns>true/false</returns>
 public bool Insert(modWarehouseInoutForm mod, out string emsg)
 {
     try
     {
         dalWarehouseInoutType daltype = new dalWarehouseInoutType();
         modWarehouseInoutType modtype = daltype.GetItem(mod.InoutType, out emsg);
         string sql = string.Format("insert into warehouse_inout_form(inout_type,inout_flag,inout_date,status,warehouse_id,product_id,product_name,size,qty,price,remark,update_user,update_time,no)values('{0}',{1},'{2}',{3},'{4}','{5}','{6}',{7},{8},{9},'{10}','{11}',getdate(),'{12}')", mod.InoutType, modtype.InoutFlag, mod.InoutDate, mod.Status, mod.WarehouseId, mod.ProductId, mod.ProductName, mod.Size, mod.Qty, mod.CostPrice, mod.Remark, mod.UpdateUser, mod.No);
         int    i   = SqlHelper.ExecuteNonQuery(sql);
         if (i > 0)
         {
             emsg = null;
             return(true);
         }
         else
         {
             emsg = "Unknown error when ExecuteNonQuery!";
             return(false);
         }
     }
     catch (Exception ex)
     {
         emsg = dalUtility.ErrorMessage(ex.Message);
         return(false);
     }
 }