Пример #1
0
 protected void uiGridViewCustomers_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "EditR")
     {
         Passenger passenger = new Passenger();
         passenger.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));
         CurrentCustomer = passenger;
         uiTextBoxFN.Text = passenger.FirstName;
         uiTextBoxLN.Text = passenger.LastName;
         uiTextBoxMail.Text = passenger.Email;
         uiTextBoxMobile.Text = passenger.Mobile;
         uiDropDownListTitle.SelectedValue = passenger.TitleID.ToString();
         uiPanelAll.Visible = false;
         uiPanelEdit.Visible = true;
     }
     else if (e.CommandName == "DeleteR")
     {
         Passenger passenger = new Passenger();
         passenger.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));
         passenger.MarkAsDeleted();
         passenger.Save();
         LoadAllCustomers();
     }
 }
Пример #2
0
 protected void uiLinkButtonAdd_Click(object sender, EventArgs e)
 {
     uiPanelAll.Visible = false;
     uiPanelEdit.Visible = true;
     ClearFields();
     CurrentCustomer = null;
 }
Пример #3
0
 private void LoadAllCustomers()
 {
     Passenger customers = new Passenger();
     customers.SearchCustomers(uiTextBoxSearch.Text);
     uiGridViewCustomers.DataSource = customers.DefaultView;
     uiGridViewCustomers.DataBind();
 }
Пример #4
0
 protected void uiLinkButtonSave_Click(object sender, EventArgs e)
 {
     Passenger customer = new Passenger();
     if (CurrentCustomer == null)
         customer.AddNew();
     else
         customer = CurrentCustomer;
     customer.FirstName = uiTextBoxFN.Text;
     customer.LastName = uiTextBoxLN.Text;
     customer.Email = uiTextBoxMail.Text;
     customer.Mobile = uiTextBoxMobile.Text;
     customer.TitleID = Convert.ToInt32(uiDropDownListTitle.SelectedValue);
     customer.Save();
     LoadAllCustomers();
     uiPanelAll.Visible = true;
     uiPanelEdit.Visible = false;
     ClearFields();
     CurrentCustomer = null;
 }
Пример #5
0
        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
                {

                }

            }
        }
Пример #6
0
        private void LoadDDLs()
        {
            Passenger customers = new Passenger();
            customers.LoadAll();
            customers.AddColumn("DisplayName", typeof(string));
            for (int i = 0; i < customers.RowCount; i++)
            {
                customers.SetColumn("DisplayName", customers.FirstName + " " + customers.LastName);
                customers.MoveNext();
            }
            uiDropDownListCustomer.DataSource = customers.DefaultView;
            uiDropDownListCustomer.DataTextField = "DisplayName";
            uiDropDownListCustomer.DataValueField = Passenger.ColumnNames.PassengerID;
            uiDropDownListCustomer.DataBind();

            AirLine AirLines = new AirLine();
            AirLines.LoadAll();
            uiDropDownListAirLine.DataSource = AirLines.DefaultView;
            uiDropDownListAirLine.DataTextField = AirLine.ColumnNames.Name;
            uiDropDownListAirLine.DataValueField = AirLine.ColumnNames.AirLineID;
            uiDropDownListAirLine.DataBind();

            AirPort Airports = new AirPort();
            Airports.LoadAll();
            uiDropDownListFrom.DataSource = Airports.DefaultView;
            uiDropDownListFrom.DataTextField = AirPort.ColumnNames.IATACode;
            uiDropDownListFrom.DataValueField = AirPort.ColumnNames.AirPortID;
            uiDropDownListFrom.DataBind();

            uiDropDownListTo.DataSource = Airports.DefaultView;
            uiDropDownListTo.DataTextField = AirPort.ColumnNames.IATACode;
            uiDropDownListTo.DataValueField = AirPort.ColumnNames.AirPortID;
            uiDropDownListTo.DataBind();

            CreditCard cards = new CreditCard();
            cards.LoadAll();
            uiDropDownListCreditCard.DataSource = cards.DefaultView;
            uiDropDownListCreditCard.DataTextField = CreditCard.ColumnNames.CardNumber;
            uiDropDownListCreditCard.DataValueField = CreditCard.ColumnNames.CreditCardID;
            uiDropDownListCreditCard.DataBind();

            TicketStatus status = new TicketStatus();
            status.LoadAll();
            uiDropDownListStatus.DataSource = status.DefaultView;
            if (Session["CurrentCulture"].ToString() == "ar-EG")
                uiDropDownListStatus.DataTextField = TicketStatus.ColumnNames.ArName;
            else
                uiDropDownListStatus.DataTextField = TicketStatus.ColumnNames.EnName;
            uiDropDownListStatus.DataValueField = TicketStatus.ColumnNames.TicketStatusID;
            uiDropDownListStatus.DataBind();
        }
 private void LoadDDLs()
 {
     Passenger customers = new Passenger();
     customers.LoadAll();
     customers.AddColumn("DisplayName", typeof(string));
     for (int i = 0; i < customers.RowCount; i++)
     {
         customers.SetColumn("DisplayName", customers.FirstName + " " + customers.LastName);
         customers.MoveNext();
     }
     uiDropDownListCustomer.DataSource = customers.DefaultView;
     uiDropDownListCustomer.DataTextField = "DisplayName";
     uiDropDownListCustomer.DataValueField = Passenger.ColumnNames.PassengerID;
     uiDropDownListCustomer.DataBind();
 }