protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            #region Procedure
            #region Language
            switch (clsLanguage.LanguageCurrent)
            {
            case "th-TH":
                this.Title = this.Title + "กรอกใบสมัคร";
                break;

            case "en-US":
                this.Title = this.Title + "Jobs Apply";
                break;

            default:
                break;
            }
            #endregion
            if (clsDefault.URLRouting("id") != "")
            {
                DefaultBuilder(clsDefault.URLRouting("id"));
            }
            else
            {
                ucColorBox1.Redirect("/Jobs/", "เกิดข้อผิดพลาด", "ไม่พบหน้าที่คุณต้องการ");
            }
            #endregion
        }
    }
 private void BindNews()
 {
     clsDefault clsDefault = new clsDefault();
     if (!string.IsNullOrEmpty(clsDefault.URLRouting("id")))
     {
         int UID = Convert.ToInt32(clsDefault.URLRouting("id"));
         if (!string.IsNullOrEmpty(UID.ToString()))
         {
             var tbNews = from n in db.News
                          where n.UID == UID
                          select n;
             foreach (New n in tbNews)
             {
                 lblUID.Text = n.UID.ToString();
                 lblSubject.Text = n.Subject;
                 lblDetail.Text = n.Detail;
                 PicFull.ImageUrl = n.PicFull;
                 lblSiteMap.Text = n.Subject;
                 Page.MetaKeywords = n.MetaKeywords;
                 Page.MetaDescription = n.MetaDescription;
             }
         }
         else
         {
             Response.Redirect("NewsViews.aspx");
         }
     }
     else
     {
         Response.Redirect("NewsViews.aspx");
     }
 }
Exemplo n.º 3
0
    private void BindNews()
    {
        clsDefault clsDefault = new clsDefault();

        if (!string.IsNullOrEmpty(clsDefault.URLRouting("id")))
        {
            int UID = Convert.ToInt32(clsDefault.URLRouting("id"));
            if (!string.IsNullOrEmpty(UID.ToString()))
            {
                var tbNews = from n in db.News
                             where n.UID == UID
                             select n;
                foreach (New n in tbNews)
                {
                    lblUID.Text          = n.UID.ToString();
                    lblSubject.Text      = n.Subject;
                    lblDetail.Text       = n.Detail;
                    PicFull.ImageUrl     = n.PicFull;
                    lblSiteMap.Text      = n.Subject;
                    Page.MetaKeywords    = n.MetaKeywords;
                    Page.MetaDescription = n.MetaDescription;
                }
            }
            else
            {
                Response.Redirect("NewsViews.aspx");
            }
        }
        else
        {
            Response.Redirect("NewsViews.aspx");
        }
    }
Exemplo n.º 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (clsDefault.URLRouting("id") != "")
         {
             BindDefault(clsDefault.URLRouting("id"));
         }
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (clsSecurity.LoginGroup != "Admin")
            {
                ucColorBox1.Close();
            }

            if (clsDefault.URLRouting("id") != "")
            {
                if (clsDefault.URLRouting("command") == "Edit")
                {
                    ucColorBox1.SizeChange();
                    BindDetail(clsDefault.URLRouting("id"));
                }
                else if (clsDefault.URLRouting("command") == "Delete")
                {
                    Delete(clsDefault.URLRouting("id"));
                }
                else
                {
                    ucColorBox1.Redirect(webDefault, "ไม่พบหน้าเว็บที่คุณต้องการ");
                }
            }
            else
            {
                ucColorBox1.SizeChange();
            }
        }
    }
