示例#1
0
        protected void uiLinkButtonSummary_Click(object sender, EventArgs e)
        {
            TicketInfo tickets = new TicketInfo();
            DateTime from, to;
            from = DateTime.TryParseExact(uiTextBoxFromDate.Text, "MM/dd/yyyy", null, System.Globalization.DateTimeStyles.None, out from) ? from : new DateTime(1900, 1, 1);
            to = DateTime.TryParseExact(uiTextBoxToDate.Text, "MM/dd/yyyy", null, System.Globalization.DateTimeStyles.None, out to) ? to : new DateTime(8000, 12, 31);

            tickets.RPT_Summary(from, to);

            uiReportViewerMain.Reset();
            uiReportViewerMain.LocalReport.ReportPath = "ReportsFiles/summary.rdlc";
            uiReportViewerMain.LocalReport.DataSources.Clear();
            uiReportViewerMain.LocalReport.DataSources.Add(new ReportDataSource("SummaryDataSet", tickets.DefaultView));
            uiReportViewerMain.LocalReport.Refresh();
        }
        private void SendSMS(TicketInfo Ticket)
        {
            Passenger passenger = new Passenger();
            passenger.LoadByPrimaryKey(Ticket.PassengerID);

            AirPort to = new AirPort();
            to.LoadByPrimaryKey(Ticket.To_AirportID);
            using (var wb = new WebClient())
            {
                var data = new NameValueCollection();

                data["username"] = "******";
                data["password"] = "******";
                data["message"] = string.Format(GetLocalResourceObject("SMSBody").ToString(), Ticket.TicketNo, to.Name);
                data["numbers"] = passenger.Mobile;
                data["sender"] = GetLocalResourceObject("SenderName").ToString();
                data["retrun"] = "Json";
                data["Rmduplicated"] = "1";

                string url = "http://www.4jawaly.net/api/sendsms.php";

                byte[] ServerResponse = wb.UploadValues(url, "POST", data);
                string responsetext = Encoding.ASCII.GetString(ServerResponse);
                if (responsetext != "100")
                {

                }
                else
                {

                }

            }
        }
 private void LoadAllTickets()
 {
     TicketInfo tickets = new TicketInfo();
     tickets.SearchTickets(uiTextBoxSearch.Text);
     uiGridViewTickets.DataSource = tickets.DefaultView;
     uiGridViewTickets.DataBind();
 }
        protected void uiLinkButtonSave_Click(object sender, EventArgs e)
        {
            TicketInfo Ticket = new TicketInfo();
            TicketHistory History = new TicketHistory();
            int seatno = 0;
            decimal actualprice, finalprice, addedvalue, addedpercentage = 0;
            History.AddNew();
            if (CurrentTicket == null)
            {
                Ticket.AddNew();
                Ticket.CreatedDate = DateTime.Now;
            }
            else
            {
                Ticket = CurrentTicket;
            }
            Ticket.From_AirportID = History.From_AirportID = Convert.ToInt32(uiDropDownListFrom.SelectedValue);
            Ticket.To_AirportID = History.To_AirportID = Convert.ToInt32(uiDropDownListTo.SelectedValue);
            Ticket.AirLineID = History.AirLineID = Convert.ToInt32(uiDropDownListAirLine.SelectedValue);
            Ticket.PassengerID = Convert.ToInt32(uiDropDownListCustomer.SelectedValue);
            Ticket.CreditCardID = Convert.ToInt32(uiDropDownListCreditCard.SelectedValue);
            Ticket.TicketNo = uiTextBoxTicketNo.Text;
            Ticket.FlightNo = History.FlightNo = uiTextBoxFlightNo.Text;
            int.TryParse(uiTextBoxSeatNo.Text, out seatno);
            Ticket.SeatNo = History.SeatNo = seatno;
            Ticket.Cabin_type = History.Cabin_type = uiDropDownListCabinType.SelectedItem.Text;
            decimal.TryParse(uiTextBoxFinalPrice.Text, out finalprice);
            decimal.TryParse(uiTextBoxActualPrice.Text, out actualprice);
            decimal.TryParse(uiTextBoxAddedValue.Text, out addedvalue);
            decimal.TryParse(uiTextBoxAddedPercentage.Text, out addedpercentage);
            Ticket.ActualPrice = History.ActualPrice = actualprice;
            Ticket.FinalPrice = History.FinalPrice = finalprice;
            Ticket.AddedValue = History.AddedValue = addedvalue;
            Ticket.AddedPercentage = History.AddedPercentage = addedpercentage;

            Ticket.TicketStatusID = History.TicketStatusID = Convert.ToInt32(uiDropDownListStatus.SelectedValue);

            Ticket.FromDate = History.FromDate = DateTime.ParseExact(uiTextBoxFromDate.Text, "MM/dd/yyyy hh:mm", null);
            Ticket.Save();

            if (Ticket.TicketStatusID == 2) // confirmed
            {
                SendSMS(Ticket);
            }
            History.TicketID = Ticket.TicketID;
            History.UpdatedDate = DateTime.Now;
            History.Save();
            LoadAllTickets();
            uiPanelAll.Visible = true;
            uiPanelEdit.Visible = false;
            ClearFields();
            CurrentTicket = null;
        }
        protected void uiLinkButtonPrint_Click(object sender, EventArgs e)
        {
            TicketInfo ticket = new TicketInfo();
            ticket.RPT_GetTicketInfo(CurrentTicket.TicketID);

            uiReportViewerMain.Reset();
            uiReportViewerMain.LocalReport.ReportPath = "ReportsFiles/TicketInfo.rdlc";
            uiReportViewerMain.LocalReport.DataSources.Clear();
            uiReportViewerMain.LocalReport.DataSources.Add(new ReportDataSource("InfoDataSet", CurrentTicket.DefaultView));
            uiReportViewerMain.LocalReport.Refresh();
        }
 protected void uiLinkButtonCancel_Click(object sender, EventArgs e)
 {
     uiPanelAll.Visible = true;
     uiPanelEdit.Visible = false;
     ClearFields();
     CurrentTicket = null;
 }
 protected void uiLinkButtonAdd_Click(object sender, EventArgs e)
 {
     uiPanelAll.Visible = false;
     uiPanelEdit.Visible = true;
     ClearFields();
     CurrentTicket = null;
     uiGridViewHistory.DataSource = null;
     uiGridViewHistory.DataBind();
 }
 protected void uiGridViewTickets_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "EditR")
     {
         TicketInfo ticket = new TicketInfo();
         ticket.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));
         CurrentTicket = ticket;
         uiDropDownListFrom.SelectedValue = ticket.From_AirportID.ToString();
         uiDropDownListTo.SelectedValue = ticket.To_AirportID.ToString();
         uiDropDownListAirLine.SelectedValue = ticket.AirLineID.ToString();
         uiDropDownListCustomer.SelectedValue = ticket.PassengerID.ToString();
         uiDropDownListCreditCard.SelectedValue = ticket.CreditCardID.ToString();
         uiTextBoxTicketNo.Text =ticket.TicketNo;
         uiTextBoxActualPrice.Text = ticket.ActualPrice.ToString();
         uiTextBoxFinalPrice.Text = ticket.FinalPrice.ToString();
         uiTextBoxAddedValue.Text = ticket.AddedValue.ToString();
         uiTextBoxAddedPercentage.Text = ticket.AddedPercentage.ToString();
         uiDropDownListStatus.SelectedValue = ticket.TicketStatusID.ToString();
         uiTextBoxFromDate.Text = ticket.FromDate.ToString("MM/dd/yyyy hh:mm");
         uiDropDownListCabinType.SelectedValue = ticket.Cabin_type;
         LoadHistory();
         uiPanelAll.Visible = false;
         uiPanelEdit.Visible = true;
     }
     else if (e.CommandName == "SendSMS")
     {
         TicketInfo ticket = new TicketInfo();
         ticket.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));
         SendSMS(ticket);
     }
 }
