protected override void Page_Load(object sender, EventArgs e)
        {
            base.Page_Load(sender, e);

            if (!this.IsPostBack)
            {
                litPageTitle.Text              = GetLabelText("WebsiteCategory_Title");
                litWebsiteCategoryName.Text    = GetLabelText("Websitecategory_WebsiteCategoryName");
                txtWebsiteCategoryName.ToolTip = GetLabelText("Websitecategory_WebsiteCategoryName");

                if (Request.QueryString["action"] == "modify")
                {
                    //primary key
                    int WebsiteCategoryId = DataConvert.GetInt32(Request.QueryString["id"]);

                    Johnny.CMS.BLL.SeH.WebsiteCategory bll   = new Johnny.CMS.BLL.SeH.WebsiteCategory();
                    Johnny.CMS.OM.SeH.WebsiteCategory  model = new Johnny.CMS.OM.SeH.WebsiteCategory();
                    model = bll.GetModel(WebsiteCategoryId);

                    txtWebsiteCategoryName.Text = model.WebsiteCategoryName;

                    btnAdd.ButtonType = Johnny.Controls.Web.Button.Button.EnumButtonType.Save;
                    //btnAdd.Text = CONST_BUTTONTEXT_SAVE;
                }

                //RFVldtMenuCategoryName.ErrorMessage = GetMessage("E00801", txtMenuCategoryName.MaxLength.ToString());
            }
        }
Esempio n. 2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            foreach (GridViewRow row in myManageGridView.Rows)
            {
                string  strId = ((Label)row.FindControl(STR_LABEL_ID)).Text;
                TextBox uptWebsiteCategoryName = (TextBox)row.FindControl("txtUptWebsiteCategoryName");

                //validation
                if (!CheckInputEmptyAndLength(uptWebsiteCategoryName, "E00801", "E00802", false))
                {
                    return;
                }

                //update
                Johnny.CMS.OM.SeH.WebsiteCategory model = new Johnny.CMS.OM.SeH.WebsiteCategory();
                model.WebsiteCategoryId   = DataConvert.GetInt32(strId);
                model.WebsiteCategoryName = uptWebsiteCategoryName.Text;

                Johnny.CMS.BLL.SeH.WebsiteCategory bll = new Johnny.CMS.BLL.SeH.WebsiteCategory();
                bll.Update(model);
            }

            SetMessage(GetMessage("C00003"));

            //update grid
            getData();
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            foreach (GridViewRow row in myManageGridView.Rows)
            {
                string strId = ((Label)row.FindControl(STR_LABEL_ID)).Text;
                TextBox uptWebsiteCategoryName = (TextBox)row.FindControl("txtUptWebsiteCategoryName");

                //validation
                if (!CheckInputEmptyAndLength(uptWebsiteCategoryName, "E00801", "E00802", false))
                    return;

                //update
                Johnny.CMS.OM.SeH.WebsiteCategory model = new Johnny.CMS.OM.SeH.WebsiteCategory();
                model.WebsiteCategoryId = DataConvert.GetInt32(strId);
                model.WebsiteCategoryName = uptWebsiteCategoryName.Text;

                Johnny.CMS.BLL.SeH.WebsiteCategory bll = new Johnny.CMS.BLL.SeH.WebsiteCategory();
                bll.Update(model);
            }

            SetMessage(GetMessage("C00003"));

            //update grid
            getData();
        }
        protected void btnAdd_Click(object sender, System.EventArgs e)
        {
            //validation
            if (!CheckInputEmptyAndLength(txtWebsiteCategoryName, "E00801", "E00802", false))
                return;

            Johnny.CMS.BLL.SeH.WebsiteCategory bll = new Johnny.CMS.BLL.SeH.WebsiteCategory();
            Johnny.CMS.OM.SeH.WebsiteCategory model = new Johnny.CMS.OM.SeH.WebsiteCategory();

            if (Request.QueryString["action"] == "modify")
            {
                //update
                model.WebsiteCategoryId = DataConvert.GetInt32(Request.QueryString["id"]);
                model.WebsiteCategoryName = txtWebsiteCategoryName.Text;

                bll.Update(model);
                SetMessage(GetMessage("C00003"));
            }
            else
            {
                //insert
                model.WebsiteCategoryName = txtWebsiteCategoryName.Text;

                if (bll.Add(model) > 0)
                {
                    SetMessage(GetMessage("C00001"));
                    txtWebsiteCategoryName.Text = "";
                }
                else
                    SetMessage(GetMessage("C00002"));
            }
        }        
        protected override void Page_Load(object sender, EventArgs e)
        {
            base.Page_Load(sender, e);

            if (!this.IsPostBack)
            {
                litPageTitle.Text = GetLabelText("WebsiteCategory_Title");
                litWebsiteCategoryName.Text = GetLabelText("Websitecategory_WebsiteCategoryName");
                txtWebsiteCategoryName.ToolTip = GetLabelText("Websitecategory_WebsiteCategoryName");

                if (Request.QueryString["action"] == "modify")
                {
                    //primary key
                    int WebsiteCategoryId = DataConvert.GetInt32(Request.QueryString["id"]);

                    Johnny.CMS.BLL.SeH.WebsiteCategory bll = new Johnny.CMS.BLL.SeH.WebsiteCategory();
                    Johnny.CMS.OM.SeH.WebsiteCategory model = new Johnny.CMS.OM.SeH.WebsiteCategory();
                    model = bll.GetModel(WebsiteCategoryId);

                    txtWebsiteCategoryName.Text = model.WebsiteCategoryName;

                    btnAdd.ButtonType = Johnny.Controls.Web.Button.Button.EnumButtonType.Save;
                    //btnAdd.Text = CONST_BUTTONTEXT_SAVE;
                }

                //RFVldtMenuCategoryName.ErrorMessage = GetMessage("E00801", txtMenuCategoryName.MaxLength.ToString());
            }
        }
Esempio n. 6
0
 private void CreateddlCategory()
 {
     Johnny.CMS.BLL.SeH.WebsiteCategory category = new Johnny.CMS.BLL.SeH.WebsiteCategory();
     ddlCategory.DataSource = category.GetList();
     ddlCategory.DataTextField = "WebsiteCategoryName";
     ddlCategory.DataValueField = "WebsiteCategoryId";
     ddlCategory.DataBind();
 }
Esempio n. 7
0
 private void CreateddlCategory()
 {
     Johnny.CMS.BLL.SeH.WebsiteCategory category = new Johnny.CMS.BLL.SeH.WebsiteCategory();
     ddlCategory.DataSource     = category.GetList();
     ddlCategory.DataTextField  = "WebsiteCategoryName";
     ddlCategory.DataValueField = "WebsiteCategoryId";
     ddlCategory.DataBind();
 }
Esempio n. 8
0
        public override void getData()
        {
            Johnny.CMS.BLL.SeH.WebsiteCategory category = new Johnny.CMS.BLL.SeH.WebsiteCategory();
            categoryList = category.GetList();

            Johnny.CMS.BLL.SeH.Website website = new Johnny.CMS.BLL.SeH.Website();
            myManageGridView.DataSource = website.GetList();
            myManageGridView.DataBind();
        }
Esempio n. 9
0
        public override void getData()
        {
            Johnny.CMS.BLL.SeH.WebsiteCategory category = new Johnny.CMS.BLL.SeH.WebsiteCategory();
            categoryList = category.GetList();

            Johnny.CMS.BLL.SeH.Website website = new Johnny.CMS.BLL.SeH.Website();
            myManageGridView.DataSource = website.GetList();
            myManageGridView.DataBind();
        }
Esempio n. 10
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            foreach (GridViewRow row in myManageGridView.Rows)
            {
                TableCell cell = row.Cells[0];
                Johnny.Controls.Web.CheckBox.CheckBox chkSelect = (Johnny.Controls.Web.CheckBox.CheckBox)cell.FindControl("chkSelect");
                if (chkSelect.Checked)
                {
                    string strId = ((Label)row.FindControl(STR_LABEL_ID)).Text;

                    //delete
                    Johnny.CMS.BLL.SeH.WebsiteCategory bll = new Johnny.CMS.BLL.SeH.WebsiteCategory();
                    bll.Delete(DataConvert.GetInt32(strId));
                }
            }

            SetMessage(GetMessage("C00005"));

            //update grid
            getData();
        }
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            foreach (GridViewRow row in myManageGridView.Rows)
            {
                TableCell cell = row.Cells[0];
                Johnny.Controls.Web.CheckBox.CheckBox chkSelect = (Johnny.Controls.Web.CheckBox.CheckBox)cell.FindControl("chkSelect");
                if (chkSelect.Checked)
                {
                    string strId = ((Label)row.FindControl(STR_LABEL_ID)).Text;

                    //delete
                    Johnny.CMS.BLL.SeH.WebsiteCategory bll = new Johnny.CMS.BLL.SeH.WebsiteCategory();
                    bll.Delete(DataConvert.GetInt32(strId));

                }
            }

            SetMessage(GetMessage("C00005"));

            //update grid
            getData();
        }
Esempio n. 12
0
        protected void btnAdd_Click(object sender, System.EventArgs e)
        {
            //validation
            if (!CheckInputEmptyAndLength(txtWebsiteCategoryName, "E00801", "E00802", false))
            {
                return;
            }

            Johnny.CMS.BLL.SeH.WebsiteCategory bll   = new Johnny.CMS.BLL.SeH.WebsiteCategory();
            Johnny.CMS.OM.SeH.WebsiteCategory  model = new Johnny.CMS.OM.SeH.WebsiteCategory();

            if (Request.QueryString["action"] == "modify")
            {
                //update
                model.WebsiteCategoryId   = DataConvert.GetInt32(Request.QueryString["id"]);
                model.WebsiteCategoryName = txtWebsiteCategoryName.Text;

                bll.Update(model);
                SetMessage(GetMessage("C00003"));
            }
            else
            {
                //insert
                model.WebsiteCategoryName = txtWebsiteCategoryName.Text;

                if (bll.Add(model) > 0)
                {
                    SetMessage(GetMessage("C00001"));
                    txtWebsiteCategoryName.Text = "";
                }
                else
                {
                    SetMessage(GetMessage("C00002"));
                }
            }
        }
Esempio n. 13
0
 public override void getData()
 {
     Johnny.CMS.BLL.SeH.WebsiteCategory bll = new Johnny.CMS.BLL.SeH.WebsiteCategory();
     myManageGridView.DataSource = bll.GetList();
     myManageGridView.DataBind();
 }
 public override void getData()
 {
     Johnny.CMS.BLL.SeH.WebsiteCategory bll = new Johnny.CMS.BLL.SeH.WebsiteCategory();
     myManageGridView.DataSource = bll.GetList();
     myManageGridView.DataBind();
 }