Exemplo n.º 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ucColorBox1.SizeChange();

        if (!IsPostBack)
        {
            if (clsDefault.URLRouting("doctorUID") != "" && clsDefault.URLRouting("departmentUID") != "" && clsDefault.URLRouting("medicalCenterUID") != "")
            {
                #region Variable Builder
                DateTime dttm = DateTime.Now;
                DayOfWeek = (int)dttm.DayOfWeek;

                for (int d = 0; d < 7; d++)
                {
                    int dow = (int)dttm.AddDays(d).DayOfWeek;
                    int day = dttm.AddDays(d).Day;
                    Day[dow] = day.ToString();
                }

                if (clsLanguage.LanguageCurrent == "th-TH")
                {
                    SpecialtyText  = "เชี่ยวชาญ";
                    DepartmentText = "ประจำ";
                    EducationText  = "ประวัติการศึกษา";

                    DayText[0] = "อาทิตย์";
                    DayText[1] = "จันทร์";
                    DayText[2] = "อังคาร";
                    DayText[3] = "พุธ";
                    DayText[4] = "พฤหัส";
                    DayText[5] = "ศุกร์";
                    DayText[6] = "เสาร์";
                }
                else
                {
                    SpecialtyText  = "Specialty";
                    DepartmentText = "Center";
                    EducationText  = "Education";

                    DayText[0] = "Sunday";
                    DayText[1] = "Monday";
                    DayText[2] = "Tuesday";
                    DayText[3] = "Wednesday";
                    DayText[4] = "Thursday";
                    DayText[5] = "Friday";
                    DayText[6] = "Saturday";
                }
                #endregion
                DoctorBuilder(clsDefault.URLRouting("doctorUID"), clsDefault.URLRouting("departmentUID"), clsDefault.URLRouting("medicalCenterUID"));
                DoctorScheduleBuilder(clsDefault.URLRouting("doctorUID"), clsDefault.URLRouting("departmentUID"), clsDefault.URLRouting("medicalCenterUID"));
                BindUser();
            }
            else
            {
                ucColorBox1.Close();
            }
        }
    }
 private void BindEvent()
 {
     clsDefault clsDefault = new clsDefault();
     int UID = Convert.ToInt32(clsDefault.URLRouting("id")); //Convert.ToInt32(Request.QueryString["UID"]);
     if (!string.IsNullOrEmpty(UID.ToString()))
     {
         var tbEvent = from ev in db.Events
                       where ev.UID == UID
                       select ev;
         foreach (Event ev in tbEvent)
         {
             lblUID.Text = ev.UID.ToString();
             lblSubject.Text = ev.Subject;
             lblDetail.Text = ev.Detail;
             PicFull.ImageUrl = ev.PicFull;
             lblSiteMap.Text = ev.Subject;
             Page.MetaKeywords = ev.MetaKeywords;
             Page.MetaDescription = ev.MetaDescription;
         }
     }
     else
     {
         Response.Redirect("EventView.aspx");
     }
 }
Exemplo n.º 8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (clsDefault.URLRouting("id") != "")
         {
             WebboardGroupBuilder(clsDefault.URLRouting("id"));
             WebboardQuestionImportantBuilder(clsDefault.URLRouting("id"), "I");
             WebboardQuestionBuilder(clsDefault.URLRouting("id"));
         }
         else
         {
             lblDefault.Text = "<div style='padding:10px;text-align:center;'>-</div>";
         }
     }
 }
 private void BindPromotion()
 {
     clsDefault clsDefault = new clsDefault();
     int UID = int.Parse(clsDefault.URLRouting("id"));
     if (!string.IsNullOrEmpty(UID.ToString()))
     {
         var tbPromotion = from p in db.Promotions
                         where p.UID == UID
                         select p;
         foreach (Promotion p in tbPromotion)
         {
             lblUID.Text = p.UID.ToString();
             lblSubject.Text = p.PromotionName;
             lblDetail.Text = p.Detail.Replace("'Upload/","'/Upload/");
             PicFull.ImageUrl = p.PicFull;
             lblSiteMap.Text = p.PromotionName;
             Page.MetaKeywords = p.MetaKeywords;
             Page.MetaDescription = p.MetaDescription;
         }
     }
     else
     {
         Response.Redirect("PromotionView.aspx");
     }
 }
Exemplo n.º 10
0
    private void BindPromotion()
    {
        clsDefault clsDefault = new clsDefault();
        int        UID        = int.Parse(clsDefault.URLRouting("id"));

        if (!string.IsNullOrEmpty(UID.ToString()))
        {
            var tbPromotion = from p in db.Promotions
                              where p.UID == UID
                              select p;
            foreach (Promotion p in tbPromotion)
            {
                lblUID.Text          = p.UID.ToString();
                lblSubject.Text      = p.PromotionName;
                lblDetail.Text       = p.Detail.Replace("'Upload/", "'/Upload/");
                PicFull.ImageUrl     = p.PicFull;
                lblSiteMap.Text      = p.PromotionName;
                Page.MetaKeywords    = p.MetaKeywords;
                Page.MetaDescription = p.MetaDescription;
            }
        }
        else
        {
            Response.Redirect("PromotionView.aspx");
        }
    }