示例#9
0
        protected void uiLinkButtonTicketsCC_Click(object sender, EventArgs e)
        {
            TicketInfo tickets = new TicketInfo();
            DateTime from, to;
            from = DateTime.TryParseExact(uiTextBoxFromDate.Text, "MM/dd/yyyy", null, System.Globalization.DateTimeStyles.None, out from) ? from : new DateTime(1900, 1, 1);
            to = DateTime.TryParseExact(uiTextBoxToDate.Text, "MM/dd/yyyy", null, System.Globalization.DateTimeStyles.None, out to) ? to : new DateTime(8000, 12, 31);

            tickets.RPT_GetTickets_ByCreditCardID(from, to, Convert.ToInt32( uiDropDownListCC.SelectedValue));

            uiReportViewerMain.Reset();
            uiReportViewerMain.LocalReport.ReportPath = "ReportsFiles/TotalTicketsCC.rdlc";
            uiReportViewerMain.LocalReport.DataSources.Clear();
            uiReportViewerMain.LocalReport.SetParameters(new ReportParameter("CCNumber", uiDropDownListCC.SelectedItem.Text));
            uiReportViewerMain.LocalReport.DataSources.Add(new ReportDataSource("CCDataSet", tickets.DefaultView));
            uiReportViewerMain.LocalReport.Refresh();
        }
示例#10
0
        protected void uiLinkButtonTotalCanceledNotRefended_Click(object sender, EventArgs e)
        {
            TicketInfo tickets = new TicketInfo();
            DateTime from, to;
            from = DateTime.TryParseExact(uiTextBoxFromDate.Text, "MM/dd/yyyy", null, System.Globalization.DateTimeStyles.None, out from) ? from : new DateTime(1900, 1, 1);
            to = DateTime.TryParseExact(uiTextBoxToDate.Text, "MM/dd/yyyy", null, System.Globalization.DateTimeStyles.None, out to) ? to : new DateTime(8000, 12, 31);

            tickets.RPT_GetTicketsByStatusID(from, to,3);

            uiReportViewerMain.Reset();
            uiReportViewerMain.LocalReport.ReportPath = "ReportsFiles/CanceledPendingRefunded.rdlc";
            uiReportViewerMain.LocalReport.DataSources.Clear();
            uiReportViewerMain.LocalReport.DataSources.Add(new ReportDataSource("CanceledPendingRefundedDataSet", tickets.DefaultView));
            uiReportViewerMain.LocalReport.Refresh();
        }