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); }
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); }
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); }
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); }
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); }
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); }