Exemplo n.º 11
0
    private void BindEvent()
    {
        clsDefault clsDefault = new clsDefault();
        int        UID        = Convert.ToInt32(clsDefault.URLRouting("id")); //Convert.ToInt32(Request.QueryString["UID"]);

        if (!string.IsNullOrEmpty(UID.ToString()))
        {
            var tbEvent = from ev in db.Events
                          where ev.UID == UID
                          select ev;
            foreach (Event ev in tbEvent)
            {
                lblUID.Text          = ev.UID.ToString();
                lblSubject.Text      = ev.Subject;
                lblDetail.Text       = ev.Detail;
                PicFull.ImageUrl     = ev.PicFull;
                lblSiteMap.Text      = ev.Subject;
                Page.MetaKeywords    = ev.MetaKeywords;
                Page.MetaDescription = ev.MetaDescription;
            }
        }
        else
        {
            Response.Redirect("EventView.aspx");
        }
    }
Exemplo n.º 12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (clsSecurity.LoginChecker("admin"))
         {
             pnManage.Visible = true;
         }
         if (clsDefault.URLRouting("id") == "")
         {
             DefaultBuilder();
         }
         else
         {
             DetailBuilder(clsDefault.URLRouting("id"));
         }
     }
 }
Exemplo n.º 13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!Page.IsPostBack)
        {
            BindNews();
            BindContent();

            clsDefault clsDefault = new clsDefault();
            Response.Write(clsDefault.URLRouting("id"));
            Response.Write(clsDefault.URLRouting("name"));

            if (Security.LoginGroup == "Admin")
            {
                pnAdminButton.Visible = true;
                //btAdmin.Visible = true;
            }
        }
    }
Exemplo n.º 14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            BindNews();
            BindContent();

            clsDefault clsDefault = new clsDefault();
            Response.Write(clsDefault.URLRouting("id"));
            Response.Write(clsDefault.URLRouting("name"));

            if (Security.LoginGroup == "Admin")
            {
                pnAdminButton.Visible = true;
                //btAdmin.Visible = true;
            }
        }
    }
Exemplo n.º 15
0
    private void setDefault()
    {
        var uid = clsDefault.URLRouting("id");

        if (string.IsNullOrEmpty(uid))
        {
            return;
        }
        #region Variable
        var clsSQL = new clsSQL(clsGlobal.dbType, clsGlobal.cs);
        var dt     = new DataTable();
        var strSQL = new StringBuilder();
        #endregion
        #region Procedure
        #region SQLQuery
        strSQL.Append("SELECT ");
        strSQL.Append("Icon,Name,Detail,Content,NameEN,DetailEN,ContentEN ");
        strSQL.Append("FROM ");
        strSQL.Append("P5_ProductGroup ");
        strSQL.Append("WHERE ");
        strSQL.Append("StatusFlag='A' ");
        strSQL.Append("AND UID=@UID;");
        #endregion
        dt = clsSQL.Bind(strSQL.ToString(), new string[, ] {
            { "@UID", uid }
        });
        if (dt != null && dt.Rows.Count > 0)
        {
            productIcon = dt.Rows[0]["Icon"].ToString();
            if (clsLanguage.LanguageCurrent == "th-TH")
            {
                productName    = dt.Rows[0]["Name"].ToString();
                productDetail  = dt.Rows[0]["Detail"].ToString();
                productContent = dt.Rows[0]["Content"].ToString().Replace("../Upload/", "/Upload/");
            }
            else
            {
                productName    = dt.Rows[0]["NameEN"].ToString();
                productDetail  = dt.Rows[0]["DetailEN"].ToString();
                productContent = dt.Rows[0]["ContentEN"].ToString().Replace("../Upload/", "/Upload/");
            }

            this.Title      = productName;
            lblIcon.Text    = "<img src='" + productIcon + "' alt='" + productName + "' title='" + productName + "' style='width:100px;'/>";
            lblName.Text    = productName;
            lblDetail.Text  = productDetail;
            lblContent.Text = productContent;
        }
        else
        {
            productName = "- ไม่พบข้อมูล -";
        }
        #endregion
    }
