Пример #1
0
        //新增
        public ActionResult AddImpression()
        {
            string           pid  = Request.Form["PID"].ToString();
            List <M_ZICDNew> list = new M_ZICDNewBLL().GetMaxID();
            int       id          = list[0].ID + 1;
            string    name        = Request.Form["ImpressionName"].ToString();
            bool      isActive    = Convert.ToBoolean(Request.Form["IsActive"]);
            int       sn          = int.Parse(Request.Form["SN"]);
            string    pinYin      = Request.Form["PinYin"].ToString();
            M_ZICDNew impression  = new M_ZICDNew();

            impression.ID       = id;
            impression.ParentID = Convert.ToInt32(pid);
            impression.Name     = name;
            impression.IsActive = isActive;
            impression.SN       = sn;
            impression.PinYin   = pinYin;
            if (new M_ZICDNewBLL().Add(impression) > 0)
            {
                return(this.JsonResult(Utility.E_JsonResult.OK, "新增成功!", null, null));
            }
            else
            {
                return(this.JsonResult(Utility.E_JsonResult.Error, "新增失败!", null, null));
            }
        }
Пример #2
0
        //修改
        public ActionResult EditImpression()
        {
            int       sid        = int.Parse(Request.Form["SID"]);
            string    name       = Request.Form["ImpressionName"].ToString();
            int       pid        = int.Parse(Request.Form["PID"]);
            bool      isActive   = Convert.ToBoolean(Request.Form["IsActive"]);
            int       sn         = int.Parse(Request.Form["SN"]);
            bool      isc        = Convert.ToBoolean(Request.Form["isAct"]);
            M_ZICDNew impression = new M_ZICDNew();

            impression.ID       = sid;
            impression.Name     = name;
            impression.ParentID = pid;
            impression.IsActive = isActive;
            impression.SN       = sn;
            if (Request.Form["PinYin"] == null)
            {
                impression.PinYin = "";
            }
            else
            {
                impression.PinYin = Request.Form["PinYin"];
            }
            if (new M_ZICDNewBLL().Modify(impression, "ID", "Name", "ParentID", "IsActive", "SN", "PinYin") > 0)
            {
                if (isc != isActive)
                {
                    bool bol = new M_ZICDNewBLL().Update(sid, isActive);
                }
                ;

                return(this.JsonResult(Utility.E_JsonResult.OK, "修改成功!", null, null));
            }
            else
            {
                return(this.JsonResult(Utility.E_JsonResult.Error, "修改失败!", null, null));
            }
        }