示例#1
0
 public bool AddProductItem(string productID, string productName
                            , string produceDate, string productCategory
                            , string descript)
 {
     try
     {
         int result = int.Parse(DbOperate.ExecuteNonQuery(SqlInsertItem
                                                          , new object[5]
         {
             productID
             , productName
             , produceDate
             , productCategory
             , descript
         }).ToString());
         if (result > 0)
         {
             return(true);
         }
     }
     catch (System.Exception ex)
     {
         MessageBox.Show("添加数据时出现错误:" + ex.Message);
     }
     return(false);
 }
示例#2
0
        public DataTable GetProductInfoTable(string productID)
        {
            DataSet ds = null;

            try
            {
                ds = DbOperate.ExecuteDataSet(
                    sqlSelectGetProductInfoByID,
                    new object[1] {
                    productID
                });
                if (ds != null)
                {
                    if (ds.Tables.Count > 0)
                    {
                        return(ds.Tables[0]);
                    }
                }
            }
            catch (System.Exception ex)
            {
                MessageBox.Show("查询数据库时出现错误:" + ex.Message);
            }
            return(null);
        }
示例#3
0
        public DataTable GetProductName()
        {
            DataSet ds = null;

            try
            {
                ds = DbOperate.ExecuteDataSet(sqlSelectGetProductName, null);
                //ds = DbOperate.ExecuteDataSet(
                //          ConfigManager.GetDBConnectString(ConfigManager.GetCurrentDBType()),
                //           sqlSelectGetProductName, null);

                if (ds != null)
                {
                    if (ds.Tables.Count > 0)
                    {
                        return(ds.Tables[0]);
                    }
                }
            }
            catch (System.Exception ex)
            {
                MessageBox.Show("获取产品名称时出现错误:" + ex.Message);
            }
            return(null);
        }
 public bool DeleteOrderInfo()
 {
     try
     {
         int result = int.Parse(DbOperate.ExecuteNonQuery(
                                    sqlDeleteRemoveOrderInfo
                                    , null).ToString());
         if (result > 0)
         {
             return(true);
         }
     }
     catch (System.Exception ex)
     {
         MessageBox.Show("删除数据时出现错误:" + ex.Message);
     }
     return(false);
 }
示例#5
0
 public bool DeleteProductItem(string productID)
 {
     try
     {
         int result = int.Parse(DbOperate.ExecuteNonQuery(sqlDelete
                                                          , new object[1]
         {
             productID
         }).ToString());
         if (result > 0)
         {
             return(true);
         }
     }
     catch (System.Exception ex)
     {
         MessageBox.Show("删除数据时出现错误:" + ex.Message);
     }
     return(false);
 }
示例#6
0
 public bool SetProductInStorage(string productID)
 {
     try
     {
         int result = int.Parse(DbOperate.ExecuteNonQuery(
                                    sqlUpdateChangeStorageStatusToInStorage
                                    , new object[1]
         {
             productID
         }).ToString());
         if (result > 0)
         {
             return(true);
         }
     }
     catch (System.Exception ex)
     {
         MessageBox.Show("入库时出现错误:" + ex.Message);
     }
     return(false);
 }
示例#7
0
 public bool CheckEpcExist(string epc)
 {
     try
     {
         int result = int.Parse(DbOperate.ExecuteNonQuery(
                                    sqlSelectGetEpc
                                    , new object[1]
         {
             epc
         }).ToString());
         if (result > 0)
         {
             return(true);
         }
     }
     catch (System.Exception ex)
     {
         MessageBox.Show("查询数据时出现错误:" + ex.Message);
     }
     return(false);
 }
 public bool ChangeProductStatusforOutInventory(string productID)
 {
     try
     {
         int result = int.Parse(DbOperate.ExecuteNonQuery(
                                    sqlUpdateOutInventory
                                    , new object[1]
         {
             productID
         }).ToString());
         if (result > 0)
         {
             return(true);
         }
     }
     catch (System.Exception ex)
     {
         MessageBox.Show("删除数据时出现错误:" + ex.Message);
     }
     return(false);
 }
        public DataTable GetInStorageProductInfoTable()
        {
            DataSet ds = null;

            try
            {
                ds = DbOperate.ExecuteDataSet(
                    sqlSelectInStorage, null);
                if (ds != null)
                {
                    if (ds.Tables.Count > 0)
                    {
                        return(ds.Tables[0]);
                    }
                }
            }
            catch (System.Exception ex)
            {
                MessageBox.Show("查询数据库时出现错误:" + ex.Message);
            }
            return(null);
        }
示例#10
0
 public bool AddOrderItem(string productName, int productQuantity)
 {
     try
     {
         int result = int.Parse(DbOperate.ExecuteNonQuery(
                                    sqlInsertAddOrderItem
                                    , new object[2]
         {
             productName
             , productQuantity
         }).ToString());
         if (result > 0)
         {
             return(true);
         }
     }
     catch (System.Exception ex)
     {
         MessageBox.Show("添加订单项时出现错误:" + ex.Message);
     }
     return(false);
 }
 public bool InsertProductInfoIntoOutInventory(string productID, string datetime)
 {
     try
     {
         int result = int.Parse(DbOperate.ExecuteNonQuery(
                                    sqlInsertOutInventory
                                    , new object[2]
         {
             datetime
             , productID
         }).ToString());
         if (result > 0)
         {
             return(true);
         }
     }
     catch (System.Exception ex)
     {
         MessageBox.Show("插入数据时出现错误:" + ex.Message);
     }
     return(false);
 }
示例#12
0
        public DataTable GetInStorageProductInventoryByIDs(string productIDs)
        {
            DataSet ds  = null;
            string  cmd = string.Format(sqlSelectGetProductByIDFormat, productIDs);

            try
            {
                ds = DbOperate.ExecuteDataSet(
                    cmd, null);
                if (ds != null)
                {
                    if (ds.Tables.Count > 0)
                    {
                        return(ds.Tables[0]);
                    }
                }
            }
            catch (System.Exception ex)
            {
                MessageBox.Show("查询数据库时出现错误:" + ex.Message);
            }
            return(null);
        }