Exemplo n.º 16
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (clsDefault.URLRouting("id") != "")
         {
             #region Bind Variable
             if (clsLanguage.LanguageCurrent == "th-TH")
             {
                 SpecialtyText  = "เชี่ยวชาญ";
                 DepartmentText = "ประจำ";
             }
             else
             {
                 SpecialtyText  = "Specialty";
                 DepartmentText = "Center";
             }
             #endregion
             BindDefault(clsDefault.URLRouting("id"));
             BindGallery(clsDefault.URLRouting("id"));
             DoctorBuilder(clsDefault.URLRouting("id"));
             PromotionBuilder(clsDefault.URLRouting("id"));
             PackageBuilder(clsDefault.URLRouting("id"));
         }
     }
 }
    private void BindArticle()
    {
        clsDefault clsDefault = new clsDefault();
        int        UID        = Convert.ToInt32(clsDefault.URLRouting("id"));

        if (!string.IsNullOrEmpty(UID.ToString()))
        {
            try
            {
                var tbArticle = from a in db.Articles
                                where a.UID == UID
                                select a;
                foreach (Article a in tbArticle)
                {
                    lblUID.Text          = a.UID.ToString();
                    lblSubject.Text      = a.Subject;
                    lblDetail.Text       = a.Detail;
                    PicFull.ImageUrl     = a.PicFull;
                    lblSiteMap.Text      = a.Subject;
                    Page.MetaKeywords    = a.MetaKeywords;
                    Page.MetaDescription = a.MetaDescription;

                    //Update View Article
                    a.NumberView       = a.NumberView + 1;
                    NumberView.Text    = a.NumberView.ToString() + " View";
                    NumberLike.Text    = a.NumberLike.ToString();
                    NumberDisLike.Text = a.NumberDislike.ToString();
                }
                db.SubmitChanges();
            }
            catch (Exception ex)
            {
                ClientScript.RegisterClientScriptBlock(this.GetType(), "Information", "alert('" + ex.ToString() + "')", true);
            }
        }
        else
        {
            Response.Redirect("ArticleView.aspx");
        }
    }
    private void BindArticle()
    {
        clsDefault clsDefault = new clsDefault();
        int UID = Convert.ToInt32(clsDefault.URLRouting("id"));
        if (!string.IsNullOrEmpty(UID.ToString()))
        {
            try
            {
                var tbArticle = from a in db.Articles
                                where a.UID == UID
                                select a;
                foreach (Article a in tbArticle)
                {
                    lblUID.Text = a.UID.ToString();
                    lblSubject.Text = a.Subject;
                    lblDetail.Text = a.Detail;
                    PicFull.ImageUrl = a.PicFull;
                    lblSiteMap.Text = a.Subject;
                    Page.MetaKeywords = a.MetaKeywords;
                    Page.MetaDescription = a.MetaDescription;

                    //Update View Article
                    a.NumberView = a.NumberView + 1;
                    NumberView.Text = a.NumberView.ToString()+" View";
                    NumberLike.Text = a.NumberLike.ToString();
                    NumberDisLike.Text = a.NumberDislike.ToString();
                }
                db.SubmitChanges();
            }
            catch (Exception ex)
            {
                ClientScript.RegisterClientScriptBlock(this.GetType(), "Information", "alert('" + ex.ToString() + "')", true);
            }
        }
        else
        {
            Response.Redirect("ArticleView.aspx");
        }
    }
Exemplo n.º 19
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (clsDefault.URLRouting("group") != "" && clsDefault.URLRouting("id") != "")
         {
             webDefault = string.Format(webDefault, clsDefault.URLRouting("group"));
             WebboardQuestionBuilder(clsDefault.URLRouting("group"), clsDefault.URLRouting("id"));
             WebboardAnswerBuilder(clsDefault.URLRouting("id"));
         }
         else
         {
             webDefault = "/Webboard/";
             ucColorBox1.Redirect(webDefault, "ไม่พบหน้าเว็บที่คุณต้องการ");
         }
     }
 }
    protected void btDisLike_Click(object sender, ImageClickEventArgs e)
    {
        clsDefault clsDefault = new clsDefault();
        int        UID        = Convert.ToInt32(clsDefault.URLRouting("id"));

        try
        {
            //var tbArticle = from a in db.Articles
            //                where a.UID == UID
            //                select a;
            //foreach (Article a in tbArticle)
            //{
            //    //Update Like Article
            //    a.NumberDislike = a.NumberDislike + 1;
            //    NumberDisLike.Text = a.NumberDislike.ToString();
            //}
            //db.SubmitChanges();
        }
        catch (Exception ex)
        {
            ClientScript.RegisterClientScriptBlock(this.GetType(), "Information", "alert('" + ex.ToString() + "')", true);
        }
    }
