Beispiel #1
0
        private List <PRODUCT_BUILD> MapPRODUCT_BUILD(DataTable dt)
        {
            List <PRODUCT_BUILD> rs = new List <PRODUCT_BUILD>();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                PRODUCT_BUILD obj = new PRODUCT_BUILD();
                if (dt.Columns.Contains("ProductID"))
                {
                    obj.ProductID = dt.Rows[i]["ProductID"].ToString();
                }
                if (dt.Columns.Contains("BuildID"))
                {
                    obj.BuildID = dt.Rows[i]["BuildID"].ToString();
                }
                if (dt.Columns.Contains("Quantity"))
                {
                    obj.Quantity = double.Parse(dt.Rows[i]["Quantity"].ToString());
                }
                if (dt.Columns.Contains("Price"))
                {
                    obj.Price = double.Parse(dt.Rows[i]["Price"].ToString());
                }
                if (dt.Columns.Contains("Amount"))
                {
                    obj.Amount = double.Parse(dt.Rows[i]["Amount"].ToString());
                }
                rs.Add(obj);
            }
            return(rs);
        }
Beispiel #2
0
 public int PRODUCT_BUILD_Insert(PRODUCT_BUILD obj)
 {
     try
     {
         return(DataProvider.ExecuteNonquery(DataProvider.ConnectionString, "PRODUCT_BUILD_Insert",
                                             obj.ProductID,
                                             obj.BuildID,
                                             obj.Quantity,
                                             obj.Price,
                                             obj.Amount
                                             ));
     }
     catch
     {
         //throw ex;
         return(-1);
     }
 }
Beispiel #3
0
 public int PRODUCT_BUILD_Update(PRODUCT_BUILD obj, string ProductID, string BuildID)
 {
     try
     {
         return(DataProvider.ExecuteNonquery(DataProvider.ConnectionString, "PRODUCT_BUILD_Update",
                                             ProductID,
                                             BuildID,
                                             obj.Quantity,
                                             obj.Price,
                                             obj.Amount
                                             ));
     }
     catch
     {
         //throw ex;
         return(-1);
     }
 }