protected override void ShowForm() { this.FillCombo(); HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_TFactory TurnCancelCommentFactory = new HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_TFactory(); HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_T TurnCancelCommentEntity = TurnCancelCommentFactory.GetBy((HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_TKeys)Key); if (TurnCancelCommentEntity == null) { throw new HPS.Exceptions.TurnCancelCommentNotFound(); } TurnCancelComment_nvcTextBox.Text = Hepsa.Core.Common.PersentationController.GetEntityValue(TurnCancelCommentEntity.TurnCancelComment_nvc, TypeCode.String).ToString(); Hepsa.Core.Common.PersentationController.SetComboBoxValue(ref UserGroupID_intComboBox, TurnCancelCommentEntity.UserGroupID_int, TypeCode.Int32); }
private Int32 DoCancelOperation(string Date_nvc, string LaderTypeID_nvc) { string CancelDate = string.Empty; if (string.IsNullOrEmpty(Date_nvc)) { HPS.BLL.SettingsBLL.BLLSetting_TFactory SettingFactory = new HPS.BLL.SettingsBLL.BLLSetting_TFactory(); HPS.BLL.SettingsBLL.BLLSetting_T SettingEntity = new HPS.BLL.SettingsBLL.BLLSetting_T(); HPS.BLL.SettingsBLL.BLLSetting_TKeys SettingKey = new HPS.BLL.SettingsBLL.BLLSetting_TKeys(); SettingKey.SettingID_int = 1003; SettingEntity = SettingFactory.GetBy(SettingKey); Hepsa.Core.Common.MyDateTime CurrentDate = new Hepsa.Core.Common.MyDateTime(SettingFactory.ServerJalaliDate); string CancelTime = SettingFactory.ServerTime; string CurrentDateTime = CurrentDate.MyDate.ToString("yyyy/MM/dd") + " " + CancelTime; DateTime SubtractedDate = DateTime.Parse(CurrentDateTime); SubtractedDate = SubtractedDate.AddHours(-Int32.Parse(SettingEntity.Value_nvc)); CancelDate = new Hepsa.Core.Common.MyDateTime(SubtractedDate).ConvertToPersianShortDate(); } else { CancelDate = Date_nvc; } HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_TFactory TurnCancelCommentFactory = new HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_TFactory(); HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_T TurnCancelCommentEntity = new HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_T(); HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_TKeys TurnCancelCommentKey = new HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_TKeys(); TurnCancelCommentKey.TurnCancelCommentID_int = 40; TurnCancelCommentEntity = TurnCancelCommentFactory.GetBy(TurnCancelCommentKey); HPS.BLL.TurnManagementBLL.BLLTurnManagement_TFactory TurnManagementFactory = new HPS.BLL.TurnManagementBLL.BLLTurnManagement_TFactory(); HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory(); DataTable AcceptedTurnsWithoutLadBillDataTable = new DataTable(); if (string.IsNullOrEmpty(LaderTypeID_nvc)) { TrafficFactory.SelectInTurnAcceptedForDelete(CancelDate, string.Empty, AcceptedTurnsWithoutLadBillDataTable); } else { TrafficFactory.SelectInTurnAcceptedForDelete(CancelDate, LaderTypeID_nvc, AcceptedTurnsWithoutLadBillDataTable); } int rowcount = -1; if (AcceptedTurnsWithoutLadBillDataTable != null && AcceptedTurnsWithoutLadBillDataTable.Rows.Count > 0) { rowcount = AcceptedTurnsWithoutLadBillDataTable.Rows.Count; foreach (DataRow row in AcceptedTurnsWithoutLadBillDataTable.Rows) { HPS.BLL.TurnManagementBLL.BLLTurnManagement_T TurnManagementEntity = new HPS.BLL.TurnManagementBLL.BLLTurnManagement_T(); TurnManagementEntity.TurnCancelCommantID_int = TurnCancelCommentEntity.TurnCancelCommentID_int; TurnManagementEntity.TurnCancelCommment_nvc = TurnCancelCommentEntity.TurnCancelComment_nvc; TurnManagementEntity.Return_bit = false; TurnManagementEntity.Date_nvc = TurnManagementFactory.ServerJalaliDate; TurnManagementEntity.Time_nvc = TurnManagementFactory.ServerTime; TurnManagementEntity.UserName_nvc = HPS.Common.CurrentUser.user.UserName_nvc; TurnManagementEntity.TrafficID_bint = Convert.ToInt64(row["TrafficID_bint"]); TurnManagementFactory.BeginProc(); TurnManagementFactory.Insert(TurnManagementEntity); TurnManagementFactory.CommitProc(); } } return(rowcount); }