Exemplo n.º 21
0
    protected void Page_Load(object sender, EventArgs e)
    {
        #region Variable Builder
        DateTime dttm = DateTime.Now;
        DayOfWeek = (int)dttm.DayOfWeek;

        for (int d = 0; d < 7; d++)
        {
            int dow = (int)dttm.AddDays(d).DayOfWeek;
            int day = dttm.AddDays(d).Day;
            Day[dow] = day.ToString();
        }

        if (clsLanguage.LanguageCurrent == "th-TH")
        {
            SpecialtyText  = "เชี่ยวชาญ";
            DepartmentText = "ประจำ";
            EducationText  = "ประวัติการศึกษา";

            DayText[0] = "อาทิตย์";
            DayText[1] = "จันทร์";
            DayText[2] = "อังคาร";
            DayText[3] = "พุธ";
            DayText[4] = "พฤหัส";
            DayText[5] = "ศุกร์";
            DayText[6] = "เสาร์";
        }
        else
        {
            SpecialtyText  = "Specialty";
            DepartmentText = "Center";
            EducationText  = "Education";

            DayText[0] = "Sunday";
            DayText[1] = "Monday";
            DayText[2] = "Tuesday";
            DayText[3] = "Wednesday";
            DayText[4] = "Thursday";
            DayText[5] = "Friday";
            DayText[6] = "Saturday";
        }
        #endregion

        if (!IsPostBack)
        {
            //clsSyncer clsSyncer = new clsSyncer();
            //clsSyncer.DoctorScheduleSyncer();
            var lastUpdate = clsSQL.Return("SELECT TOP 1 CWhen FROM DoctorSchedule", dbType, cs);
            lblDetail.Text += "<div style='font-size:8pt;color:#E89D2D;'>LastUpdate : " + (!string.IsNullOrEmpty(lastUpdate) ? DateTime.Parse(lastUpdate).ToString("dd/MM/yyyy HH:mm") : "-") + "</div>";
            BindSearch();
            #region SearchByURLRouting
            //"DoctorSchedule/{name}/{special}/{dept}/{sun}/{mon}/{tue}/{wed}/{thu}/{fri}/{sat}/"
            if (clsDefault.URLRouting("sat") != "")
            {
                if (clsDefault.URLRouting("name") != "null")
                {
                    txtSearchName.Text = clsDefault.URLRouting("name");
                }
                if (clsDefault.URLRouting("special") != "null")
                {
                    ddlSearchSpecialty.SelectedValue = clsDefault.URLRouting("special");
                }
                if (clsDefault.URLRouting("dept") != "null")
                {
                    ddlSearchMedicalCenter.SelectedValue = clsDefault.URLRouting("dept");
                }
                if (clsDefault.URLRouting("sun") != "0")
                {
                    cbSearchSchedule.Items[0].Selected = true;
                }
                if (clsDefault.URLRouting("mon") != "0")
                {
                    cbSearchSchedule.Items[1].Selected = true;
                }
                if (clsDefault.URLRouting("tue") != "0")
                {
                    cbSearchSchedule.Items[2].Selected = true;
                }
                if (clsDefault.URLRouting("wed") != "0")
                {
                    cbSearchSchedule.Items[3].Selected = true;
                }
                if (clsDefault.URLRouting("thu") != "0")
                {
                    cbSearchSchedule.Items[4].Selected = true;
                }
                if (clsDefault.URLRouting("fri") != "0")
                {
                    cbSearchSchedule.Items[5].Selected = true;
                }
                if (clsDefault.URLRouting("sat") != "0")
                {
                    cbSearchSchedule.Items[6].Selected = true;
                }
            }
            #endregion
            DoctorBuilder();
        }
    }
    protected void btDisLike_Click(object sender, ImageClickEventArgs e)
    {
        clsDefault clsDefault = new clsDefault();
        int UID = Convert.ToInt32(clsDefault.URLRouting("id"));

        try
        {
            //var tbArticle = from a in db.Articles
            //                where a.UID == UID
            //                select a;
            //foreach (Article a in tbArticle)
            //{
            //    //Update Like Article
            //    a.NumberDislike = a.NumberDislike + 1;
            //    NumberDisLike.Text = a.NumberDislike.ToString();
            //}
            //db.SubmitChanges();
        }
        catch (Exception ex)
        {
            ClientScript.RegisterClientScriptBlock(this.GetType(), "Information", "alert('" + ex.ToString() + "')", true);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string id = clsDefault.URLRouting("id");

            if (!string.IsNullOrEmpty(id))
            {
                string idDecrypt = clsSecurity.Decrypt(id);
                string active    = clsSQL.Return(
                    "SELECT Active FROM [User] WHERE UID=" + parameterChar + "UID",
                    new string[, ] {
                    { parameterChar + "UID", idDecrypt }
                },
                    dbType,
                    cs);

                if (!string.IsNullOrEmpty(active))
                {
                    if (active == "0")
                    {
                        string outSQL;
                        if (clsSQL.Update(
                                "[User]",
                                new string[, ] {
                            { "Active", "'1'" }, { "MWhen", "GETDATE()" }
                        },
                                new string[, ] {
                            { "@UID", idDecrypt }
                        },
                                "UID=@UID",
                                dbType,
                                cs,
                                out outSQL))
                        {
                            #region Mail to Admin
                            string outMessage;
                            string Name = clsSQL.Return(
                                "SELECT Username FROM [User] WHERE UID=" + parameterChar + "UID",
                                new string[, ] {
                                { parameterChar + "UID", idDecrypt }
                            },
                                dbType,
                                cs);
                            clsMail clsMail = new clsMail();

                            if (!clsMail.SendTemplate(
                                    "UserRegisterConfirmAdmin",
                                    clsMail.GetEmailList("AutoSystemFrom"),
                                    clsMail.GetEmailList("AdminTo"),
                                    new string[, ] {
                                { "[Username]", Name }
                            },
                                    out outMessage))
                            {
                                ucColorBox1.Alert("เกิดข้อผิดพลาดขณะบันทึกข้อมูล", "เกิดข้อผิดพลาดขณะส่งเมล์ยืนยัน<br/>" + outMessage, AlertImage: ucColorBox.Alerts.Fail);
                                return;
                            }
                            #endregion
                            ucColorBox1.Redirect(
                                "/",
                                "ดำเนินการเสร็จสิ้น",
                                "ระบบยืนยันสถานะสมาชิกของคุณเรียบร้อยแล้ว");
                        }
                        else
                        {
                            ucColorBox1.Redirect(
                                "/",
                                "เกิดข้อผิดพลาด",
                                "ไม่พบรหัสยืนยันของคุณ");
                        }
                    }
                    else
                    {
                        ucColorBox1.Redirect(
                            "/",
                            "ดำเนินการเสร็จสิ้น",
                            "คุณเคยทำการยืนยันอีเมล์ไว้แล้ว");
                    }
                }
                else
                {
                    ucColorBox1.Redirect(
                        "/",
                        "เกิดข้อผิดพลาด",
                        "ไม่พบรหัสยืนยันของคุณ");
                }
            }
            else
            {
                ucColorBox1.Redirect(
                    "/",
                    "เกิดข้อผิดพลาด",
                    "ไม่พบรหัสยืนยันของคุณ");
            }
        }
    }
