Ejemplo n.º 1
0
        public ActionResult Edit(int id)
        {
            tblLevelManange model = BusinessContext.tblLevelManange.GetModel(id);

            if (model == null)
            {
                return(HttpNotFound());
            }
            SetDropList();
            return(View(model));
        }
Ejemplo n.º 2
0
        public ActionResult Create(tblLevelManange model, string IsContinue = "0")
        {
            ReturnMessage RM = new ReturnMessage(false);

            try
            {
                if (model.Leader == model.UserName)
                {
                    RM.Message = "自己不可设置自己为直隶上级";
                }
                else
                {
                    bool isHas = BusinessContext.tblLevelManange.Exists(model.UserName, model.Leader);
                    if (isHas)
                    {
                        RM.Message = "已存在的上下级";
                    }
                    else
                    {
                        int tblRcdid = BusinessContext.tblLevelManange.Add(model);
                        RM.IsSuccess = tblRcdid > 0;

                        if (RM.IsSuccess)
                        {
                            model.TblRcdId = tblRcdid;
                            OperateLogHelper.Create <tblLevelManange>(model);
                            if (IsContinue == "1")
                            {
                                RM.IsContinue = true;
                            }
                            else
                            {
                                RM.IsContinue = false;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                RM.Message = ex.Message;
            }

            return(Json(RM));
        }
Ejemplo n.º 3
0
        public ActionResult Edit(int id, tblLevelManange collection)
        {
            ReturnMessage RM = new ReturnMessage(false);

            if (ModelState.IsValid)
            {
                try
                {
                    tblLevelManange old = BusinessContext.tblLevelManange.GetModel(id);

                    RM.IsSuccess = BusinessContext.tblLevelManange.Update(collection);
                    if (RM.IsSuccess)
                    {
                        OperateLogHelper.Edit <tblLevelManange>(collection, old);
                    }
                }
                catch (Exception ex)
                {
                    RM.Message = ex.Message;
                }
            }
            return(Json(RM));
        }