Esempio n. 1
0
        public int Delete(TC_OA_SmallGoodsDetailModel ObjModel)
        {
            int num = 0;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                connection.Open();
                SqlTransaction transaction = connection.BeginTransaction();
                try
                {
                    try
                    {
                        num = new TC_OA_SmallGoodsDetailBLL().Delete(ObjModel.Code, transaction);
                        transaction.Commit();
                    }
                    catch (SqlException exception)
                    {
                        transaction.Rollback();
                        connection.Close();
                        throw exception;
                    }
                    return(num);
                }
                finally
                {
                    connection.Close();
                }
            }
            return(num);
        }
Esempio n. 2
0
        public TC_OA_SmallGoodsDetailModel GetTC_OA_SmallGoodsDetail(int Code)
        {
            TC_OA_SmallGoodsDetailModel model = new TC_OA_SmallGoodsDetailModel();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    model = new TC_OA_SmallGoodsDetailBLL().GetModel(Code, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(model);
        }
Esempio n. 3
0
        public int Update(TC_OA_SmallGoodsDetailModel ObjModel, SqlTransaction Transaction)
        {
            TC_OA_SmallGoodsDetailDAL ldal = new TC_OA_SmallGoodsDetailDAL(Transaction);

            return(ldal.Update(ObjModel));
        }