Example #1
0
        public int Delete(TC_OA_SmallGoodsModel ObjModel)
        {
            int num = 0;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                connection.Open();
                SqlTransaction transaction = connection.BeginTransaction();
                try
                {
                    try
                    {
                        num = new TC_OA_SmallGoodsBLL().Delete(ObjModel.Code, transaction);
                        transaction.Commit();
                    }
                    catch (SqlException exception)
                    {
                        transaction.Rollback();
                        connection.Close();
                        throw exception;
                    }
                    return(num);
                }
                finally
                {
                    connection.Close();
                }
            }
            return(num);
        }
Example #2
0
        public List <TC_OA_SmallGoodsModel> GetTC_OA_SmallGoodsList(string SortColumns, int StartRecord, int MaxRecords, int CodeEqual, string UserCodeEqual, string UnitCodeEqual, DateTime ApplayDateEqual, string NameEqual, string UseWayEqual, string TypeEqual, string GoodsCodeEqual, int AuditingEqual)
        {
            List <TC_OA_SmallGoodsModel> models        = new List <TC_OA_SmallGoodsModel>();
            TC_OA_SmallGoodsQueryModel   objQueryModel = new TC_OA_SmallGoodsQueryModel();

            objQueryModel.StartRecord     = StartRecord;
            objQueryModel.MaxRecords      = MaxRecords;
            objQueryModel.SortColumns     = SortColumns;
            objQueryModel.CodeEqual       = CodeEqual;
            objQueryModel.UserCodeEqual   = UserCodeEqual;
            objQueryModel.UnitCodeEqual   = UnitCodeEqual;
            objQueryModel.ApplayDateEqual = ApplayDateEqual;
            objQueryModel.NameEqual       = NameEqual;
            objQueryModel.UseWayEqual     = UseWayEqual;
            objQueryModel.TypeEqual       = TypeEqual;
            objQueryModel.GoodsCodeEqual  = GoodsCodeEqual;
            objQueryModel.AuditingEqual   = AuditingEqual;
            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    models = new TC_OA_SmallGoodsBLL().GetModels(objQueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Example #3
0
        public TC_OA_SmallGoodsModel GetTC_OA_SmallGoods(int Code)
        {
            TC_OA_SmallGoodsModel model = new TC_OA_SmallGoodsModel();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    model = new TC_OA_SmallGoodsBLL().GetModel(Code, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(model);
        }
Example #4
0
        public List <TC_OA_SmallGoodsModel> GetTC_OA_SmallGoodsListOne(int Code)
        {
            List <TC_OA_SmallGoodsModel> list = new List <TC_OA_SmallGoodsModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    TC_OA_SmallGoodsBLL sbll = new TC_OA_SmallGoodsBLL();
                    list.Add(sbll.GetModel(Code, connection));
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(list);
        }
Example #5
0
        public List <TC_OA_SmallGoodsModel> GetTC_OA_SmallGoodsList(TC_OA_SmallGoodsQueryModel QueryModel)
        {
            List <TC_OA_SmallGoodsModel> models = new List <TC_OA_SmallGoodsModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    if (QueryModel == null)
                    {
                        QueryModel = new TC_OA_SmallGoodsQueryModel();
                    }
                    models = new TC_OA_SmallGoodsBLL().GetModels(QueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }