public static void UpdateRefundAndReschedulingNewBase(RefundAndReschedulingBaseView refundAndReschedulingView, string account) { var refundAndRescheduling = RefundAndReschedulingBase.GetRefundAndRescheduling(refundAndReschedulingView); var repository = ChinaPay.B3B.Service.Foundation.Repository.Factory.CreateRefundAndReschedulingNewRepository(); repository.Update(refundAndRescheduling); saveLog(OperationType.Update, "修改退改签客规基础信息", refundAndRescheduling.AirlineCode.Value, account); }
public int Update(RefundAndReschedulingBase item) { string sql = @"UPDATE [dbo].[T_RefundAndReschedulingBase] SET [AirlineTel] = @AirlineTel,[Condition] = @Condition,[Scrap] = @Scrap ,[Upgrade] = @Upgrade,[Remark] = @Remark,[Level] = @Level WHERE [Airline] = @Airline"; using (var dbOperator = new DbOperator(Provider, ConnectionString)) { dbOperator.AddParameter("Airline", item.AirlineCode.Value); if (string.IsNullOrEmpty(item.AirlineTel)) { dbOperator.AddParameter("AirlineTel", DBNull.Value); } else { dbOperator.AddParameter("AirlineTel", item.AirlineTel); } if (string.IsNullOrEmpty(item.Condition)) { dbOperator.AddParameter("Condition", DBNull.Value); } else { dbOperator.AddParameter("Condition", item.Condition); } if (string.IsNullOrEmpty(item.Scrap)) { dbOperator.AddParameter("Scrap", DBNull.Value); } else { dbOperator.AddParameter("Scrap", item.Scrap); } if (string.IsNullOrEmpty(item.Upgrade)) { dbOperator.AddParameter("Upgrade", DBNull.Value); } else { dbOperator.AddParameter("Upgrade", item.Upgrade); } if (string.IsNullOrEmpty(item.Remark)) { dbOperator.AddParameter("Remark", DBNull.Value); } else { dbOperator.AddParameter("Remark", item.Remark); } dbOperator.AddParameter("Level", item.Level); return(dbOperator.ExecuteNonQuery(sql)); } }
public static void AddRefundAndReschedulingNewBase(RefundAndReschedulingBaseView refundAndReschedulingView, string account) { var refundAndRescheduling = RefundAndReschedulingBase.GetRefundAndRescheduling(refundAndReschedulingView); if (QueryRefundAndRescheduling(refundAndRescheduling.AirlineCode) != null) { throw new ChinaPay.Core.Exception.KeyRepeatedException("航空公司[" + refundAndRescheduling.AirlineCode + "]的退改签客规已存在"); } var repository = ChinaPay.B3B.Service.Foundation.Repository.Factory.CreateRefundAndReschedulingNewRepository(); repository.Insert(refundAndRescheduling); saveLog(OperationType.Insert, "添加退改签客规基础信息", refundAndRescheduling.AirlineCode.Value, account); }
public int Insert(RefundAndReschedulingBase item) { string sql = @"INSERT INTO [T_RefundAndReschedulingBase]([Airline],[AirlineTel],[Condition],[Scrap],[Upgrade],[Remark],[Level]) VALUES (@Airline,@AirlineTel,@Condition,@Scrap,@Upgrade ,@Remark,@Level)"; using (var dbOperator = new DbOperator(Provider, ConnectionString)) { dbOperator.AddParameter("Airline", item.AirlineCode.Value); if (string.IsNullOrEmpty(item.AirlineTel)) { dbOperator.AddParameter("AirlineTel", DBNull.Value); } else { dbOperator.AddParameter("AirlineTel", item.AirlineTel); } if (string.IsNullOrEmpty(item.Condition)) { dbOperator.AddParameter("Condition", DBNull.Value); } else { dbOperator.AddParameter("Condition", item.Condition); } if (string.IsNullOrEmpty(item.Scrap)) { dbOperator.AddParameter("Scrap", DBNull.Value); } else { dbOperator.AddParameter("Scrap", item.Scrap); } if (string.IsNullOrEmpty(item.Upgrade)) { dbOperator.AddParameter("Upgrade", DBNull.Value); } else { dbOperator.AddParameter("Upgrade", item.Upgrade); } if (string.IsNullOrEmpty(item.Remark)) { dbOperator.AddParameter("Remark", DBNull.Value); } else { dbOperator.AddParameter("Remark", item.Remark); } dbOperator.AddParameter("Level", item.Level); return(dbOperator.ExecuteNonQuery(sql)); } }
public RefundAndReschedulingBase Query(UpperString airline) { RefundAndReschedulingBase result = new RefundAndReschedulingBase(airline); IList <RefundAndReschedulingDetail> detail = new List <RefundAndReschedulingDetail>(); string sql = "SELECT base.Airline,base.AirlineTel,base.Condition,base.Scrap,base.Upgrade,base.Remark,base.[Level],detail.Id,detail.Bunks,detail.ScrapBefore,detail.ScrapAfter,detail.ChangeBefore,detail.ChangeAfter,detail.Endorse,detail.Airline FROM T_RefundAndReschedulingBase base LEFT JOIN T_RefundAndReschedulingDetail detail ON base.Airline = detail.Airline WHERE base.Airline =@Airline"; using (var dbOperator = new DbOperator(Provider, ConnectionString)) { dbOperator.AddParameter("Airline", airline.Value); using (var reader = dbOperator.ExecuteReader(sql)) { string strAirline = string.Empty; while (reader.Read()) { if (strAirline != reader.GetString(0)) { result.AirlineTel = reader.IsDBNull(1) ? string.Empty : reader.GetString(1); result.Condition = reader.IsDBNull(2) ? string.Empty : reader.GetString(2); result.Scrap = reader.IsDBNull(3) ? string.Empty : reader.GetString(3); result.Upgrade = reader.IsDBNull(4) ? string.Empty : reader.GetString(4); result.Remark = reader.IsDBNull(5) ? string.Empty : reader.GetString(5); result.Level = reader.GetInt32(6); strAirline = reader.GetString(0); } if (!reader.IsDBNull(7)) { detail.Add(new RefundAndReschedulingDetail(reader.GetGuid(7)) { Bunks = reader.IsDBNull(8) ? string.Empty : reader.GetString(8), ScrapBefore = reader.IsDBNull(9) ? string.Empty : reader.GetString(9), ScrapAfter = reader.IsDBNull(10) ? string.Empty : reader.GetString(10), ChangeBefore = reader.IsDBNull(11) ? string.Empty : reader.GetString(11), ChangeAfter = reader.IsDBNull(12) ? string.Empty : reader.GetString(12), Endorse = reader.IsDBNull(13) ? string.Empty : reader.GetString(13), Airline = reader.GetString(14), }); result.RefundAndReschedulingDetail = detail; } } } } return(result); }
void bindDatas(Pagination pagination) { try { RefundAndReschedulingBase detail = FoundationService.QueryRefundAndReschedulingNewBase(AirlineCode); if (detail != null) { lblAirline.Text = string.Format("{0}({1})", detail.Airline.Name, detail.AirlineCode); lblCondition.Text = detail.Condition; lblScrapRules.Text = detail.Scrap; lblUpgradRules.Text = detail.Upgrade; lblRemark.Text = detail.Remark; lblPhone.Text = detail.AirlineTel; if (detail.RefundAndReschedulingDetail != null) { var totalDatas = detail.RefundAndReschedulingDetail; var startRow = pagination.PageSize * (pagination.PageIndex - 1); var endRow = pagination.PageSize * pagination.PageIndex; var datas = totalDatas.Skip(startRow > 0 ? startRow : 0).Take(pagination.PageSize); this.gvRefundRules.DataSource = datas; this.gvRefundRules.DataBind(); if (datas.Any()) { this.Pager1.Visible = true; if (pagination.GetRowCount) { Pager1.RowCount = totalDatas.Count(); } } else { Pager1.Visible = false; } } } } catch (Exception ex) { ShowExceptionMessage(ex, "查询"); } }
public RefundAndReschedulingBase QueryRefundAndRescheduling(UpperString airline) { RefundAndReschedulingBase result = null; string sql = @"SELECT [AirlineTel],[Condition],[Scrap],[Upgrade],[Remark],[Level] FROM [dbo].[T_RefundAndReschedulingBase] WHERE [Airline]=@Airline"; using (var dbOperator = new DbOperator(Provider, ConnectionString)) { dbOperator.AddParameter("@Airline", airline.Value); using (var reader = dbOperator.ExecuteReader(sql)) { while (reader.Read()) { result = new RefundAndReschedulingBase(airline); result.AirlineTel = reader.IsDBNull(0) ? string.Empty : reader.GetString(0); result.Condition = reader.IsDBNull(1) ? string.Empty : reader.GetString(1); result.Scrap = reader.IsDBNull(2) ? string.Empty : reader.GetString(2); result.Upgrade = reader.IsDBNull(3) ? string.Empty : reader.GetString(3); result.Remark = reader.IsDBNull(4) ? string.Empty : reader.GetString(4); result.Level = reader.GetInt32(5); } } } return(result); }
public IEnumerable <RefundAndReschedulingBase> Query() { string sql = @"SELECT [Airline],[AirlineTel],[Condition],[Scrap],[Upgrade],[Remark],[Level] FROM [dbo].[T_RefundAndReschedulingBase]"; var result = new List <RefundAndReschedulingBase>(); using (var dbOperator = new DbOperator(Provider, ConnectionString)) { using (var reader = dbOperator.ExecuteReader(sql)) { while (reader.Read()) { RefundAndReschedulingBase item = new RefundAndReschedulingBase(reader.GetString(0)); item.AirlineTel = reader.IsDBNull(1) ? string.Empty : reader.GetString(1); item.Condition = reader.IsDBNull(2) ? string.Empty : reader.GetString(2); item.Scrap = reader.IsDBNull(3) ? string.Empty : reader.GetString(3); item.Upgrade = reader.IsDBNull(4) ? string.Empty : reader.GetString(4); item.Remark = reader.IsDBNull(5) ? string.Empty : reader.GetString(5); item.Level = reader.GetInt32(6); result.Add(item); } } } return(result); }