Beispiel #1
0
        public ActionResult Update(Model.Depart md)
        {
            bool issuccess = BLL.CommonBLL.Update <Model.Depart>(md);
            var  ret       = new
            {
                messagecode = issuccess ? 1 : 0,
            };

            return(Json(ret, JsonRequestBehavior.AllowGet));
        }
Beispiel #2
0
        public ActionResult Delete(Model.Depart md)
        {
            int flag = -1;

            #region 判断部门下是否存在员工
            IList <Model.CRMUser> lmcu = new List <Model.CRMUser>();
            IList <KeyValuePair <string, object> > condition = new List <KeyValuePair <string, object> >();
            condition.Add(new KeyValuePair <string, object>("ufkDepart", md.hrdId));
            LIB.PageModel lpm = new LIB.PageModel();
            lmcu = LIB.MoreTermSelect.MoreTerm <Model.CRMUser>(condition, "CRMUser", ref lpm);
            #endregion

            if (lmcu.Count == 0)
            {
                bool issuccess = BLL.CommonBLL.Delete <Model.Depart>(md);
                flag = issuccess ? 1 : 0;
            }

            var ret = new
            {
                messagecode = flag
            };
            return(Json(ret, JsonRequestBehavior.AllowGet));
        }