Ejemplo n.º 1
0
        public int Update(YF_AssetMainApplyModel ObjModel)
        {
            int num = 0;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                connection.Open();
                SqlTransaction transaction = connection.BeginTransaction();
                try
                {
                    try
                    {
                        num = new YF_AssetMainApplyBLL().Update(ObjModel, transaction);
                        transaction.Commit();
                    }
                    catch (SqlException exception)
                    {
                        transaction.Rollback();
                        connection.Close();
                        throw exception;
                    }
                    return(num);
                }
                finally
                {
                    connection.Close();
                }
            }
            return(num);
        }
Ejemplo n.º 2
0
        public int ModifyNotPassAuditing(int Code)
        {
            int num = 0;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                connection.Open();
                SqlTransaction transaction = connection.BeginTransaction();
                try
                {
                    try
                    {
                        num = new YF_AssetMainApplyBLL().ModifyNotPassAuditing(Code, transaction);
                        transaction.Commit();
                    }
                    catch (SqlException exception)
                    {
                        transaction.Rollback();
                        connection.Close();
                        throw exception;
                    }
                    return(num);
                }
                finally
                {
                    connection.Close();
                }
            }
            return(num);
        }
Ejemplo n.º 3
0
        public List <YF_AssetMainApplyModel> GetYF_AssetMainApplyList(string SortColumns, int StartRecord, int MaxRecords, int CodeEqual, int ManageCodeEqual, string UserCodeEqual, string DeptEqual, string ApplyDateEqual, string ReasonEqual, string RemarkEqual, string StatusEqual)
        {
            List <YF_AssetMainApplyModel> models        = new List <YF_AssetMainApplyModel>();
            YF_AssetMainApplyQueryModel   objQueryModel = new YF_AssetMainApplyQueryModel();

            objQueryModel.StartRecord     = StartRecord;
            objQueryModel.MaxRecords      = MaxRecords;
            objQueryModel.SortColumns     = SortColumns;
            objQueryModel.CodeEqual       = CodeEqual;
            objQueryModel.ManageCodeEqual = ManageCodeEqual;
            objQueryModel.UserCodeEqual   = UserCodeEqual;
            objQueryModel.DeptEqual       = DeptEqual;
            objQueryModel.ApplyDateEqual  = ApplyDateEqual;
            objQueryModel.ReasonEqual     = ReasonEqual;
            objQueryModel.RemarkEqual     = RemarkEqual;
            objQueryModel.StatusEqual     = StatusEqual;
            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    models = new YF_AssetMainApplyBLL().GetModels(objQueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Ejemplo n.º 4
0
        public YF_AssetMainApplyModel GetYF_AssetMainApply(int Code)
        {
            YF_AssetMainApplyModel model = new YF_AssetMainApplyModel();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    model = new YF_AssetMainApplyBLL().GetModel(Code, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(model);
        }
Ejemplo n.º 5
0
        public List <YF_AssetMainApplyModel> GetYF_AssetMainApplyListOne(int Code)
        {
            List <YF_AssetMainApplyModel> list = new List <YF_AssetMainApplyModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    YF_AssetMainApplyBLL ybll = new YF_AssetMainApplyBLL();
                    list.Add(ybll.GetModel(Code, connection));
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(list);
        }
Ejemplo n.º 6
0
        public List <YF_AssetMainApplyModel> GetYF_AssetMainApplyList(YF_AssetMainApplyQueryModel QueryModel)
        {
            List <YF_AssetMainApplyModel> models = new List <YF_AssetMainApplyModel>();

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