Пример #1
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();
        }
Пример #2
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"));
            }
        }        
Пример #3
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();
        }
Пример #4
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"));
                }
            }
        }