Exemplo n.º 24
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            #region WebboardConfig
            approveEnable = WebboardConfig("AnonymousEnable");
            if (approveEnable != "1")
            {
                if (!clsSecurity.LoginChecker())
                {
                    pnDetail.Visible = false;
                    lblDefault.Text  = clsDefault.AlertMessageColor("กรุณาสมัครสมาชิก หรือ ล็อคอิน ก่อนตั้งคำถาม | <a href='/Register/' target='_Blank'>คลิกที่นี่เพื่อสมัครสมาชิก</a>", clsDefault.AlertType.Info);
                    ucColorBox1.SizeChange();
                    return;
                }
            }
            #endregion

            if (clsDefault.URLRouting("group") != "")
            {
                webDefault = "/Webboard/" + clsDefault.URLRouting("group") + "/";

                #region Authorize
                if (clsSecurity.LoginChecker())
                {
                    dvAnonymous.Visible = false;
                    vadCName.Enabled    = false; vadCEmail.Enabled = false;
                }
                if (clsSecurity.LoginGroup == "Admin")
                {
                    dvAdmin.Visible = true;
                }
                #endregion

                if (clsDefault.URLRouting("id") != "")
                {
                    if (clsDefault.URLRouting("command") == "Edit")
                    {
                        vdPhoto.Enabled = false;
                        BindControl(clsDefault.URLRouting("group"));
                        BindDetail(clsDefault.URLRouting("id"));
                    }
                    else if (clsDefault.URLRouting("command") == "Delete")
                    {
                        pnDetail.Visible = false;
                        Delete(clsDefault.URLRouting("id"));
                    }
                    else if (clsDefault.URLRouting("command") == "Approve")
                    {
                        pnDetail.Visible = false;
                        Approve(clsDefault.URLRouting("id"));
                    }
                    else
                    {
                        ucColorBox1.Redirect(webDefault, "ไม่พบหน้าเว็บที่คุณต้องการ");
                    }
                }
                else
                {
                    BindControl(clsDefault.URLRouting("group"));
                }
            }
            else
            {
                ucColorBox1.Close();
            }
        }
    }
