Exemplo n.º 1
0
        /// <summary>
        /// 提交
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnOk_Click(object sender, EventArgs e)
        {
            Leadin.Model.StoreCity model = new Leadin.Model.StoreCity();


            bool IsEdit = string.IsNullOrEmpty(Request.Params["id"]);

            if (!IsEdit)
            {
                model = blltype.GetModel(int.Parse(Request.Params["id"]));
            }



            model.ParentId  = int.Parse(ddlType.SelectedValue);
            model.Remark    = txtRemark.Text;
            model.SortNum   = int.Parse(txtSortNum.Text);
            model.StateInfo = ckState.Checked ? 1 : 0;

            model.Title = txtTypeName.Text;



            if (IsEdit)
            {
                if (blltype.Add(model) > 0)
                {
                    if (!string.IsNullOrEmpty(Request.Params["typeid"]))
                    {
                        JsMessage("success", "门店城市添加成功!", 1000, "SubList.aspx");
                    }
                    else
                    {
                        JsMessage("success", "门店城市添加成功!", 1000, "List.aspx");
                    }
                }
                else
                {
                    JsMessage("error", "门店城市添加失败,请检查您的输入!", 1000, "back");
                }
            }
            else
            {
                if (blltype.Update(model))
                {
                    if (string.IsNullOrEmpty(Request.Params["typeid"]))
                    {
                        JsMessage("success", "门店城市编辑成功!", 1000, "List.aspx?page=" + Request.Params["page"]);
                    }
                    else
                    {
                        JsMessage("success", "门店城市编辑成功!", 1000, "SubList.aspx?typeid=" + Request.Params["typeid"]);
                    }
                }
                else
                {
                    JsMessage("error", "门店城市编辑失败,请检查您的输入!", 1000, "back");
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 改变状态
        /// </summary>
        /// <param name="source"></param>
        /// <param name="e"></param>
        protected void repList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            //修改状态
            if (e.CommandName == "lbtnState")
            {
                Label lbid = e.Item.FindControl("lbid") as Label;

                Leadin.Model.StoreCity model = bll.GetModel(int.Parse(lbid.Text));

                if (model.StateInfo == 1)
                {
                    model.StateInfo = 0;
                }
                else
                {
                    model.StateInfo = 1;
                }

                bll.Update(model);
            }


            BindRepList();
        }