示例#1
0
        public ActionResult AddUser()
        {
            string      UserNum   = WebUtil.GetQueryStringValue <string>("UserNum", string.Empty);
            string      CompanyID = this.CompanyID;
            AdminEntity entity    = null;

            if (!UserNum.IsEmpty())
            {
                ITopClient client = new TopClientDefault();
                Dictionary <string, string> dic = new Dictionary <string, string>();
                dic.Add("CompanyID", CompanyID);
                dic.Add("UserNum", UserNum);
                string result = client.Execute(UserApiName.UserApiName_Single, dic);
                if (!result.IsEmpty())
                {
                    DataResult <AdminEntity> dataResult = JsonConvert.DeserializeObject <DataResult <AdminEntity> >(result);
                    entity = dataResult.Result;
                }
            }
            entity         = entity == null ? new AdminEntity() : entity;
            ViewBag.Entity = entity;

            ViewBag.DepartList = DropDownHelper.GetDepart(entity.DepartNum, CompanyID);
            ViewBag.RoleList   = DropDownHelper.GetRole(entity.RoleNum, CompanyID);
            return(View());
        }
示例#2
0
        public ActionResult AddDepart()
        {
            string DepartNum = WebUtil.GetQueryStringValue <string>("DepartNum", string.Empty);
            string CompanyID = this.CompanyID;
            string ParentNum = string.Empty;

            SysDepartEntity entity = null;

            if (!DepartNum.IsEmpty())
            {
                ITopClient client = new TopClientDefault();
                Dictionary <string, string> dic = new Dictionary <string, string>();
                dic.Add("CompanyID", CompanyID);
                dic.Add("DepartNum", DepartNum);
                string result = client.Execute(DepartApiName.DepartApiName_Single, dic);

                if (!result.IsEmpty())
                {
                    DataResult <SysDepartEntity> dataResult = JsonConvert.DeserializeObject <DataResult <SysDepartEntity> >(result);
                    entity = dataResult.Result;
                }
            }

            entity         = entity.IsNull() ? new SysDepartEntity() : entity;
            ViewBag.Entity = entity;

            ParentNum          = entity.ParentNum;
            ViewBag.DepartList = DropDownHelper.GetDepart(ParentNum, CompanyID);
            return(View());
        }
示例#3
0
        public ActionResult UserList()
        {
            string CompanyID = this.CompanyID;

            ViewBag.DepartList = DropDownHelper.GetDepart(string.Empty, CompanyID);
            ViewBag.RoleList   = DropDownHelper.GetRole(string.Empty, CompanyID);
            return(View());
        }
示例#4
0
        public ActionResult Add()
        {
            string        SnNum  = WebUtil.GetQueryStringValue <string>("SnNum", string.Empty);
            StorageEntity entity = null;
            ITopClient    client = new TopClientDefault();

            if (!SnNum.IsEmpty())
            {
                Dictionary <string, string> dic = new Dictionary <string, string>();
                dic.Add("CompanyID", CompanyID);
                dic.Add("SnNum", SnNum);

                string result = client.Execute(StorageApiName.StorageApiName_Single, dic);
                DataResult <StorageEntity> dataResult = JsonHelper.DeserializeObject <DataResult <StorageEntity> >(result);
                entity = dataResult.Result;
            }

            entity         = entity.IsNull() ? new StorageEntity() : entity;
            ViewBag.Entity = entity;

            ViewBag.DepartNum   = DropDownHelper.GetDepart(entity.DepartNum, this.CompanyID);
            ViewBag.StorageType = EnumHelper.GetOptions <EStorageType>(entity.StorageType);
            return(View());
        }
示例#5
0
 public ActionResult List()
 {
     ViewBag.DepartNum   = DropDownHelper.GetDepart(string.Empty, this.CompanyID);
     ViewBag.StorageType = EnumHelper.GetOptions <EStorageType>(0);
     return(View());
 }