Exemplo n.º 1
0
        protected override bool DoEdit(RequestData data)
        {
            int pid = data.GetInt("ParentId");

            pid = pid > 0 ? pid : 0;
            int         id    = data.GetInt("id");
            BASORGModel model = new BASORGModel();

            model.ORGNAME  = data.Get("OrgName");
            model.PARENTID = pid;
            model.RID      = this.GetRid(pid, id);
            model.SORTNO   = data.Get("SortNo").ToInt32();
            model.REMARK   = data.Get("Remark");
            return(model.Update(BASORG.ID == id));
        }
Exemplo n.º 2
0
        protected override bool DoAdd(RequestData data)
        {
            int pid = data.Get("ParentId").ToInt32();

            pid = pid > 0 ? pid : 0;
            BASORGModel model = new BASORGModel();

            model.ORGNAME  = data.Get("OrgName");
            model.PARENTID = pid;
            model.SORTNO   = data.Get("SortNo").ToInt32();
            model.REMARK   = data.Get("Remark");
            int id = model.GetIDByInsert();

            if (id > 0)
            {
                model     = new BASORGModel();
                model.RID = this.GetRid(pid, id);
                model.Update(BASORG.ID == id);
            }
            return(true);
        }
Exemplo n.º 3
0
        protected override bool DoDelete(RequestData data)
        {
            BASORGModel model = new BASORGModel();

            return(model.Delete(BASORG.ID == data.Get("id")));
        }