Exemplo n.º 25
0
    private void setDefault()
    {
        var uid = clsDefault.URLRouting("id");

        if (string.IsNullOrEmpty(uid))
        {
            return;
        }
        #region Variable
        var clsSQL = new clsSQL(clsGlobal.dbType, clsGlobal.cs);
        var dt     = new DataTable();
        var strSQL = new StringBuilder();
        #endregion
        #region Procedure
        #region SQLQuery
        strSQL.Append("SELECT ");
        strSQL.Append("A.Photo GroupPhoto, A.Name GroupName,A.NameEN GroupNameEN, A.Detail GroupDetail,A.DetailEN GroupDetailEN, B.PhotoPreview,B.Photo,B.Name,B.Detail ");
        strSQL.Append("FROM ");
        strSQL.Append("P5_PhotoGalleryGroup A ");
        strSQL.Append("LEFT JOIN P5_PhotoGallery B ON A.UID = B.PhotoGalleryGroupUID AND B.StatusFlag = 'A' ");
        strSQL.Append("WHERE ");
        strSQL.Append("A.StatusFlag = 'A' ");
        strSQL.Append("AND A.UID=@UID ");
        strSQL.Append("ORDER BY B.Sort;");
        #endregion
        dt = clsSQL.Bind(strSQL.ToString(), new string[, ] {
            { "@UID", uid }
        });
        if (dt != null && dt.Rows.Count > 0)
        {
            portfolioIcon = dt.Rows[0]["GroupPhoto"].ToString();
            if (clsLanguage.LanguageCurrent == "th-TH")
            {
                portfolioName   = dt.Rows[0]["GroupName"].ToString();
                portfolioDetail = dt.Rows[0]["GroupDetail"].ToString();
            }
            else
            {
                portfolioName   = dt.Rows[0]["GroupNameEN"].ToString();
                portfolioDetail = dt.Rows[0]["GroupDetailEN"].ToString();
            }

            this.Title      = portfolioName;
            lblIcon.Text    = "<img src='" + portfolioIcon + "' alt='" + portfolioName + "' title='" + portfolioName + "' style='width:100px;'/>";
            lblName.Text    = portfolioName;
            lblDetail.Text  = portfolioDetail;
            lblContent.Text = portfolioContent;

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (i % 4 == 0)
                {
                    lblContent.Text += "<br/>";
                }
                lblContent.Text += "<div style='display:inline-block;text-align:center;margin:10px 15px;'>";
                lblContent.Text += "<a href='" + dt.Rows[i]["Photo"].ToString() + "' class='cbPhoto' title='" + dt.Rows[i]["Detail"].ToString() + "'>";
                //lblContent.Text += "<img src='" + dt.Rows[i]["PhotoPreview"].ToString() + "' style='border-radius:20px;' title='" + dt.Rows[i]["Detail"].ToString() + "'/>";
                lblContent.Text += "<img src='" + dt.Rows[i]["PhotoPreview"].ToString() + "' style='' title='" + dt.Rows[i]["Detail"].ToString() + "'/>";
                //lblContent.Text += "<p style='color:#4D4D4D;font-family:thaisans_neueregular;'>" + dt.Rows[i]["Name"].ToString() + "</p>";
                lblContent.Text += "</a>";
                lblContent.Text += "</div>";
            }
        }
        else
        {
            portfolioName = "- ไม่พบข้อมูล -";
        }
        #endregion
    }