public int Update(GK_OA_EquipmentMaintainApplyModel ObjModel)
        {
            int num = 0;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                connection.Open();
                SqlTransaction transaction = connection.BeginTransaction();
                try
                {
                    try
                    {
                        num = new GK_OA_EquipmentMaintainApplyBLL().Update(ObjModel, transaction);
                        transaction.Commit();
                    }
                    catch (SqlException exception)
                    {
                        transaction.Rollback();
                        connection.Close();
                        throw exception;
                    }
                    return(num);
                }
                finally
                {
                    connection.Close();
                }
            }
            return(num);
        }
        public GK_OA_EquipmentMaintainApplyModel GetGK_OA_EquipmentMaintainApply(int Code)
        {
            GK_OA_EquipmentMaintainApplyModel model = new GK_OA_EquipmentMaintainApplyModel();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    model = new GK_OA_EquipmentMaintainApplyBLL().GetModel(Code, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(model);
        }
        public List <GK_OA_EquipmentMaintainApplyModel> GetGK_OA_EquipmentMaintainApplyListOne(int Code)
        {
            List <GK_OA_EquipmentMaintainApplyModel> list = new List <GK_OA_EquipmentMaintainApplyModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    GK_OA_EquipmentMaintainApplyBLL ybll = new GK_OA_EquipmentMaintainApplyBLL();
                    list.Add(ybll.GetModel(Code, connection));
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(list);
        }
        public List <GK_OA_EquipmentMaintainApplyModel> GetGK_OA_EquipmentMaintainApplyList(string SortColumns, int StartRecord, int MaxRecords, int CodeEqual, string NameEqual, string DeptEqual, string ModelNOEqual, string TypeEqual, string NumberEqual, decimal BudgetMoneyEqual, string UserNameEqual, DateTime ApplyDateEqual, string ReasonEqual, string StateEqual, string QualityNOEqual, string SNRuleEqual, DateTime StartDate, DateTime EndDate)
        {
            List <GK_OA_EquipmentMaintainApplyModel> models        = new List <GK_OA_EquipmentMaintainApplyModel>();
            GK_OA_EquipmentMaintainApplyQueryModel   objQueryModel = new GK_OA_EquipmentMaintainApplyQueryModel();

            objQueryModel.StartRecord      = StartRecord;
            objQueryModel.MaxRecords       = MaxRecords;
            objQueryModel.SortColumns      = SortColumns;
            objQueryModel.CodeEqual        = CodeEqual;
            objQueryModel.NameEqual        = NameEqual;
            objQueryModel.DeptEqual        = DeptEqual;
            objQueryModel.ModelNOEqual     = ModelNOEqual;
            objQueryModel.TypeEqual        = TypeEqual;
            objQueryModel.NumberEqual      = NumberEqual;
            objQueryModel.BudgetMoneyEqual = BudgetMoneyEqual;
            objQueryModel.UserNameEqual    = UserNameEqual;
            objQueryModel.ApplyDateEqual   = ApplyDateEqual;
            objQueryModel.ReasonEqual      = ReasonEqual;
            objQueryModel.StateEqual       = StateEqual;
            objQueryModel.QualityNOEqual   = QualityNOEqual;
            objQueryModel.SNRuleEqual      = SNRuleEqual;
            objQueryModel.StartDateEqual   = StartDate;
            objQueryModel.EndDateEqual     = EndDate;
            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    models = new GK_OA_EquipmentMaintainApplyBLL().GetModels(objQueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
        public List <GK_OA_EquipmentMaintainApplyModel> GetGK_OA_EquipmentMaintainApplyList(GK_OA_EquipmentMaintainApplyQueryModel QueryModel)
        {
            List <GK_OA_EquipmentMaintainApplyModel> models = new List <GK_OA_EquipmentMaintainApplyModel>();

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