コード例 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request.QueryString["TID"] != null && !string.IsNullOrEmpty(Request.QueryString["TID"]))
         {
             uiPanelAllLists.Visible = false;
             uiPanelViewTourismList.Visible = true;
             int id = Convert.ToInt32(Request.QueryString["TID"].ToString());
             DBLayer db = new DBLayer();
             DataSet ds = new DataSet();
             ds = db.GetTourismlistContent(id);
             uiImageTourismList.ImageUrl = ds.Tables[0].Rows[0]["arImagePath"].ToString();
             uiLabelTitle.Text = ds.Tables[0].Rows[0]["arTitle"].ToString();
             uiLiteralBrief.Text = ds.Tables[0].Rows[0]["arBrief"].ToString();
             uiLiteralContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["arContent"].ToString());
         }
         else
         {
             uiPanelAllLists.Visible = true;
             uiPanelViewTourismList.Visible = false;
             BindData();
         }
     }
     RegisterStartupScript("menu", "<script type='text/javascript'>$(\"#m3\").addClass(\"selected\");</script>");
 }
コード例 #2
0
        protected void uiLinkButtonSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                int id = Convert.ToInt32(Request.QueryString["TID"].ToString());
                DBLayer db = new DBLayer();
                DataSet ds = new DataSet();
                ds = db.GetTourismlistContent(id);

                MailMessage msg = new MailMessage();
                DataSet to = db.GetAllMails();
                foreach (DataRow item in to.Tables[0].Rows)
                {
                    msg.To.Add(item["Email"].ToString());
                }

                //msg.To.Add("*****@*****.**");
                msg.From = new MailAddress("*****@*****.**");
                //msg.From = new MailAddress("*****@*****.**");

                msg.Subject = " Email from booking page";
                msg.IsBodyHtml = true;
                msg.BodyEncoding = System.Text.Encoding.Unicode;

                msg.Body = " الإسم : " + uiDropDownListTitle.Text + " " + uiTextBoxName.Text;
                msg.Body += "<br/> البريد الإلكترونى : " + uiTextBoxEmail.Text;
                msg.Body += "<br/> الشارع : " + uiTextBoxStreet.Text;
                msg.Body += "<br/> المدينة : " + uiTextBoxCity.Text;
                msg.Body += "<br/> الرقم البريدى : " + uiTextBoxPostalCode.Text;
                msg.Body += "<br/> البلد : " + uiTextBoxCountry.Text;
                msg.Body += "<br/> التليفون : " + uiTextBoxTelephone.Text;
                msg.Body += "<br/> الموبايل : " + uiTextBoxMobile.Text;
                msg.Body += "<br/> إسم الرحلة : " + ds.Tables[0].Rows[0]["Title"].ToString();
                msg.Body += "<br/> تفاصيل  الرحلة : " + Server.HtmlDecode(ds.Tables[0].Rows[0]["Content"].ToString());

                msg.Body += "<br/> الرابط على الموقع : " + Request.Url;

                SmtpClient client = new SmtpClient("mail.obtravel-eg.com", 25);
                //SmtpClient client = new SmtpClient("smtp.gmail.com", 587);
                //client.EnableSsl = true;
                client.UseDefaultCredentials = false;
                //client.EnableSsl = true;
                client.Credentials = new System.Net.NetworkCredential("*****@*****.**", "obtravelmail");
                //client.Credentials = new System.Net.NetworkCredential("*****@*****.**", "********");
                client.Send(msg);
                uiLabelMessage.Visible = true;
            }
            catch (Exception ex)
            {
                uiLabelMessage.Visible = true;
                uiLabelMessage.Text = ex.Message;
            }
        }
コード例 #3
0
 protected void uiLinkButtonUpdate_Click(object sender, EventArgs e)
 {
     DBLayer db = new DBLayer();
     string imagepath = "";
     if (uiFileUploadImage.HasFile)
     {
         uiFileUploadImage.SaveAs(Server.MapPath(ConfigurationManager.AppSettings["UserFilePath"] + "UploadedImages/" + uiFileUploadImage.FileName));
         imagepath = ConfigurationManager.AppSettings["UserFilePath"] + "UploadedImages/" + uiFileUploadImage.FileName;
     }
     // update
     if (CurrentList != 0)
     {
         DataSet ds = new DataSet();
         ds = db.GetTourismlistContent(CurrentList);
         string temp = ds.Tables[0].Rows[0]["Imagepath"].ToString();
         if (temp != imagepath && string.IsNullOrEmpty(imagepath))
             db.SetEnglishTourismContent(CurrentList, uiTextBoxBrief.Text, Server.HtmlEncode(uiFCKeditorContent.Value), uiTextBoxTitle.Text, temp, Convert.ToInt32(uiTextBoxOrder.Text), ParentPackage, uiCheckBoxViewInWeb.Checked);
         else
             db.SetEnglishTourismContent(CurrentList, uiTextBoxBrief.Text, Server.HtmlEncode(uiFCKeditorContent.Value), uiTextBoxTitle.Text, imagepath, Convert.ToInt32(uiTextBoxOrder.Text), ParentPackage, uiCheckBoxViewInWeb.Checked);
     }
     else // add new
     {
         db.AddEnglishTourismlistContent(uiTextBoxBrief.Text, Server.HtmlEncode(uiFCKeditorContent.Value), uiTextBoxTitle.Text, imagepath, Convert.ToInt32(uiTextBoxOrder.Text), ParentPackage, uiCheckBoxViewInWeb.Checked);
     }
     uiPanelViewLists.Visible = true;
     uiPanelEditTourismList.Visible = false;
     ClearFields();
     CurrentList = 0;
     BindData();
 }
コード例 #4
0
 protected void uiRepeaterTourismLists_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     if (e.CommandName == "EditList")
     {
         CurrentList = Convert.ToInt32(e.CommandArgument.ToString());
         DBLayer db = new DBLayer();
         DataSet ds = new DataSet();
         ds = db.GetTourismlistContent(CurrentList);
         uiTextBoxBrief.Text = ds.Tables[0].Rows[0]["Brief"].ToString();
         uiTextBoxOrder.Text = ds.Tables[0].Rows[0]["Order"].ToString();
         uiTextBoxTitle.Text = ds.Tables[0].Rows[0]["Title"].ToString();
         uiCheckBoxViewInWeb.Checked = (bool)ds.Tables[0].Rows[0]["ViewInWeb"];
         uiFCKeditorContent.Value = Server.HtmlDecode(ds.Tables[0].Rows[0]["Content"].ToString());
         if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["Imagepath"].ToString()))
         {
             uiImageCurrent.ImageUrl = ds.Tables[0].Rows[0]["Imagepath"].ToString();
             uiImageCurrent.Visible = true;
         }
         else
         {
             uiImageCurrent.Visible = false;
         }
         uiPanelViewLists.Visible = false;
         uiPanelEditTourismList.Visible = true;
     }
     else if (e.CommandName == "DeleteList")
     {
         DBLayer db = new DBLayer();
         db.DeleteTourismList(Convert.ToInt32(e.CommandArgument.ToString()));
         BindData();
     }
 }