public int Update(YF_UseCarFlowModel ObjModel) { int num = 0; using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { connection.Open(); SqlTransaction transaction = connection.BeginTransaction(); try { try { num = new YF_UseCarFlowBLL().Update(ObjModel, transaction); transaction.Commit(); } catch (SqlException exception) { transaction.Rollback(); connection.Close(); throw exception; } return(num); } finally { connection.Close(); } } return(num); }
public int ModifyPassAuditing(int Code) { int num = 0; using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { connection.Open(); SqlTransaction transaction = connection.BeginTransaction(); try { try { num = new YF_UseCarFlowBLL().ModifyPassAuditing(Code, transaction); transaction.Commit(); } catch (SqlException exception) { transaction.Rollback(); connection.Close(); throw exception; } return(num); } finally { connection.Close(); } } return(num); }
public List <YF_UseCarFlowModel> GetYF_UseCarFlowList(string SortColumns, int StartRecord, int MaxRecords, string DepartCodeEqual, string UsePersonEqual, DateTime StartDateTimeEqual, DateTime EndDateTimeEqual, string CarCodeEqual) { List <YF_UseCarFlowModel> models = new List <YF_UseCarFlowModel>(); YF_UseCarFlowQueryModel objQueryModel = new YF_UseCarFlowQueryModel(); objQueryModel.StartRecord = StartRecord; objQueryModel.MaxRecords = MaxRecords; objQueryModel.SortColumns = SortColumns; objQueryModel.DepartCodeEqual = DepartCodeEqual; objQueryModel.UsePersonEqual = UsePersonEqual; objQueryModel.StartDateTimeEqual = StartDateTimeEqual; objQueryModel.EndDateTimeEqual = EndDateTimeEqual; objQueryModel.CarCodeEqual = CarCodeEqual; using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { connection.Open(); models = new YF_UseCarFlowBLL().GetModels(objQueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }
public YF_UseCarFlowModel GetYF_UseCarFlow(int Code) { YF_UseCarFlowModel model = new YF_UseCarFlowModel(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { connection.Open(); model = new YF_UseCarFlowBLL().GetModel(Code, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(model); }
public List <YF_UseCarFlowModel> GetYF_UseCarFlowListOne(int Code) { List <YF_UseCarFlowModel> list = new List <YF_UseCarFlowModel>(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { connection.Open(); YF_UseCarFlowBLL wbll = new YF_UseCarFlowBLL(); list.Add(wbll.GetModel(Code, connection)); connection.Close(); } catch (SqlException exception) { throw exception; } } return(list); }
public List <YF_UseCarFlowModel> GetYF_UseCarFlowList(YF_UseCarFlowQueryModel QueryModel) { List <YF_UseCarFlowModel> models = new List <YF_UseCarFlowModel>(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { connection.Open(); if (QueryModel == null) { QueryModel = new YF_UseCarFlowQueryModel(); } models = new YF_UseCarFlowBLL().GetModels(QueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }