Ejemplo n.º 1
0
        protected override void Page_Load(object sender, EventArgs e)
        {
            base.Page_Load(sender, e);

            if (!this.IsPostBack)
            {
                litPageTitle.Text      = GetLabelText("Channel_Title");
                litChannelName.Text    = GetLabelText("Channel_ChannelName");
                txtChannelName.ToolTip = GetLabelText("Channel_ChannelName");

                if (Request.QueryString["action"] == "modify")
                {
                    //get PermissionCategoryId
                    int MenuCategoryId = Convert.ToInt32(Request.QueryString["id"]);

                    Johnny.CMS.BLL.SeH.Channel bll   = new Johnny.CMS.BLL.SeH.Channel();
                    Johnny.CMS.OM.SeH.Channel  model = new Johnny.CMS.OM.SeH.Channel();
                    model = bll.GetModel(MenuCategoryId);

                    txtChannelName.Text = model.ChannelName;

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

                //RFVldtMenuCategoryName.ErrorMessage = GetMessage("E00801", txtMenuCategoryName.MaxLength.ToString());
            }
        }
Ejemplo 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 uptName = (TextBox)row.FindControl("txtUptChannelName");

                //check name
                if (!CheckInputEmptyAndLength(uptName, "E00801", "E00802"))
                    return;

                //update
                Johnny.CMS.OM.SeH.Channel model = new Johnny.CMS.OM.SeH.Channel();
                model.ChannelId = DataConvert.GetInt32(strId);
                model.ChannelName = uptName.Text;

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

            SetMessage(GetMessage("C00003"));

            //update grid
            getData();
        }
Ejemplo n.º 3
0
        protected void btnAdd_Click(object sender, System.EventArgs e)
        {
            //check category name
            if (!CheckInputEmptyAndLength(txtChannelName, "E00801", "E00802", false))
                return;

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

            if (Request.QueryString["action"] == "modify")
            {
                //update
                model.ChannelId = Convert.ToInt32(Request.QueryString["id"]);
                model.ChannelName = txtChannelName.Text;

                bll.Update(model);
                SetMessage(GetMessage("C00003"));
            }
            else
            {
                //insert
                model.ChannelName = txtChannelName.Text;
                
                if (bll.Add(model) > 0)
                {
                    SetMessage(GetMessage("C00001"));
                    txtChannelName.Text = "";
                }
                else
                    SetMessage(GetMessage("C00002"));
            }
        }        
Ejemplo n.º 4
0
        protected override void Page_Load(object sender, EventArgs e)
        {
            base.Page_Load(sender, e);

            if (!this.IsPostBack)
            {
                litPageTitle.Text = GetLabelText("Channel_Title");
                litChannelName.Text = GetLabelText("Channel_ChannelName");
                txtChannelName.ToolTip = GetLabelText("Channel_ChannelName");

                if (Request.QueryString["action"] == "modify")
                {
                    //get PermissionCategoryId
                    int MenuCategoryId = Convert.ToInt32(Request.QueryString["id"]);

                    Johnny.CMS.BLL.SeH.Channel bll = new Johnny.CMS.BLL.SeH.Channel();
                    Johnny.CMS.OM.SeH.Channel model = new Johnny.CMS.OM.SeH.Channel();
                    model = bll.GetModel(MenuCategoryId);

                    txtChannelName.Text = model.ChannelName;

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

                //RFVldtMenuCategoryName.ErrorMessage = GetMessage("E00801", txtMenuCategoryName.MaxLength.ToString());
            }
        }
Ejemplo n.º 5
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 uptName = (TextBox)row.FindControl("txtUptChannelName");

                //check name
                if (!CheckInputEmptyAndLength(uptName, "E00801", "E00802"))
                {
                    return;
                }

                //update
                Johnny.CMS.OM.SeH.Channel model = new Johnny.CMS.OM.SeH.Channel();
                model.ChannelId   = DataConvert.GetInt32(strId);
                model.ChannelName = uptName.Text;

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

            SetMessage(GetMessage("C00003"));

            //update grid
            getData();
        }
Ejemplo n.º 6
0
 private void CreateddlChannel()
 {
     Johnny.CMS.BLL.SeH.Channel bll = new Johnny.CMS.BLL.SeH.Channel();
     ddlChannel.DataSource     = bll.GetList();
     ddlChannel.DataTextField  = "ChannelName";
     ddlChannel.DataValueField = "ChannelId";
     ddlChannel.DataBind();
 }
Ejemplo n.º 7
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.Channel bll = new Johnny.CMS.BLL.SeH.Channel();
                    bll.Delete(DataConvert.GetInt32(strId));
                }
            }

            SetMessage(GetMessage("C00005"));

            //update grid
            getData();
        }
Ejemplo n.º 8
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.Channel bll = new Johnny.CMS.BLL.SeH.Channel();
                    bll.Delete(DataConvert.GetInt32(strId));

                }
            }

            SetMessage(GetMessage("C00005"));

            //update grid
            getData();
        }
Ejemplo n.º 9
0
        protected void btnAdd_Click(object sender, System.EventArgs e)
        {
            //check category name
            if (!CheckInputEmptyAndLength(txtChannelName, "E00801", "E00802", false))
            {
                return;
            }

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

            if (Request.QueryString["action"] == "modify")
            {
                //update
                model.ChannelId   = Convert.ToInt32(Request.QueryString["id"]);
                model.ChannelName = txtChannelName.Text;

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

                if (bll.Add(model) > 0)
                {
                    SetMessage(GetMessage("C00001"));
                    txtChannelName.Text = "";
                }
                else
                {
                    SetMessage(GetMessage("C00002"));
                }
            }
        }
Ejemplo n.º 10
0
 public override void getData()
 {
     Johnny.CMS.BLL.SeH.Channel bll = new Johnny.CMS.BLL.SeH.Channel();
     myManageGridView.DataSource = bll.GetList();
     myManageGridView.DataBind();
 }        
Ejemplo n.º 11
0
 private void CreateddlChannel()
 {
     Johnny.CMS.BLL.SeH.Channel bll = new Johnny.CMS.BLL.SeH.Channel();
     ddlChannel.DataSource = bll.GetList();
     ddlChannel.DataTextField = "ChannelName";
     ddlChannel.DataValueField = "ChannelId";
     ddlChannel.DataBind();
 }
Ejemplo n.º 12
0
 public override void getData()
 {
     Johnny.CMS.BLL.SeH.Channel bll = new Johnny.CMS.BLL.SeH.Channel();
     myManageGridView.DataSource = bll.GetList();
     myManageGridView.DataBind();
 }