private void okbutton_Click(object sender, EventArgs e) { String Pass = string.Empty; string UserName = string.Empty; HPS.BLL.SettingsBLL.BLLSetting_TFactory SettingFactory = new HPS.BLL.SettingsBLL.BLLSetting_TFactory(); HPS.BLL.SettingsBLL.BLLSetting_TKeys SettingKey = new HPS.BLL.SettingsBLL.BLLSetting_TKeys(); HPS.BLL.SettingsBLL.BLLSetting_T SettingEntity = new HPS.BLL.SettingsBLL.BLLSetting_T(); SettingKey.SettingID_int = 1005; SettingEntity = SettingFactory.GetBy(SettingKey); UserName = SettingEntity.Value_nvc; SettingKey.SettingID_int = 1006; SettingEntity = SettingFactory.GetBy(SettingKey); Pass = SettingEntity.Value_nvc; if (UserName_nvctextBox.Text == UserName && PasswordtextBox.Text == Pass) { this._True_bit = true; this.Close(); } else { this._True_bit = false; Hepsa.Core.Common.MessageBox.ErrorMessage("نام کاربری و رمز عبور اشتباه می باشد"); } }
private void Savebutton_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(UserNametextBox.Text) || string.IsNullOrEmpty(PasstextBox.Text)) { Hepsa.Core.Common.MessageBox.ErrorMessage("لطفا نام کاربری و رمز عبور را وارد کنید"); return; } else { //Password_nvc = Hepsa.Core.Common.Security.MD5(PasstextBox.Text); HPS.BLL.SettingsBLL.BLLSetting_T SettingEntity = new HPS.BLL.SettingsBLL.BLLSetting_T(); HPS.BLL.SettingsBLL.BLLSetting_TFactory SettingFactory = new HPS.BLL.SettingsBLL.BLLSetting_TFactory(); HPS.BLL.SettingsBLL.BLLSetting_TKeys SettingKey = new HPS.BLL.SettingsBLL.BLLSetting_TKeys(); SettingKey.SettingID_int = 1005; SettingEntity = SettingFactory.GetBy(SettingKey); SettingEntity.Value_nvc = UserNametextBox.Text; SettingFactory.Update(SettingEntity, SettingKey); SettingKey.SettingID_int = 1006; SettingEntity = SettingFactory.GetBy(SettingKey); SettingEntity.Value_nvc = PasstextBox.Text; SettingFactory.Update(SettingEntity, SettingKey); //SettingEntity.Value_nvc = Hepsa.Core.Common.Security.MD5(NewPasstextBox.Text); Hepsa.Core.Common.MessageBox.InformationMessage("رمز عبور جدید ثبت شد"); this.Close(); } }
private void LoadTurnManagement() { try { if (_TurnStatus == 1) //return { 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(); DateTime NowDate = DateTime.Parse((new Hepsa.Core.Common.MyDateTime(SettingFactory.ServerJalaliDate)).MyDate.ToString("yyyy/MM/dd") + " " + SettingFactory.ServerTime); DateTime SubtractedTime = NowDate.Subtract(new TimeSpan(Convert.ToInt32(SettingEntity.Value_nvc), 0, 0)); SettingKey.SettingID_int = 1001; SettingEntity = SettingFactory.GetBy(SettingKey); HPS.BLL.TurnManagementBLL.BLLTurnManagement_TFactory TurnManagementFactory = new HPS.BLL.TurnManagementBLL.BLLTurnManagement_TFactory(); DataTable TurnManagementDataTable = new DataTable(); TurnManagementFactory.GetAllWithTrafficForReturnTurn(SettingFactory.ServerJalaliDate, SubtractedTime.ToString("HH:mm"), null, null, string.Empty, string.Empty, string.Empty, string.Empty, ref TurnManagementDataTable); this.TurnManagementGridView.DataSource = TurnManagementDataTable; } else //cancel { CanceledTurnFromLadbilltoolStripButton.Visible = false; HPS.BLL.TurnManagementBLL.BLLTurnManagement_TFactory TurnManagementFactory = new HPS.BLL.TurnManagementBLL.BLLTurnManagement_TFactory(); DataTable TurnManagementDataTable = new DataTable(); TurnManagementFactory.GetAllWithTrafficForCancelTurn(null, null, string.Empty, string.Empty, string.Empty, string.Empty, ref TurnManagementDataTable); this.TurnManagementGridView.DataSource = TurnManagementDataTable; } } catch (System.Exception ex) { throw ex; } }
private void SettingEntityForm_Load(object sender, EventArgs e) { try { _SettingEntity = SettingFactoy.GetBy(this._SettingKey); if (_SettingEntity != null) { CreateFormInterface(); //Setting_nvclabel.Text = _SettingEntity.Setting_nvc; //Value_nvctextBox.Text = _SettingEntity.Value_nvc; //Point pnt = new Point(Setting_nvclabel.Location.X + 35 - Setting_nvclabel.Width, Setting_nvclabel.Location.Y); //Setting_nvclabel.Location = pnt; } } catch (Exception) { throw; } }
private Int32 CancelTimeExpiredTurns(string Date_nvc, string LaderTypeID_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 = 1008; SettingEntity = SettingFactory.GetBy(SettingKey); int Canceledrowcount = -1; if (string.IsNullOrEmpty(LaderTypeID_nvc) && string.IsNullOrEmpty(Date_nvc)) { Canceledrowcount = DoCancelOperation(string.Empty, string.Empty); } else { Canceledrowcount = DoCancelOperation(Date_nvc, LaderTypeID_nvc); } return(Canceledrowcount); }
private void Sendbutton_Click(object sender, EventArgs e) { DataTable SelectedDriver = new DataTable(); SelectedDriver = (DataTable)this.DriversdataGridView.DataSource; if (SelectedDriver != null) { DataRow[] DriverRow = SelectedDriver.Select("Checked_bit = 'True'"); if (DriverRow != null && DriverRow.Length > 0) { HPS.Present.SMS.LogintoSmsSystemForm frm = new LogintoSmsSystemForm(); frm.ShowDialog(); if (frm.True_bit) { System.IO.FileStream source = new System.IO.FileStream(@"index.html", System.IO.FileMode.Open, System.IO.FileAccess.Read); WebBrowser webBrowser1 = new WebBrowser(); webBrowser1.DocumentStream = source; string sourceText = string.Empty; using (StreamReader sourceReader = new StreamReader(source)) { sourceText = sourceReader.ReadToEnd(); } String Pass = string.Empty; string UserName = string.Empty; HPS.BLL.SettingsBLL.BLLSetting_TFactory SettingFactory = new HPS.BLL.SettingsBLL.BLLSetting_TFactory(); HPS.BLL.SettingsBLL.BLLSetting_TKeys SettingKey = new HPS.BLL.SettingsBLL.BLLSetting_TKeys(); HPS.BLL.SettingsBLL.BLLSetting_T SettingEntity = new HPS.BLL.SettingsBLL.BLLSetting_T(); SettingKey.SettingID_int = 1005; SettingEntity = SettingFactory.GetBy(SettingKey); UserName = SettingEntity.Value_nvc; SettingKey.SettingID_int = 1006; SettingEntity = SettingFactory.GetBy(SettingKey); Pass = SettingEntity.Value_nvc; sourceText = string.Format(sourceText, UserName, Pass); webBrowser1.Document.Write(sourceText); var htmlElements = webBrowser1.Document.GetElementById("btnSubmit"); hdoc = webBrowser1.Document; StringBuilder MessegeText = new StringBuilder(); string MobileList; MobileList = string.Empty; foreach (DataRow rw in DriverRow) { MobileList = string.Format("{0},{1}", MobileList, rw["DriverMobileNumber_nvc"].ToString()); } if (MobileList.Length > 0) { if (MobileList.Substring(0, 1) == ",") { MobileList = MobileList.Substring(1, MobileList.Length - 1); } } DataTable SelectedNews = new DataTable(); SelectedNews = (DataTable)this.NewsdataGridView.DataSource; DataRow[] NewsRow = SelectedNews.Select("Checked_bit = 'True'"); foreach (DataRow rw in NewsRow) { MessegeText.AppendLine(String.Format("{0}:{1}", rw["Title_nvc"].ToString(), rw["News_nvc"].ToString())); } hdoc.GetElementById("mobilenumber").SetAttribute("value", MobileList); hdoc.GetElementById("message").SetAttribute("value", MessegeText.ToString()); hdoc.GetElementById("btnSubmit").InvokeMember("click"); } else { return; } } else { Hepsa.Core.Common.MessageBox.ErrorMessage(HPS.Exceptions.ExceptionCs.DriverIsNotChosen); } } }
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); }
public IranianInNotOutTrafficReport(string FromDate, string ToDate, int TrafficType, int?PivotGroupID, int?ServicesID) { // // Required for Windows Form Designer support // InitializeComponent(); FromDatetxt.Text = FromDate; ToDatetxt.Text = ToDate; HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory(); DataTable TrafficDataTable = new DataTable(); string Condition = string.Empty; if (ServicesID.HasValue) { if (PivotGroupID.HasValue) { Condition = String.Format("(T1.TrafficTypeID_int='1') AND (T1.Date_nvc>='{0}') AND (T1.Date_nvc<='{1}') AND (LaderPivotGroup_T.LaderPivotGroupID_int={2}) AND (T1.ServiceID_int={3})", FromDate, ToDate, PivotGroupID, ServicesID); } else { Condition = String.Format("(T1.TrafficTypeID_int='1') AND (T1.Date_nvc>='{0}') AND (T1.Date_nvc<='{1}') AND (T1.ServiceID_int={2})", FromDate, ToDate, ServicesID); } } else { if (PivotGroupID.HasValue) { Condition = String.Format("(T1.TrafficTypeID_int='1') AND (T1.Date_nvc>='{0}') AND (T1.Date_nvc<='{1}') AND (LaderPivotGroup_T.LaderPivotGroupID_int={2})", FromDate, ToDate, PivotGroupID); } else { Condition = String.Format("(T1.TrafficTypeID_int='1') AND (T1.Date_nvc>='{0}') AND (T1.Date_nvc<='{1}')", FromDate, ToDate); } } TrafficFactory.GetAllByConditionAllInTrafficNotTemporaryOut(Condition, ref TrafficDataTable); TrafficDataTable.Columns.Add(new DataColumn("AllPayment_dec", typeof(decimal))); TrafficDataTable.Columns.Add(new DataColumn("Remained_dec", typeof(decimal))); HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys LaderTypeKey = new HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys(); string stopFeeCondition = string.Empty; var stopFeeFactory = new BLL.StopFeeBLL.BLLStopFee_TFactory(); BLL.StopFeeBLL.BLLStopFee_T oldStopFeeEntity = null; BLL.StopFeeBLL.BLLStopFee_TKeys stopFeeKey = null; BLL.LaderTypeBLL.BLLLaderType_T laderTypeEntity = null; HPS.BLL.LadBillCreditBLL.BLLLadBillCredit_TFactory LadBillFactory = new HPS.BLL.LadBillCreditBLL.BLLLadBillCredit_TFactory(); DataTable TrafficInWithladBillDataTable = null; DataTable TrafficInDatatable = null; HPS.BLL.SettingsBLL.BLLSetting_TFactory settingsFactory = new HPS.BLL.SettingsBLL.BLLSetting_TFactory(); HPS.BLL.SettingsBLL.BLLSetting_TKeys SettingKey = null; HPS.BLL.SettingsBLL.BLLSetting_T TurnHourSettingEntity = null; HPS.BLL.SettingsBLL.BLLSetting_T SettingEntity = null; foreach (DataRow row in TrafficDataTable.Rows) { DataTable LaderTypeDataTable = new DataTable(); try { oldStopFeeEntity = new BLL.StopFeeBLL.BLLStopFee_T(); stopFeeKey = new BLL.StopFeeBLL.BLLStopFee_TKeys(); stopFeeKey.StopFeeID_int = Convert.ToInt32(row["StopFeeID_int"]); oldStopFeeEntity = stopFeeFactory.GetBy(stopFeeKey); if ((Int32)row["TrafficTypeID_int"] == 1) { laderTypeEntity = new BLL.LaderTypeBLL.BLLLaderType_T(); LaderTypeKey.LaderTypeID_int = Convert.ToInt32(row["LaderTypeID_int"]); laderTypeEntity = LaderTypeFactory.GetBy(LaderTypeKey); stopFeeCondition = string.Format(" StartDate_nvc>'{0}' AND StopFee_T.TrafficTypeID_int={1} AND StopFee_T.ServicesID_int={2} AND StopFee_T.LaderPivotGroupID_int={3}", oldStopFeeEntity.EndDate_nvc, Convert.ToInt32(row["TrafficTypeID_int"]), Convert.ToInt32(row["ServiceID_int"]), laderTypeEntity.LaderPivotGroupID_int); } else { stopFeeCondition = string.Format(" StartDate_nvc>'{0}' AND StopFee_T.TrafficTypeID_int={1}", oldStopFeeEntity.StartDate_nvc, Convert.ToInt32(row["TrafficTypeID_int"])); } var newStopFeeTable = new DataTable(); stopFeeFactory.GetAllByCondition(stopFeeCondition, ref newStopFeeTable); Hepsa.Core.Common.MyDateTime InDateTime = new Hepsa.Core.Common.MyDateTime(row["Date_nvc"].ToString()); Hepsa.Core.Common.MyDateTime OutDateTime = new Hepsa.Core.Common.MyDateTime(TrafficFactory.ServerJalaliDate); string InDate = InDateTime.MyDate.ToString("yyyy/MM/dd"); //+ " " + InTime_nvcTextBox.Text; string OutDate = OutDateTime.MyDate.ToString("yyyy/MM/dd"); // + " " + Time_nvcTextBox.Text; if (InDate.Length == 16) { InDate += ":00"; } else if (InDate.Length > 19) { InDate = InDate.Substring(0, 19); } if (OutDate.Length == 16) { OutDate += ":00"; } else if (OutDate.Length > 19) { OutDate = OutDate.Substring(0, 19); } decimal Price = Convert.ToDecimal(row["Fee_dec"]); if (Convert.ToInt32(row["ServiceID_int"]) == 2) { Price = row["Fee_dec"] != null?Convert.ToInt32(row["Fee_dec"]) : 0; } string incondition = "Traffic_T.TrafficNumber_bint='" + row["TrafficNumber_bint"].ToString() + "'"; Condition = string.Format("Traffic_T.TurnNumber_bint='{0}' And Traffic_T.TrafficNumber_bint<>{1}", row["TurnNumber_bint"], row["TrafficNumber_bint"].ToString()); TrafficInWithladBillDataTable = new DataTable(); LadBillFactory.GetAllWithTrafficLadBillCreditByConditon(incondition, ref TrafficInWithladBillDataTable); TrafficInDatatable = new DataTable(); TrafficFactory.GetAllByCondition(Condition, ref TrafficInDatatable); SettingKey = new HPS.BLL.SettingsBLL.BLLSetting_TKeys(); SettingKey.SettingID_int = 1002; TurnHourSettingEntity = settingsFactory.GetBy(SettingKey); if (TrafficInDatatable.Rows.Count > 0) { DateTime TrafficDate = DateTime.Parse((new Hepsa.Core.Common.MyDateTime(TrafficInDatatable.Rows[0]["Date_nvc"].ToString())).MyDate.ToString("yyyy/MM/dd") + " " + TrafficInDatatable.Rows[0]["Time_nvc"].ToString()); Int32 Allowablehour = Convert.ToInt32(TurnHourSettingEntity.Value_nvc); if (TrafficFactory.ServerDate <= TrafficDate.AddHours(Allowablehour)) { if (TrafficInWithladBillDataTable.Rows.Count == 0) { Price = 0; } } } decimal Balanced = 0; TimeSpan ts = new TimeSpan(); if (newStopFeeTable != null && newStopFeeTable.Rows.Count > 0) { //Hepsa.Core.Common.MyDateTime stopFeeMiladiEndDate_nvc = new Hepsa.Core.Common.MyDateTime(newStopFeeTable.Rows[0]["EndDate_nvc"].ToString()); //string stopFeeEndDate_nvc = stopFeeMiladiEndDate_nvc.MyDate.ToString("yyyy/MM/dd"); Hepsa.Core.Common.MyDateTime stopFeeMiladiEndDate_nvc = new Hepsa.Core.Common.MyDateTime(oldStopFeeEntity.EndDate_nvc); string stopFeeEndDate_nvc = stopFeeMiladiEndDate_nvc.MyDate.ToString("yyyy/MM/dd"); ts = DateTime.Parse(stopFeeEndDate_nvc).Subtract(DateTime.Parse(InDate)); if (Convert.ToBoolean(row["TurnAccepted_bit"]) == true) { double ExtraHour = ts.TotalHours; SettingEntity = new HPS.BLL.SettingsBLL.BLLSetting_T(); SettingKey.SettingID_int = 1002; SettingEntity = settingsFactory.GetBy(SettingKey); ExtraHour -= Convert.ToDouble(SettingEntity.Value_nvc); if (ExtraHour > 0) { ///محاسبه مازاد بر اساس قیمت قبلی از ورود تا شروع قیمت جدید int days = (int)(ExtraHour / Convert.ToInt32(row["ExtraHour_int"])); Price += Math.Floor(((decimal)(days)) * Convert.ToDecimal(row["ExtraHourFee_dec"])); } Hepsa.Core.Common.MyDateTime stopFeeMiladiStartDate_nvc = new Hepsa.Core.Common.MyDateTime(newStopFeeTable.Rows[0]["StartDate_nvc"].ToString()); string newStopFeeStartDate_nvc = stopFeeMiladiStartDate_nvc.MyDate.ToString("yyyy/MM/dd"); TimeSpan ExtaTS = DateTime.Parse(newStopFeeStartDate_nvc).Subtract(DateTime.Parse(InDate)); double ExtraExtraHour = ExtaTS.TotalHours; if (ExtraExtraHour < Convert.ToDouble(SettingEntity.Value_nvc)) { ///محاسبه مازاد از شروع تاریخ قیمت جدید تا تاریخ خروج if (ExtraHour >= 0) { ts = DateTime.Parse(OutDate).AddDays(1).Subtract(DateTime.Parse(InDate)); } else { ts = DateTime.Parse(OutDate).Subtract(DateTime.Parse(InDate)); } ExtraHour = ts.TotalHours - Convert.ToDouble(SettingEntity.Value_nvc); if (ExtraHour >= 0) { Int32 days = Convert.ToInt32((ExtraHour / Convert.ToInt32(newStopFeeTable.Rows[0]["ExtraHour_int"]))); Price += Math.Floor((Convert.ToDecimal((days)) * Convert.ToDecimal(newStopFeeTable.Rows[0]["ExtraHourFee_dec"]))); } } else { ///محاسبه مازاد از شروع تاریخ قیمت جدید تا تاریخ خروج //Hepsa.Core.Common.MyDateTime stopFeeMiladiStartDate_nvc = new Hepsa.Core.Common.MyDateTime(newStopFeeTable.Rows[0]["StartDate_nvc"].ToString()); //string newStopFeeStartDate_nvc = stopFeeMiladiStartDate_nvc.MyDate.ToString("yyyy/MM/dd"); //ts = DateTime.Parse(OutDate).AddDays(1).Subtract(DateTime.Parse(newStopFeeStartDate_nvc)); if (ExtraHour > 0) { ts = DateTime.Parse(OutDate).AddDays(1).Subtract(DateTime.Parse(newStopFeeStartDate_nvc)); } else { ts = DateTime.Parse(OutDate).Subtract(DateTime.Parse(newStopFeeStartDate_nvc)); } ExtraHour = ts.TotalHours; if (ExtraHour > 0) { Int32 days = Convert.ToInt32((ExtraHour / Convert.ToInt32(newStopFeeTable.Rows[0]["ExtraHour_int"]))); Price += Math.Floor((Convert.ToDecimal((days)) * Convert.ToDecimal(newStopFeeTable.Rows[0]["ExtraHourFee_dec"]))); } } } else { if (Convert.ToDecimal(row["ExtraHourFee_dec"]) != 0) { ///محاسبه مازاد بر اساس قیمت قبلی از ورود تا شروع قیمت جدید double ExtraHour = ts.TotalHours - Convert.ToDouble(row["AllowableHour_int"]); int days = Convert.ToInt32((ExtraHour / Convert.ToInt32(row["ExtraHour_int"]))); Price += Math.Floor(((decimal)(days)) * Convert.ToDecimal(row["ExtraHourFee_dec"])); ///محاسبه مازاد از شروع تاریخ قیمت جدید تا تاریخ خروج Hepsa.Core.Common.MyDateTime stopFeeMiladiStartDate_nvc = new Hepsa.Core.Common.MyDateTime(newStopFeeTable.Rows[0]["StartDate_nvc"].ToString()); string newStopFeeStartDate_nvc = stopFeeMiladiStartDate_nvc.MyDate.ToString("yyyy/MM/dd"); ts = DateTime.Parse(OutDate).AddDays(1).Subtract(DateTime.Parse(newStopFeeStartDate_nvc)); ExtraHour = ts.TotalHours; days = (int)(ExtraHour / (int)newStopFeeTable.Rows[0]["ExtraHour_int"]); Price += Math.Floor(((decimal)(days)) * Convert.ToDecimal(newStopFeeTable.Rows[0]["ExtraHourFee_dec"])); } } } else { ts = DateTime.Parse(OutDate).Subtract(DateTime.Parse(InDate)); if (ts.TotalHours > Convert.ToInt32(row["AllowableHour_int"])) { if (Convert.ToBoolean(row["TurnAccepted_bit"]) == true) { double ExtraHour = ts.TotalHours; SettingEntity = new BLL.SettingsBLL.BLLSetting_T(); SettingKey.SettingID_int = 1002; SettingEntity = settingsFactory.GetBy(SettingKey); ExtraHour -= Convert.ToDouble(SettingEntity.Value_nvc); if (ExtraHour > 0) { int days = (int)(ExtraHour / Convert.ToInt32(row["ExtraHour_int"])); Price += Math.Floor(((decimal)(days)) * Convert.ToDecimal(row["ExtraHourFee_dec"])); } //else //{ // Price = 0; //} } else { if (Convert.ToDecimal(row["ExtraHourFee_dec"]) != 0) { double ExtraHour = ts.TotalHours - Convert.ToDouble(row["AllowableHour_int"]); int days = (int)(ExtraHour / Convert.ToInt32(row["ExtraHour_int"])); Price += Math.Floor(((decimal)(days)) * Convert.ToDecimal(row["ExtraHourFee_dec"])); } } } } row["AllPayment_dec"] = Convert.ToString(Price);//+ Balanced if (Price == Balanced) { row["Remained_dec"] = "0"; } else { row["Remained_dec"] = Price - Convert.ToDecimal(row["Price_dec"]);// } if ((Price - Balanced) < 0) { row["Remained_dec"] = Convert.ToDecimal(row["Price_dec"]); } } catch (Exception ex) { Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message); } } //AllPayment_dec DataSource = TrafficDataTable; Datetxt.DataField = "Date_nvc"; Timetxt.DataField = "Time_nvc"; TurnNumbertxt.DataField = "TurnNumber_bint"; TrafficNumbertxt.DataField = "TrafficNumber_bint"; NumberPlateTextBox.DataField = "NumberPlate_nvc"; PlateCitytxt.DataField = "PlateCityID_intPlateCity_nvc"; SerialPlateTextBox.DataField = "SerialPlate_nvc"; CarCardNumbertxt.DataField = "CarCardNumber_nvc"; DriverCardNumbertxt.DataField = "DriverCardNumber_nvc"; Pricetxt.DataField = "Price_dec"; Usertxt.DataField = "UserName_nvc"; LastNametxt.DataField = "FullName_nvc"; TurnAcceptedchk.DataField = "TurnAccepted_bit"; ServiceType_nvctxt.DataField = "ServiceID_intServiceType_nvc"; DriverCardNumbertxt.DataField = "DriverInfraction_nvc"; CarInfractiontxt.DataField = "CarInfraction_nvc"; payment_dectxt.DataField = "AllPayment_dec"; remained_dectxt.DataField = "Remained_dec"; DateTextBox.Text = TrafficFactory.ServerJalaliDate; TimeTextBox.Text = TrafficFactory.ServerTime; UserNameTextBox.Text = HPS.Common.CurrentUser.user.UserName_nvc; decimal?AllPrice = (from row in TrafficDataTable.AsEnumerable() select(decimal?) row["Price_dec"]).Sum(); AllPricetxt.Text = AllPrice.HasValue ? AllPrice.ToString() : "0"; decimal?AllPayment_dec = (from row in TrafficDataTable.AsEnumerable() select(decimal?) row["AllPayment_dec"]).Sum(); allPayment_dectxt.Text = AllPayment_dec.HasValue ? AllPayment_dec.ToString() : "0"; decimal?AllRemained_dec = (from row in TrafficDataTable.AsEnumerable() select(decimal?) row["Remained_dec"]).Sum(); allRemained_dectxt.Text = AllRemained_dec.HasValue ? AllRemained_dec.ToString() : "0"; }
private void Search() { try { TurnManagementGridView.DataSource = null; DataTable TrafficDataTable = new DataTable(); HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory(); string Condition = string.Empty; if (_TurnStatus == 1)//return { 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 = 1001; SettingEntity = SettingFactory.GetBy(SettingKey); DateTime NowDate = DateTime.Parse((new Hepsa.Core.Common.MyDateTime(SettingFactory.ServerJalaliDate)).MyDate.ToString("yyyy/MM/dd") + " " + SettingFactory.ServerTime); DateTime SubtractedTime = NowDate.Subtract(new TimeSpan(Convert.ToInt32(SettingEntity.Value_nvc), 0, 0)); HPS.BLL.TurnManagementBLL.BLLTurnManagement_TFactory TurnManagementFactory = new HPS.BLL.TurnManagementBLL.BLLTurnManagement_TFactory(); DataTable TurnManagementDataTable = new DataTable(); if (!string.IsNullOrEmpty(TrafficNumberTextBox.Text)) { TurnManagementFactory.GetAllWithTrafficForReturnTurn(SettingFactory.ServerJalaliDate, SubtractedTime.ToString("HH:mm"), Int64.Parse(TrafficNumberTextBox.Text), null, string.Empty, string.Empty, string.Empty, string.Empty, ref TurnManagementDataTable); } else if (!string.IsNullOrEmpty(AcceptedTurnNumberTextBox.Text)) { TurnManagementFactory.GetAllWithTrafficForReturnTurn(SettingFactory.ServerJalaliDate, SubtractedTime.ToString("HH:mm"), null, Int64.Parse(AcceptedTurnNumberTextBox.Text), string.Empty, string.Empty, string.Empty, string.Empty, ref TurnManagementDataTable); } else if (!string.IsNullOrEmpty(NumberPlate_nvcTextBox.Text) && !string.IsNullOrEmpty(SerialPlate_nvcTextBox.Text)) { TurnManagementFactory.GetAllWithTrafficForReturnTurn(SettingFactory.ServerJalaliDate, SubtractedTime.ToString("HH:mm"), null, null, NumberPlate_nvcTextBox.Text, SerialPlate_nvcTextBox.Text, string.Empty, string.Empty, ref TurnManagementDataTable); } else if (!string.IsNullOrEmpty(FromDate_nvcTextBox.Text) && !string.IsNullOrEmpty(ToDate_nvcTextBox.Text)) { TurnManagementFactory.GetAllWithTrafficForReturnTurn(SettingFactory.ServerJalaliDate, SubtractedTime.ToString("HH:mm"), null, null, string.Empty, string.Empty, FromDate_nvcTextBox.Text, ToDate_nvcTextBox.Text, ref TurnManagementDataTable); } this.TurnManagementGridView.DataSource = TurnManagementDataTable; } else//cancel { CanceledTurnFromLadbilltoolStripButton.Visible = false; this.Text = "لیست نوبت ها برای ابطال"; HPS.BLL.TurnManagementBLL.BLLTurnManagement_TFactory TurnManagementFactory = new HPS.BLL.TurnManagementBLL.BLLTurnManagement_TFactory(); DataTable TurnManagementDataTable = new DataTable(); if (!string.IsNullOrEmpty(TrafficNumberTextBox.Text)) { TurnManagementFactory.GetAllWithTrafficForCancelTurn(Int64.Parse(TrafficNumberTextBox.Text), null, string.Empty, string.Empty, string.Empty, string.Empty, ref TurnManagementDataTable); } else if (!string.IsNullOrEmpty(AcceptedTurnNumberTextBox.Text)) { TurnManagementFactory.GetAllWithTrafficForCancelTurn(null, Int64.Parse(AcceptedTurnNumberTextBox.Text), string.Empty, string.Empty, string.Empty, string.Empty, ref TurnManagementDataTable); } else if (!string.IsNullOrEmpty(NumberPlate_nvcTextBox.Text) && !string.IsNullOrEmpty(SerialPlate_nvcTextBox.Text)) { TurnManagementFactory.GetAllWithTrafficForCancelTurn(null, null, NumberPlate_nvcTextBox.Text, SerialPlate_nvcTextBox.Text, string.Empty, string.Empty, ref TurnManagementDataTable); } else if (!string.IsNullOrEmpty(FromDate_nvcTextBox.Text) && !string.IsNullOrEmpty(ToDate_nvcTextBox.Text)) { TurnManagementFactory.GetAllWithTrafficForCancelTurn(null, null, string.Empty, string.Empty, FromDate_nvcTextBox.Text, ToDate_nvcTextBox.Text, ref TurnManagementDataTable); } this.TurnManagementGridView.DataSource = TurnManagementDataTable; } } catch (System.Exception ex) { Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message); } }
private void StimulViewer_Load(object sender, EventArgs e) { //try //{ if (_Traffic_bit == false && _Othercar_bit == false) { AcceptedTurnstiReport.Dictionary.Synchronize(); AcceptedTurnstiReport.Dictionary.Databases.Clear(); AcceptedTurnstiReport.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Connection", Hepsa.Core.Common.ConnectionString.ConnectionString)); AcceptedTurnstiReport.Compile(); AcceptedTurnstiReport["organ"] = new HPS.BLL.SettingsBLL.BLLSetting_TFactory().GetBy(new BLL.SettingsBLL.BLLSetting_TKeys() { SettingID_int = 1029 }).Value_nvc.ToString(); HPS.BLL.PortPlacesBLL.BLLPortPlaces_TFactory PortPlaceFactory = new HPS.BLL.PortPlacesBLL.BLLPortPlaces_TFactory(); HPS.BLL.BillMessageBLL.BLLBillMessage_TFactory BillFactory = new HPS.BLL.BillMessageBLL.BLLBillMessage_TFactory(); if (TrafficEntity.BillMessageID_int == 0 || TrafficEntity.BillMessageID_int == null) { } else { string Billcondition = "[BillMessage_T].[BillMessageID_int]=" + TrafficEntity.BillMessageID_int; List <HPS.BLL.BillMessageBLL.BLLBillMessage_T> BillLst = BillFactory.GetAllByCondition(Billcondition); if (BillLst != null) { AcceptedTurnstiReport["Messagetxt"] = BillLst[0].Message_nvc; AcceptedTurnstiReport["Message_bit"] = true; } else { AcceptedTurnstiReport["Message_bit"] = false; } } NumericTextBox txt = new NumericTextBox(); txt.DigitsInGroup = 3; if (TrafficEntity.Price_dec != null) { txt.Text = TrafficEntity.Price_dec.ToString(); AcceptedTurnstiReport["Price_nvc"] = " مبلغ دریافت شده هنگام ورود " + txt.Text + " ريال می باشد"; } if (TrafficEntity.Price_dec != null) { AcceptedTurnstiReport["PricewithOutTax_nvc"] = (TrafficEntity.Price_dec - TrafficEntity.PriceTax_dec).ToString(); } if (!string.IsNullOrEmpty(TrafficEntity.AcceptedTurnComment_nvc)) { if (TrafficEntity.Area_bit) { AcceptedTurnstiReport["Comment_nvc"] = "توضيحات : " + TrafficEntity.AcceptedTurnComment_nvc;// +" حومه"; } else { AcceptedTurnstiReport["Comment_nvc"] = "توضيحات : " + TrafficEntity.AcceptedTurnComment_nvc; } } else { //if (TrafficEntity.Area_bit) //{ // AcceptedTurnstiReport["Comment_nvc"] = "حومه"; //} } if (TrafficEntity.TurnPrinted_bit == true) { AcceptedTurnstiReport["PrintedAgain_nvc"] = "المثنی"; } else { AcceptedTurnstiReport["PrintedAgain_nvc"] = ""; } HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory PlatecityFactory = new HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory(); HPS.BLL.PlateCityBLL.BLLPlateCity_TKeys Platecitykey = new HPS.BLL.PlateCityBLL.BLLPlateCity_TKeys(); Platecitykey.PlateCityID_int = TrafficEntity.PlateCityID_int; HPS.BLL.PlateCityBLL.BLLPlateCity_T PlateCityEntity = new HPS.BLL.PlateCityBLL.BLLPlateCity_T(); PlateCityEntity = PlatecityFactory.GetBy(Platecitykey); if (PlateCityEntity != null) { AcceptedTurnstiReport["Number_nvc"] = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntity.NumberPlate_nvc) + " - " + PlateCityEntity.PlateCity_nvc + " " + TrafficEntity.SerialPlate_nvc; } else { AcceptedTurnstiReport["Number_nvc"] = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntity.NumberPlate_nvc) + " - " + TrafficEntity.SerialPlate_nvc; } if (TrafficEntity.LadeReturn_bit == true) { AcceptedTurnstiReport["TurnNumber"] = "برگشت از بار"; } else { if (TrafficEntity.AcceptedTurnNumber_bint.HasValue) { AcceptedTurnstiReport["TurnNumber"] = "شماره نوبت : " + TrafficEntity.AcceptedTurnNumber_bint.ToString(); } else { AcceptedTurnstiReport["TurnNumber"] = "شماره نوبت رزرو : " + TrafficEntity.TurnNumber_bint.ToString(); } } AcceptedTurnstiReport["TrafficNumber"] = " شماره قبض پارکینگ: " + TrafficEntity.TrafficNumber_bint.ToString(); AcceptedTurnstiReport["InDate_vc"] = TrafficEntity.Date_nvc; AcceptedTurnstiReport["InTime_vc"] = TrafficEntity.Time_nvc; AcceptedTurnstiReport["Time_vc"] = PortPlaceFactory.ServerTime; AcceptedTurnstiReport["Date_vc"] = PortPlaceFactory.ServerJalaliDate; AcceptedTurnstiReport["username_nvc"] = HPS.Common.CurrentUser.user.UserName_nvc; HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory laderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); string LaderTypecondition = "[LaderType_T].[LaderTypeID_int]='" + TrafficEntity.LaderTypeID_int + "'"; AcceptedTurnstiReport["@TrafficID_bint"] = TrafficEntity.TrafficID_bint; AcceptedTurnstiReport["@Condition"] = LaderTypecondition; AcceptedTurnstiReport.Render(); Properties.Settings s = new HPS.Properties.Settings(); System.Drawing.Printing.PrinterSettings PrinterSetting = new System.Drawing.Printing.PrinterSettings(); if (string.IsNullOrEmpty(s.PrinterName)) { AcceptedTurnstiReport.Print(true); } else { PrinterSetting.PrinterName = s.PrinterName; AcceptedTurnstiReport.Print(false, PrinterSetting); } this.Close(); } else if (_Traffic_bit == true && _Othercar_bit == false) { TrafficstiReport.Dictionary.Synchronize(); TrafficstiReport.Dictionary.Databases.Clear(); TrafficstiReport.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Connection", Hepsa.Core.Common.ConnectionString.ConnectionString)); TrafficstiReport.Compile(); TrafficstiReport["organ"] = new HPS.BLL.SettingsBLL.BLLSetting_TFactory().GetBy(new BLL.SettingsBLL.BLLSetting_TKeys() { SettingID_int = 1029 }).Value_nvc.ToString(); HPS.BLL.PortPlacesBLL.BLLPortPlaces_TFactory PortPlaceFactory = new HPS.BLL.PortPlacesBLL.BLLPortPlaces_TFactory(); HPS.BLL.BillMessageBLL.BLLBillMessage_TFactory BillFactory = new HPS.BLL.BillMessageBLL.BLLBillMessage_TFactory(); if (TrafficEntity.BillMessageID_int == 0 || TrafficEntity.BillMessageID_int == null) { } else { string Billcondition = "[BillMessage_T].[BillMessageID_int]=" + TrafficEntity.BillMessageID_int; List <HPS.BLL.BillMessageBLL.BLLBillMessage_T> BillLst = BillFactory.GetAllByCondition(Billcondition); if (BillLst != null) { TrafficstiReport["Messagetxt"] = BillLst[0].Message_nvc; TrafficstiReport["Message_bit"] = true; } else { TrafficstiReport["Message_bit"] = false; } } NumericTextBox txt = new NumericTextBox(); txt.DigitsInGroup = 3; if (TrafficEntity.Price_dec != null) { txt.Text = TrafficEntity.Price_dec.ToString(); TrafficstiReport["Price_nvc"] = " مبلغ دریافت شده هنگام ورود " + txt.Text + " ريال می باشد"; } if (!string.IsNullOrEmpty(TrafficEntity.AcceptedTurnComment_nvc)) { if (TrafficEntity.Area_bit) { TrafficstiReport["Comment_nvc"] = "توضيحات : " + TrafficEntity.AcceptedTurnComment_nvc;// +" حومه"; } else { TrafficstiReport["Comment_nvc"] = "توضيحات : " + TrafficEntity.AcceptedTurnComment_nvc; } } else { //if (TrafficEntity.Area_bit) //{ // TrafficstiReport["Comment_nvc"] = "حومه"; //} } if (TrafficEntity.TurnPrinted_bit == true) { TrafficstiReport["PrintedAgain_nvc"] = "المثنی"; } else { TrafficstiReport["PrintedAgain_nvc"] = ""; } HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory PlatecityFactory = new HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory(); HPS.BLL.PlateCityBLL.BLLPlateCity_TKeys Platecitykey = new HPS.BLL.PlateCityBLL.BLLPlateCity_TKeys(); Platecitykey.PlateCityID_int = TrafficEntity.PlateCityID_int; HPS.BLL.PlateCityBLL.BLLPlateCity_T PlateCityEntity = new HPS.BLL.PlateCityBLL.BLLPlateCity_T(); PlateCityEntity = PlatecityFactory.GetBy(Platecitykey); if (PlateCityEntity != null) { TrafficstiReport["Number_nvc"] = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntity.NumberPlate_nvc) + " - " + PlateCityEntity.PlateCity_nvc + " " + TrafficEntity.SerialPlate_nvc; } else { TrafficstiReport["Number_nvc"] = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntity.NumberPlate_nvc) + " - " + TrafficEntity.SerialPlate_nvc; } if (TrafficEntity.ServiceID_int == 2) { if (TrafficEntity.TurnAccepted_bit == true) { //نوبت تأیید شده داره TrafficstiReport["TurnNumber"] = "شماره نوبت : " + Convert.ToString(TrafficEntity.AcceptedTurnNumber_bint); //AcceptedDate2TextBox.Text = TrafficEntityrpt.TurnDate_nvc; //AcceptedTime2TextBox.Text = TrafficEntityrpt.TurnTime_nvc; //TurnNumber2txt.Text = TrafficEntityrpt.AcceptedTurnNumber_bint.ToString(); } else { //نوبت تأیید شده ندارد TrafficstiReport["TurnNumber"] = "شماره نوبت رزرو : " + Convert.ToString(TrafficEntity.TurnNumber_bint); } } else { // (عدم نمایش نوبت (مراجعه به غیر از نوبت TrafficstiReport["TurnNumber"] = ""; } TrafficstiReport["TrafficNumber"] = "شماره قبض پارکینگ : " + TrafficEntity.TrafficNumber_bint.ToString(); HPS.BLL.SettingsBLL.BLLSetting_TFactory settingsFactory = 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 = 1002; SettingEntity = settingsFactory.GetBy(SettingKey); if (TrafficEntity.ServiceID_int == 2) { TrafficstiReport["TAllowableHour"] = SettingEntity.Value_nvc; //TrafficEntityrpt.AllowableHour_int.ToString(); } else { TrafficstiReport["TAllowableHour"] = TrafficEntity.AllowableHour_int.ToString(); } HPS.BLL.ServicesBLL.BLLServices_TFactory servicesFactory = new HPS.BLL.ServicesBLL.BLLServices_TFactory(); HPS.BLL.ServicesBLL.BLLServices_TKeys ServicesKey = new HPS.BLL.ServicesBLL.BLLServices_TKeys(); ServicesKey.ServicesID_int = TrafficEntity.ServiceID_int; HPS.BLL.ServicesBLL.BLLServices_T ServicesEntity = new HPS.BLL.ServicesBLL.BLLServices_T(); ServicesEntity = servicesFactory.GetBy(ServicesKey); TrafficstiReport["system_nvc"] = " قبض مراجعه به : " + ServicesEntity.ServicesType_nvc; if (TrafficEntity.WithLade_bit == true) { TrafficstiReport["WithLade_nvc"] = "وضعیت : " + "با بار" + "(" + TrafficEntity.Comment_nvc + ") "; } else { TrafficstiReport["WithLade_nvc"] = "وضعیت : " + "بدون بار"; } if (TrafficEntity.TurnHour_int != null) { TrafficstiReport["TurnNumberAllert_nvc"] = " شماره نوبت شما رزرو می باشد لطفاً تا " + TrafficEntity.TurnHour_int.ToString() + " ساعت نسبت به تأیید آن اقدام نمایید"; } TrafficstiReport["InDate_vc"] = TrafficEntity.Date_nvc; TrafficstiReport["InTime_vc"] = TrafficEntity.Time_nvc; TrafficstiReport["Time_vc"] = PortPlaceFactory.ServerTime; TrafficstiReport["Date_vc"] = PortPlaceFactory.ServerJalaliDate; TrafficstiReport["username_nvc"] = HPS.Common.CurrentUser.user.UserName_nvc; HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory laderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); string LaderTypecondition = "[LaderType_T].[LaderTypeID_int]='" + TrafficEntity.LaderTypeID_int + "'"; TrafficstiReport["@TrafficID_bint"] = TrafficEntity.TrafficID_bint; TrafficstiReport["@Condition"] = LaderTypecondition; TrafficstiReport.Render(); Properties.Settings s = new HPS.Properties.Settings(); System.Drawing.Printing.PrinterSettings PrinterSetting = new System.Drawing.Printing.PrinterSettings(); if (string.IsNullOrEmpty(s.PrinterName)) { TrafficstiReport.Print(true); } else { PrinterSetting.PrinterName = s.PrinterName; TrafficstiReport.Print(false, PrinterSetting); } this.Close(); } //سواری وغیره else if (_Traffic_bit == false && _Othercar_bit == true) { //HPS.BLL.TrafficBLL.BLLTraffic_T TrafficEntityrpt = new HPS.BLL.TrafficBLL.BLLTraffic_T(); OtherCarstiReport.Dictionary.Synchronize(); OtherCarstiReport.Dictionary.Databases.Clear(); OtherCarstiReport.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Connection", Hepsa.Core.Common.ConnectionString.ConnectionString)); OtherCarstiReport.Compile(); OtherCarstiReport["organ"] = new HPS.BLL.SettingsBLL.BLLSetting_TFactory().GetBy(new BLL.SettingsBLL.BLLSetting_TKeys() { SettingID_int = 1029 }).Value_nvc.ToString(); OtherCarstiReport["DateTextBox"] = TrafficEntity.Date_nvc; OtherCarstiReport["TimeTextBox"] = TrafficEntity.Time_nvc; OtherCarstiReport["TrafficNumbertxt"] = TrafficEntity.TrafficNumber_bint.ToString(); OtherCarstiReport["Servicestxt"] = " مراجعه به : " + TrafficEntity.Services_nvc; OtherCarstiReport["CarTypetxt"] = "نوع وسیله : " + TrafficEntity.System_nvc; HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory PlateCityFactory = new HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory(); HPS.BLL.PlateCityBLL.BLLPlateCity_T PlatecityEntity = new HPS.BLL.PlateCityBLL.BLLPlateCity_T(); HPS.BLL.PlateCityBLL.BLLPlateCity_TKeys PlateCityKey = new HPS.BLL.PlateCityBLL.BLLPlateCity_TKeys(); PlateCityKey.PlateCityID_int = TrafficEntity.PlateCityID_int; PlatecityEntity = PlateCityFactory.GetBy(PlateCityKey); OtherCarstiReport["NumberPlatetxt"] = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntity.NumberPlate_nvc) + " - " + PlatecityEntity.PlateCity_nvc + " " + TrafficEntity.SerialPlate_nvc; HPS.BLL.BillMessageBLL.BLLBillMessage_TFactory BillFactory = new HPS.BLL.BillMessageBLL.BLLBillMessage_TFactory(); if (TrafficEntity.BillMessageID_int == 0 || TrafficEntity.BillMessageID_int == null) { OtherCarstiReport["Messagetxt"] = ""; } else { string Billcondition = "[BillMessage_T].[BillMessageID_int]=" + TrafficEntity.BillMessageID_int; List <HPS.BLL.BillMessageBLL.BLLBillMessage_T> BillLst = BillFactory.GetAllByCondition(Billcondition); if (BillLst != null) { OtherCarstiReport["Messagetxt"] = BillLst[0].Message_nvc; } else { OtherCarstiReport["Messagetxt"] = ""; } } NumericTextBox txt = new NumericTextBox(); txt.DigitsInGroup = 3; if (TrafficEntity.Price_dec != null) { txt.Text = TrafficEntity.Price_dec.ToString(); OtherCarstiReport["Pricetxt"] = " مبلغ دریافتی هنگام ورود " + txt.Text + " ريال می باشد"; } OtherCarstiReport["AllowableHourtxt"] = TrafficEntity.AllowableHour_int.ToString(); OtherCarstiReport["ExtraHourtxt"] = TrafficEntity.ExtraHour_int.ToString(); txt.Text = TrafficEntity.Fee_dec.ToString(); OtherCarstiReport["Feetxt"] = txt.Text; txt.Text = TrafficEntity.ExtraHourFee_dec.ToString(); OtherCarstiReport["ExtraHourFeetxt"] = txt.Text; OtherCarstiReport["UserNametxt"] = TrafficEntity.UserName_nvc; OtherCarstiReport["TrafficNumberbarcode"] = TrafficEntity.TrafficNumber_bint.ToString(); if (TrafficEntity.Printed_bit == true) { OtherCarstiReport["txtPrintedAgain"] = "المثنی"; } else { OtherCarstiReport["txtPrintedAgain"] = ""; } //DriverName_nvc OtherCarstiReport["DriverName_nvc"] = "نام راننده : " + TrafficEntity.FirstName_nvc + " " + TrafficEntity.LastName_nvc; OtherCarstiReport["Fee_dec"] = TrafficEntity.Fee_dec.ToString(); OtherCarstiReport["PriceTax_dec"] = TrafficEntity.PriceTax_dec.ToString(); OtherCarstiReport.Render(); Properties.Settings s = new HPS.Properties.Settings(); System.Drawing.Printing.PrinterSettings PrinterSetting = new System.Drawing.Printing.PrinterSettings(); if (string.IsNullOrEmpty(s.PrinterName)) { OtherCarstiReport.Print(true); } else { PrinterSetting.PrinterName = s.PrinterName; OtherCarstiReport.Print(false, PrinterSetting); } this.Close(); } //خارجی else if (_Traffic_bit == true && _Othercar_bit == true) { //HPS.BLL.TrafficBLL.BLLTraffic_T TrafficEntityrpt = new HPS.BLL.TrafficBLL.BLLTraffic_T(); ForeignCarstiReport.Dictionary.Synchronize(); ForeignCarstiReport.Dictionary.Databases.Clear(); ForeignCarstiReport.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Connection", Hepsa.Core.Common.ConnectionString.ConnectionString)); ForeignCarstiReport.Compile(); ForeignCarstiReport["organ"] = new HPS.BLL.SettingsBLL.BLLSetting_TFactory().GetBy(new BLL.SettingsBLL.BLLSetting_TKeys() { SettingID_int = 1029 }).Value_nvc.ToString(); ForeignCarstiReport["DateTextBox"] = TrafficEntity.Date_nvc; ForeignCarstiReport["TimeTextBox"] = TrafficEntity.Time_nvc; ForeignCarstiReport["TrafficNumbertxt"] = TrafficEntity.TrafficNumber_bint.ToString(); ForeignCarstiReport["DriverNametxt"] = " نام راننده : " + TrafficEntity.FirstName_nvc + " " + TrafficEntity.LastName_nvc; HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory laderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); string LaderTypecondition = "[LaderType_T].[LaderTypeID_int]='" + TrafficEntity.LaderTypeID_int + "'"; List <HPS.BLL.LaderTypeBLL.BLLLaderType_T> LaderTypeLst = laderTypeFactory.GetAllByCondition(LaderTypecondition); if (LaderTypeLst != null) { ForeignCarstiReport["CarTypetxt"] = "نوع وسيله : " + TrafficEntity.System_nvc + "- " + LaderTypeLst[0].LaderType_nvc; } if (!string.IsNullOrEmpty(TrafficEntity.SerialPlate_nvc)) { ForeignCarstiReport["NumberPlatetxt"] = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntity.NumberPlate_nvc) + " - " + TrafficEntity.SerialPlate_nvc; } else { ForeignCarstiReport["NumberPlatetxt"] = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntity.NumberPlate_nvc); } if (TrafficEntity.WithLade_bit == true) { ForeignCarstiReport["WithLadetxt"] = "وضعیت : " + "با بار" + "(" + TrafficEntity.Comment_nvc + ") "; } else { ForeignCarstiReport["WithLadetxt"] = "وضعیت : " + "بدون بار"; } NumericTextBox txt = new NumericTextBox(); txt.DigitsInGroup = 3; if (TrafficEntity.Price_dec != null) { txt.Text = TrafficEntity.Price_dec.ToString(); ForeignCarstiReport["Pricetxt"] = " مبلغ دریافتی هنگام ورود " + txt.Text + " ريال می باشد"; } ForeignCarstiReport["AllowableHourtxt"] = TrafficEntity.AllowableHour_int.ToString(); ForeignCarstiReport["ExtraHourtxt"] = TrafficEntity.ExtraHour_int.ToString(); txt.Text = TrafficEntity.Fee_dec.ToString(); ForeignCarstiReport["Feetxt"] = txt.Text; txt.Text = TrafficEntity.ExtraHourFee_dec.ToString(); ForeignCarstiReport["ExtraHourFeetxt"] = txt.Text; ForeignCarstiReport["UserNametxt"] = TrafficEntity.UserName_nvc; ForeignCarstiReport["TrafficNumberbarcode"] = TrafficEntity.TrafficNumber_bint.ToString(); if (TrafficEntity.Printed_bit == true) { ForeignCarstiReport["txtPrintedAgain"] = "المثنی"; } else { ForeignCarstiReport["txtPrintedAgain"] = ""; } ForeignCarstiReport["Fee_dec"] = TrafficEntity.Fee_dec.ToString(); ForeignCarstiReport["PriceTax_dec"] = TrafficEntity.PriceTax_dec.ToString(); ForeignCarstiReport.Render(); Properties.Settings s = new HPS.Properties.Settings(); System.Drawing.Printing.PrinterSettings PrinterSetting = new System.Drawing.Printing.PrinterSettings(); if (string.IsNullOrEmpty(s.PrinterName)) { ForeignCarstiReport.Print(true); } else { PrinterSetting.PrinterName = s.PrinterName; ForeignCarstiReport.Print(false, PrinterSetting); } this.Close(); } else if (_type == "dublicateTurns") { BLL.TrafficBLL.BLLTraffic_TFactory trafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory(); DataTable duplicateTurnDataTable = new DataTable(); trafficFactory.DuplicateTurnsReport(duplicateTurnDataTable); stiViewerControl1.Report = _sti; DuplicateTurnsReport.Dictionary.Synchronize(); DuplicateTurnsReport.Dictionary.Databases.Clear(); DuplicateTurnsReport.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Connection", Hepsa.Core.Common.ConnectionString.ConnectionString)); DuplicateTurnsReport.Compile(); DuplicateTurnsReport["organ"] = new HPS.BLL.SettingsBLL.BLLSetting_TFactory().GetBy(new BLL.SettingsBLL.BLLSetting_TKeys() { SettingID_int = 1029 }).Value_nvc.ToString(); HPS.BLL.PortPlacesBLL.BLLPortPlaces_TFactory PortPlaceFactory = new HPS.BLL.PortPlacesBLL.BLLPortPlaces_TFactory(); DuplicateTurnsReport["date_vc"] = PortPlaceFactory.ServerJalaliDate + " " + PortPlaceFactory.ServerTime;; DuplicateTurnsReport["userName_vc"] = HPS.Common.CurrentUser.user.UserName_nvc; DuplicateTurnsReport.Render(); DuplicateTurnsReport.Show(); } else if (_again == 1) { HPS.BLL.LadBillCreditBLL.BLLLadBillCredit_TFactory LadBillCreditFactory = new HPS.BLL.LadBillCreditBLL.BLLLadBillCredit_TFactory(); HPS.BLL.LadBillCreditBLL.BLLLadBillCredit_TKeys LadBillKey = new HPS.BLL.LadBillCreditBLL.BLLLadBillCredit_TKeys(); LadBillKey.LadBillCreditID_int = _LadBIillCreditID; DataTable LadBillLadeAssignmentDataTable = new DataTable(); LadBillCreditFactory.GetAllLadeAssignment(LadBillKey, ref LadBillLadeAssignmentDataTable); Stimulsoft.Report.StiReport LadBillReportstiReport = new Stimulsoft.Report.StiReport(); LadBillReportstiReport.Load(Application.StartupPath + "\\LadBillCredit.mrt"); LadBillReportstiReport.Dictionary.Synchronize(); LadBillReportstiReport.Dictionary.Databases.Clear(); LadBillReportstiReport.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Connection", Hepsa.Core.Common.ConnectionString.ConnectionString)); LadBillReportstiReport.Compile(); LadBillReportstiReport["organ"] = new HPS.BLL.SettingsBLL.BLLSetting_TFactory().GetBy(new BLL.SettingsBLL.BLLSetting_TKeys() { SettingID_int = 1029 }).Value_nvc.ToString(); if (!string.IsNullOrEmpty(LadBillLadeAssignmentDataTable.Rows[0]["DriverCardNumber_nvc"].ToString())) { LadBillReportstiReport["DriverCardNumber_vc"] = " کارت هوشمند راننده: " + LadBillLadeAssignmentDataTable.Rows[0]["DriverCardNumber_nvc"].ToString(); } else { LadBillReportstiReport["DriverCardNumber_vc"] = " کارت هوشمند راننده:فاقد كارت "; } if (!string.IsNullOrEmpty(LadBillLadeAssignmentDataTable.Rows[0]["CarCardNumber_nvc"].ToString())) { LadBillReportstiReport["CarCardNumber_vc"] = " کارت هوشمند کامیون : " + LadBillLadeAssignmentDataTable.Rows[0]["CarCardNumber_nvc"].ToString(); } else { LadBillReportstiReport["CarCardNumber_vc"] = " کارت هوشمند کامیون :فاقد كارت "; } LadBillReportstiReport["MobileNumber_vc"] = string.Format("موبایل راننده: {0}", LadBillLadeAssignmentDataTable.Rows[0]["DriverMobileNumber_nvc"].ToString()); LadBillReportstiReport["Company_nvc"] = LadBillLadeAssignmentDataTable.Rows[0]["CompanyID_intCompany_nvc"].ToString() + "(" + LadBillLadeAssignmentDataTable.Rows[0]["CompanyCode_nvc"].ToString() + ")" + "(" + LadBillLadeAssignmentDataTable.Rows[0]["Phone_nvc"].ToString() + ")"; //Cmp_nvc LadBillReportstiReport["LaderType_nvc"] = LadBillLadeAssignmentDataTable.Rows[0]["LaderTypeID_intLaderType_nvc"].ToString(); LadBillReportstiReport["Boxing_nvc"] = LadBillLadeAssignmentDataTable.Rows[0]["BoxingID_intBoxingType_nvc"].ToString(); //LaderType LadBillReportstiReport["PlateNumber_nvc"] = Hepsa.Core.Common.PersentationController.CorrectNumberPlate(LadBillLadeAssignmentDataTable.Rows[0]["NumberPlate_nvc"].ToString()) + " - " + LadBillLadeAssignmentDataTable.Rows[0]["PlateCity_nvc"].ToString() + LadBillLadeAssignmentDataTable.Rows[0]["SerialPlate_nvc"].ToString(); //Plaque LadBillReportstiReport["DriverName_nvc"] = LadBillLadeAssignmentDataTable.Rows[0]["DriverName"].ToString(); //Driver LadBillReportstiReport["LicenceNumber_bint"] = (LadBillLadeAssignmentDataTable.Rows[0]["licenceNumber_int"] != DBNull.Value?Convert.ToInt64(LadBillLadeAssignmentDataTable.Rows[0]["licenceNumber_int"]):0); //LicenceNumber LadBillReportstiReport["LicenceCity_nvc"] = LadBillLadeAssignmentDataTable.Rows[0]["LicenceCityID_intCity_nvc"].ToString(); //LicenceCity LadBillReportstiReport["Good_nvc"] = LadBillLadeAssignmentDataTable.Rows[0]["GoodID_intGood_nvc"].ToString(); //Good LadBillReportstiReport["Date_vc"] = LadBillLadeAssignmentDataTable.Rows[0]["LadingDate_nvc"].ToString(); // LadBillReportstiReport["Destination_nvc"] = LadBillLadeAssignmentDataTable.Rows[0]["CityID_intCity_nvc"].ToString() + "-" + LadBillLadeAssignmentDataTable.Rows[0]["Address_nvc"].ToString(); LadBillReportstiReport["PortajeFee_dec"] = LadBillLadeAssignmentDataTable.Rows[0]["PortageFee_dec"].ToString(); LadBillReportstiReport["AssignmentComment_nvc"] = LadBillLadeAssignmentDataTable.Rows[0]["AssignmentComment_nvc"].ToString(); LadBillReportstiReport["Date_vc"] = LadBillLadeAssignmentDataTable.Rows[0]["LadBillDate"].ToString(); LadBillReportstiReport["Time_vc"] = LadBillLadeAssignmentDataTable.Rows[0]["LadBillTime"].ToString(); LadBillReportstiReport["TurnNumber_bint"] = Convert.ToInt64(LadBillLadeAssignmentDataTable.Rows[0]["AcceptedTurnNumber_bint"]); LadBillReportstiReport["LadBillNumber_bint"] = Convert.ToInt64(LadBillLadeAssignmentDataTable.Rows[0]["LadBillCreditID_int"]); LadBillReportstiReport["UserName_nvc"] = LadBillLadeAssignmentDataTable.Rows[0]["LadBillUser"].ToString(); LadBillReportstiReport["PortPlace_nvc"] = LadBillLadeAssignmentDataTable.Rows[0]["PortPlaceID_intPortPlaces_nvc"].ToString(); LadBillReportstiReport["MinWeight_nvc"] = "از وزن: " + LadBillLadeAssignmentDataTable.Rows[0]["MinWeight_dec"]; LadBillReportstiReport["MaxWeight_nvc"] = "تا وزن: " + LadBillLadeAssignmentDataTable.Rows[0]["MaxWeight_dec"]; LadBillReportstiReport["TrafficNumber_bint"] = Convert.ToInt64(LadBillLadeAssignmentDataTable.Rows[0]["TrafficNumber_bint"]); LadBillReportstiReport["System_nvc"] = LadBillLadeAssignmentDataTable.Rows[0]["System_nvc"].ToString(); HPS.BLL.BillMessageBLL.BLLBillMessage_TFactory BillMessage_TFactory = new HPS.BLL.BillMessageBLL.BLLBillMessage_TFactory(); List <HPS.BLL.BillMessageBLL.BLLBillMessage_T> BillMessage_TList = new List <HPS.BLL.BillMessageBLL.BLLBillMessage_T>(); string Condition = string.Format("TrafficType_T.TrafficTypeID_int=9 AND [BillMessage_T].StartDate_nvc<='{0}' AND [BillMessage_T].[EndDate_nvc]>='{0}' ", BillMessage_TFactory.ServerJalaliDate); BillMessage_TList = BillMessage_TFactory.GetAllByCondition(Condition); if (BillMessage_TList != null && BillMessage_TList.Count > 0) { LadBillReportstiReport["BillMessage_nvc"] = BillMessage_TList[0].Message_nvc; } if (_again != 1) { if (LadBillLadeAssignmentDataTable.Rows[0]["LadeDate"].ToString().CompareTo(LadBillCreditFactory.ServerJalaliDate) < 0) { LadBillReportstiReport["Remained_bit"] = true; } else { LadBillReportstiReport["Remained_bit"] = false; } } if (_again == 1) { LadBillReportstiReport["Again_bit"] = true; LadBillReportstiReport["AgainPrintDate_vc"] = LadBillCreditFactory.ServerJalaliDate; LadBillReportstiReport["AgainPrintTime_vc"] = LadBillCreditFactory.ServerTime; LadBillReportstiReport["AgainPrintUser_vnc"] = HPS.Common.CurrentUser.user.UserName_nvc; } LadBillReportstiReport.Render(); Properties.Settings s = new HPS.Properties.Settings(); System.Drawing.Printing.PrinterSettings PrinterSetting = new System.Drawing.Printing.PrinterSettings(); if (string.IsNullOrEmpty(s.PrinterName)) { LadBillReportstiReport.PrinterSettings.Copies = 3; LadBillReportstiReport.Print(true); } else { LadBillReportstiReport.PrinterSettings.Copies = 3; PrinterSetting.PrinterName = s.PrinterName; LadBillReportstiReport.Print(false, PrinterSetting); } } else { stiViewerControl1.Report = _sti; } this.Close(); }
public AcceptedTurnReport(HPS.BLL.TrafficBLL.BLLTraffic_T TrafficEntityrpt) { // // Required for Windows Form Designer support // InitializeComponent(); HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory(); HPS.BLL.TrafficBLL.BLLTraffic_TKeys TrafficKey = new HPS.BLL.TrafficBLL.BLLTraffic_TKeys(); //HPS.BLL.TrafficBLL.BLLTraffic_T TrafficEntityrpt = new HPS.BLL.TrafficBLL.BLLTraffic_T(); //TrafficKey.TrafficID_bint = TrafficID_bint; //TrafficEntityrpt = TrafficFactory.GetBy(TrafficKey); AcceptedDateTextBox.Text = TrafficEntityrpt.TurnDate_nvc; AcceptedTimeTextBox.Text = TrafficEntityrpt.TurnTime_nvc; InDateTextBox.Text = TrafficEntityrpt.Date_nvc; InTimeTextBox.Text = TrafficEntityrpt.Time_nvc; InDatetext2Box.Text = TrafficEntityrpt.Date_nvc; InTimetext2Box.Text = TrafficEntityrpt.Time_nvc; DateTextBox.Text = TrafficFactory.ServerJalaliDate; TimeTextBox.Text = TrafficFactory.ServerTime; if (TrafficEntityrpt.AcceptedTurnNumber_bint.HasValue) { TurnNumber2txt.Text = "شماره نوبت : " + TrafficEntityrpt.AcceptedTurnNumber_bint.ToString(); TurnNumbertxt.Text = "شماره نوبت : " + TrafficEntityrpt.AcceptedTurnNumber_bint.ToString(); } else { TurnNumber2txt.Text = "شماره نوبت رزرو : " + TrafficEntityrpt.TurnNumber_bint.ToString(); TurnNumbertxt.Text = "شماره نوبت رزرو : " + TrafficEntityrpt.TurnNumber_bint.ToString(); } TrafficNumbertxt.Text = "شماره قبض : " + TrafficEntityrpt.TrafficNumber_bint.ToString(); TrafficNumber2txt.Text = "شماره قبض : " + TrafficEntityrpt.TrafficNumber_bint.ToString(); DriverNametxt.Text = " نام راننده : " + TrafficEntityrpt.FirstName_nvc + " " + TrafficEntityrpt.LastName_nvc; DriverName2txt.Text = " نام راننده : " + TrafficEntityrpt.FirstName_nvc + " " + TrafficEntityrpt.LastName_nvc; HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory laderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); string LaderTypecondition = "[LaderType_T].[LaderTypeID_int]='" + TrafficEntityrpt.LaderTypeID_int + "'"; List <HPS.BLL.LaderTypeBLL.BLLLaderType_T> LaderTypeLst = laderTypeFactory.GetAllByCondition(LaderTypecondition); if (LaderTypeLst != null) { CarTypetxt.Text = "نوع وسیله : " + TrafficEntityrpt.System_nvc + "- " + LaderTypeLst[0].LaderType_nvc; //+ "- کد:" + LaderTypeLst[0].LaderTypeID_int.ToString() ; CarType2txt.Text = "نوع وسیله : " + TrafficEntityrpt.System_nvc + "- " + LaderTypeLst[0].LaderType_nvc; } HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory PlatecityFactory = new HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory(); HPS.BLL.PlateCityBLL.BLLPlateCity_TKeys Platecitykey = new HPS.BLL.PlateCityBLL.BLLPlateCity_TKeys(); Platecitykey.PlateCityID_int = TrafficEntityrpt.PlateCityID_int; HPS.BLL.PlateCityBLL.BLLPlateCity_T PlateCityEntity = new HPS.BLL.PlateCityBLL.BLLPlateCity_T(); PlateCityEntity = PlatecityFactory.GetBy(Platecitykey); if (PlateCityEntity != null) { NumberPlatetxt.Text = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntityrpt.NumberPlate_nvc) + " - " + PlateCityEntity.PlateCity_nvc + " " + TrafficEntityrpt.SerialPlate_nvc; NumberPlate2txt.Text = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntityrpt.NumberPlate_nvc) + " - " + PlateCityEntity.PlateCity_nvc + " " + TrafficEntityrpt.SerialPlate_nvc; } else { NumberPlatetxt.Text = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntityrpt.NumberPlate_nvc) + " - " + TrafficEntityrpt.SerialPlate_nvc; NumberPlate2txt.Text = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntityrpt.NumberPlate_nvc) + " - " + TrafficEntityrpt.SerialPlate_nvc; } DriverCardNumbertxt.Text = "شماره كارت راننده :" + TrafficEntityrpt.DriverCardNumber_nvc; CarCardNumbertxt.Text = "شماره كارت كاميون :" + TrafficEntityrpt.CarCardNumber_nvc; HPS.BLL.BillMessageBLL.BLLBillMessage_TFactory BillFactory = new HPS.BLL.BillMessageBLL.BLLBillMessage_TFactory(); if (TrafficEntityrpt.BillMessageID_int == 0 || TrafficEntityrpt.BillMessageID_int == null) { } else { string Billcondition = "[BillMessage_T].[BillMessageID_int]=" + TrafficEntityrpt.BillMessageID_int; List <HPS.BLL.BillMessageBLL.BLLBillMessage_T> BillLst = BillFactory.GetAllByCondition(Billcondition); if (BillLst != null) { Messagetxt.Text = BillLst[0].Message_nvc; } } HamrahanSystem.TextBox.NumericTextBox txt = new HamrahanSystem.TextBox.NumericTextBox(); txt.DigitsInGroup = 3; if (TrafficEntityrpt.Price_dec != null) { txt.Text = TrafficEntityrpt.Price_dec.ToString(); Pricetxt.Text = " مبلغ دریافت شده هنگام ورود " + txt.Text + " ريال می باشد"; } UserNametxt.Text = HPS.Common.CurrentUser.user.UserName_nvc; if (!string.IsNullOrEmpty(TrafficEntityrpt.AcceptedTurnComment_nvc)) { if (TrafficEntityrpt.Area_bit) { Commenttxt.Text = "توضيحات : " + TrafficEntityrpt.AcceptedTurnComment_nvc + " حومه"; } else { Commenttxt.Text = "توضيحات : " + TrafficEntityrpt.AcceptedTurnComment_nvc; } } else { if (TrafficEntityrpt.Area_bit) { Commenttxt.Text = "حومه"; } } TrafficNumberbarcode.Text = TrafficEntityrpt.TrafficNumber_bint.ToString(); TrafficNumber_intbarcode.Text = TrafficEntityrpt.TrafficNumber_bint.ToString(); //if (!TrafficEntityrpt.DriverOffline_bit) //{ // OfflineReadtxt.Text = "آنلاین"; //} //else //{ // OfflineReadtxt.Text = "آفلاین"; //} ////////////// HPS.BLL.SettingsBLL.BLLSetting_TFactory settingsFactory = 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 = 1002; SettingEntity = settingsFactory.GetBy(SettingKey); AllowableHourtxt.Text = SettingEntity.Value_nvc; //TrafficEntityrpt.AllowableHour_int.ToString(); Feetxt.Text = txt.Text; ExtraHourtxt.Text = TrafficEntityrpt.ExtraHour_int.ToString(); //if (TrafficEntityrpt.WithFlat_bit==true) //{ //txt.Text = TrafficEntityrpt.ExtraHourFee_dec.ToString(); //} ExtraHourFeetxt.Text = TrafficEntityrpt.ExtraHourFee_dec.ToString(); ////////////// if (TrafficEntityrpt.TurnPrinted_bit == true) { this.txtPrintedAgain.Visible = true; UserNametxt.Text = Hepsa.Core.Common.CurrentUser.User.UserName_nvc; } else { this.txtPrintedAgain.Visible = false; try { TrafficKey.TrafficID_bint = TrafficEntityrpt.TrafficID_bint; TrafficEntityrpt.TurnPrinted_bit = true; TrafficFactory.BeginProc(); TrafficFactory.Update(TrafficEntityrpt, TrafficKey); TrafficFactory.CommitProc(); } catch (Exception ex) { TrafficFactory.RollBackProc(); throw ex; } } }
public TrafficReport(HPS.BLL.TrafficBLL.BLLTraffic_T TrafficEntity) { // // Required for Windows Form Designer support // InitializeComponent(); this.TrafficEntityrpt = TrafficEntity; InDateTextBox.Text = TrafficEntityrpt.Date_nvc; InTimeTextBox.Text = TrafficEntityrpt.Time_nvc; //InDatetext2Box.Text = TrafficEntityrpt.Date_nvc; //InTimetext2Box.Text = TrafficEntityrpt.Time_nvc; TrafficNumbertxt.Text = "شماره قبض : " + TrafficEntityrpt.TrafficNumber_bint.ToString(); //TrafficNumber2txt.Text = TrafficEntityrpt.TrafficNumber_bint.ToString(); //DriverName2txt.Text = " نام راننده : " + TrafficEntityrpt.FirstName_nvc + " " + TrafficEntityrpt.LastName_nvc; if (TrafficEntityrpt.ServiceID_int == 2) { if (TrafficEntityrpt.TurnAccepted_bit == true) { //نوبت تأیید شده داره TurnNumbertxt.Text = "شماره نوبت : " + Convert.ToString(TrafficEntityrpt.AcceptedTurnNumber_bint); //AcceptedDate2TextBox.Text = TrafficEntityrpt.TurnDate_nvc; //AcceptedTime2TextBox.Text = TrafficEntityrpt.TurnTime_nvc; //TurnNumber2txt.Text = TrafficEntityrpt.AcceptedTurnNumber_bint.ToString(); } else { //نوبت تأیید شده ندارد TurnNumbertxt.Text = "شماره نوبت رزرو : " + Convert.ToString(TrafficEntityrpt.TurnNumber_bint); } } else { // (عدم نمایش نوبت (مراجعه به غیر از نوبت TurnNumbertxt.Visible = false; TurnNumberAllerttxt.Visible = false; } //DriverCardNumber2txt.Text = "شماره كارت راننده :" + TrafficEntityrpt.DriverCardNumber_nvc; //CarCardNumber2txt.Text = "شماره كارت كاميون :" + TrafficEntityrpt.CarCardNumber_nvc; HPS.BLL.ServicesBLL.BLLServices_TFactory servicesFactory = new HPS.BLL.ServicesBLL.BLLServices_TFactory(); HPS.BLL.ServicesBLL.BLLServices_TKeys ServicesKey = new HPS.BLL.ServicesBLL.BLLServices_TKeys(); ServicesKey.ServicesID_int = TrafficEntity.ServiceID_int; DateTextBox.Text = servicesFactory.ServerJalaliDate; TimeTextBox.Text = servicesFactory.ServerTime; HPS.BLL.ServicesBLL.BLLServices_T ServicesEntity = new HPS.BLL.ServicesBLL.BLLServices_T(); ServicesEntity = servicesFactory.GetBy(ServicesKey); Servicestxt.Text = " قبض مراجعه به : " + ServicesEntity.ServicesType_nvc; DriverNametxt.Text = " نام راننده : " + TrafficEntityrpt.FirstName_nvc + " " + TrafficEntityrpt.LastName_nvc; HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory laderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); string LaderTypecondition = "[LaderType_T].[LaderTypeID_int]='" + TrafficEntityrpt.LaderTypeID_int + "'"; List <HPS.BLL.LaderTypeBLL.BLLLaderType_T> LaderTypeLst = laderTypeFactory.GetAllByCondition(LaderTypecondition); if (LaderTypeLst != null) { CarTypetxt.Text = "نوع وسیله : " + TrafficEntityrpt.System_nvc + "- " + LaderTypeLst[0].LaderType_nvc; //CarType2txt.Text = "نوع وسیله : " + TrafficEntityrpt.System_nvc + "- " + LaderTypeLst[0].LaderType_nvc; //+ "- کد:" + LaderTypeLst[0].LaderTypeID_int.ToString() ; } HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory PlatecityFactory = new HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory(); HPS.BLL.PlateCityBLL.BLLPlateCity_TKeys Platecitykey = new HPS.BLL.PlateCityBLL.BLLPlateCity_TKeys(); Platecitykey.PlateCityID_int = TrafficEntityrpt.PlateCityID_int; HPS.BLL.PlateCityBLL.BLLPlateCity_T PlateCityEntity = new HPS.BLL.PlateCityBLL.BLLPlateCity_T(); PlateCityEntity = PlatecityFactory.GetBy(Platecitykey); if (PlateCityEntity != null) { NumberPlatetxt.Text = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntityrpt.NumberPlate_nvc) + " - " + PlateCityEntity.PlateCity_nvc + " " + TrafficEntityrpt.SerialPlate_nvc; //NumberPlate2txt.Text = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntityrpt.NumberPlate_nvc) + " - " + PlateCityEntity.PlateCity_nvc + " " + TrafficEntityrpt.SerialPlate_nvc; } else { NumberPlatetxt.Text = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntityrpt.NumberPlate_nvc) + " - " + TrafficEntityrpt.SerialPlate_nvc; //NumberPlate2txt.Text = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntityrpt.NumberPlate_nvc) + " - " + TrafficEntityrpt.SerialPlate_nvc; } if (TrafficEntityrpt.WithLade_bit == true) { WithLadetxt.Text = "وضعیت : " + "با بار" + "(" + TrafficEntityrpt.Comment_nvc + ") "; } else { WithLadetxt.Text = "وضعیت : " + "بدون بار"; } HPS.BLL.BillMessageBLL.BLLBillMessage_TFactory BillFactory = new HPS.BLL.BillMessageBLL.BLLBillMessage_TFactory(); if (TrafficEntityrpt.BillMessageID_int == 0 || TrafficEntityrpt.BillMessageID_int == null) { } else { string Billcondition = "[BillMessage_T].[BillMessageID_int]=" + TrafficEntityrpt.BillMessageID_int; List <HPS.BLL.BillMessageBLL.BLLBillMessage_T> BillLst = BillFactory.GetAllByCondition(Billcondition); if (BillLst != null) { Messagetxt.Text = BillLst[0].Message_nvc; } } HamrahanSystem.TextBox.NumericTextBox txt = new HamrahanSystem.TextBox.NumericTextBox(); txt.DigitsInGroup = 3; if (TrafficEntityrpt.Price_dec != null) { txt.Text = TrafficEntityrpt.Price_dec.ToString(); Pricetxt.Text = " مبلغ دریافتی هنگام ورود " + txt.Text + " ريا ل می باشد"; } HPS.BLL.SettingsBLL.BLLSetting_TFactory settingsFactory = 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 = 1002; SettingEntity = settingsFactory.GetBy(SettingKey); if (TrafficEntityrpt.ServiceID_int == 2) { AllowableHourtxt.Text = SettingEntity.Value_nvc; //TrafficEntityrpt.AllowableHour_int.ToString(); } else { AllowableHourtxt.Text = TrafficEntityrpt.AllowableHour_int.ToString(); } txt.Text = TrafficEntityrpt.Fee_dec.ToString(); Feetxt.Text = txt.Text; ExtraHourtxt.Text = TrafficEntityrpt.ExtraHour_int.ToString(); //if (TrafficEntityrpt.WithFlat_bit==true) //{ //txt.Text = TrafficEntityrpt.ExtraHourFee_dec.ToString(); //} txt.Text = TrafficEntityrpt.ExtraHourFee_dec.ToString(); ExtraHourFeetxt.Text = txt.Text; UserNametxt.Text = TrafficEntityrpt.UserName_nvc; TrafficNumberbarcode.Text = TrafficEntityrpt.TrafficNumber_bint.ToString(); if (TrafficEntityrpt.TurnHour_int != null) { TurnNumberAllerttxt.Text = " شماره نوبت شما رزرو می باشد لطفاً تا " + TrafficEntityrpt.TurnHour_int.ToString() + " ساعت نسبت به تأیید آن اقدام نمایید"; } if (TrafficEntityrpt.Printed_bit == true) { this.txtPrintedAgain.Visible = true; } else { this.txtPrintedAgain.Visible = false; HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory(); try { HPS.BLL.TrafficBLL.BLLTraffic_TKeys TrafficKey = new HPS.BLL.TrafficBLL.BLLTraffic_TKeys(); TrafficKey.TrafficID_bint = TrafficEntityrpt.TrafficID_bint; TrafficEntityrpt.Printed_bit = true; TrafficFactory.BeginProc(); TrafficFactory.Update(TrafficEntityrpt, TrafficKey); TrafficFactory.CommitProc(); } catch (Exception ex) { TrafficFactory.RollBackProc(); throw ex; } } }