Example #1
0
        protected void LoadData(string PicId)
        {
            Model.tPictureType m = BLL.GetModel(Convert.ToInt32(PicId));
            if (m == null)
            {
                Alert.ShowInTop("出错了!"); return;
            }

            txtRoleName.Text = m.Name;
            txtRemark.Text   = m.Remark;
        }
Example #2
0
        protected void btnSaveClose_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["PicId"]))
            {
                string             PicId = Request.QueryString["PicId"];
                Model.tPictureType m     = BLL.GetModel(Convert.ToInt32(PicId));
                if (m == null)
                {
                    return;
                }

                m.Name   = txtRoleName.Text.Trim();
                m.Remark = txtRemark.Text.Trim();



                if (BLL.Update(m) == true)
                {
                    PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                }
                else
                {
                    Alert.ShowInTop("出错了!");
                }
            }
            else
            {
                Model.tPictureType m = new Model.tPictureType();
                m.Name     = txtRoleName.Text.Trim();
                m.Remark   = txtRemark.Text.Trim();
                m.FatherId = 0;
                m.Sort     = 0;

                if (BLL.Add(m) >= 1)
                {
                    PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                }
                else
                {
                    Alert.ShowInTop("出错了!");
                }
            }
        }