Esempio n. 1
0
        public ActionResult Edit(CompanyEdit model)
        {
            //日期格式转换成Unix时间戳格式。
            if (!string.IsNullOrEmpty(model.setDate))
            {
                model.setDate = DateTimeHelper.ConvertDateTimeInt(model.setDate.ToDateTime()).ToString();
            }
            if (model.id > 0)
            {
                //修改
                Entity.ResultEntity updateResult = _cServices.UpdateCompany(model);
                ShowMessageHelper.MessageBoxBackPage("单位信息修改成功");
            }
            else
            {
                //新建
                CompanyAdd entity = new CompanyAdd()
                {
                    unitName = model.unitName,
                    address  = model.address,
                    clientId = model.clientId,
                    cop      = model.cop,
                    fax      = model.fax,
                    tel1     = model.tel1,
                    tel2     = model.tel2,
                    typeId   = model.typeId,
                    gradeSid = model.gradeSid,
                    linkman  = model.linkman,
                    notused  = model.notused,
                    remark   = model.remark,
                    setDate  = model.setDate,
                    setMan   = model.setMan
                };

                ResultAddCompany addResult = _cServices.AddCompany(entity);
                if (addResult != null && addResult.result == "1")
                {
                    model.id     = addResult.id;
                    model.unitId = addResult.unitId;
                    ShowMessageHelper.MessageBoxBackPage("单位信息创建成功");
                }
                else
                {
                    ShowMessageHelper.MessageBoxBackPage("服务器异常,请稍后再试");
                }
            }
            LoadDropDownListData();
            return(View(model));
        }
Esempio n. 2
0
        public IHttpActionResult Put(CompanyEdit company)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var service = CreateCompanyService();

            if (!service.UpdateCompany(company))
            {
                return(InternalServerError());
            }

            return(Ok());
        }
Esempio n. 3
0
        public void CompanyEdit(SIS.Data.FormOpenType _FormOpenType, int _id)
        {
            CompanyEdit _CustomerEdit = new CompanyEdit();

            _CustomerEdit._FormOpenType = _FormOpenType;
            if (_FormOpenType == Data.FormOpenType.New)
            {
                _CustomerEdit.__company = new Model.Models.GMP.Definitions.CompanyDTO();
            }
            else
            {
                _getValue.Id = _id;
                //_CustomerEdit.__company = bl._repository.Run<DefinitionsService, CompanyDTO>(x => x.Get_Company(_getValue));
            }
            _CustomerEdit.ShowDialog();
        }
Esempio n. 4
0
        public bool UpdateCompany(CompanyEdit model)
        {
            using (var ctx = new ApplicationDbContext())
            {
                var entity =
                    ctx
                    .Companies
                    .Single(e => e.CompanyID == model.CompanyID);

                entity.CompanyID       = model.CompanyID;
                entity.CompanyName     = model.CompanyName;
                entity.CompanyLocation = model.CompanyLocation;

                return(ctx.SaveChanges() == 1);
            }
        }
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(RedirectToAction("Index"));
            }

            var service = CreateCompanyService();
            var detail  = service.GetCompanyById(id.Value);
            var model   =
                new CompanyEdit
            {
                CompanyID       = detail.CompanyID,
                CompanyName     = detail.CompanyName,
                CompanyLocation = detail.CompanyLocation
            };

            return(View(model));
        }
        public ActionResult Edit(int id)
        {
            var service = CreateCompanyService();
            var detail  = service.GetCompanyById(id);
            var model   =
                new CompanyEdit
            {
                CompanyId          = detail.CompanyId,
                CompanyName        = detail.CompanyName,
                CompanyDescription = detail.CompanyDescription,
                StreetAddress      = detail.StreetAddress,
                City        = detail.City,
                State       = detail.State,
                ZipCode     = detail.ZipCode,
                Website     = detail.Website,
                PhoneNumber = detail.PhoneNumber
            };

            return(View(model));
        }
Esempio n. 7
0
        /// <summary>
        /// 修改/新建企业单位数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult Edit(string id)
        {
            CompanyEdit model = new CompanyEdit();

            if (!string.IsNullOrEmpty(id))
            {
                //修改
                var result = _cServices.GetCompanyDetails(id);
                if (result != null)
                {
                    model.id       = result.id;
                    model.unitId   = result.unitId;
                    model.unitName = result.unitName;
                    model.address  = result.address;
                    model.clientId = result.clientId;
                    model.cop      = result.cop;
                    model.fax      = result.fax;
                    model.tel1     = result.tel1;
                    model.tel2     = result.tel2;
                    model.typeId   = result.typeId;
                    model.gradeSid = result.gradeSid;
                    model.linkman  = result.linkman;
                    model.notused  = result.notused;
                    model.remark   = result.remark;
                    model.setDate  = result.setDate;
                    model.setMan   = result.setMan;
                }
            }
            else
            {
                //新建
                model.setDate = DateTime.Now.ToString();
                //登记人字段暂用登录用户的登录名
                model.setMan = RequestUser.CurrentRequestUser.CurrentLoginUserInfo.user.loginName;
            }

            LoadDropDownListData();
            return(View(model));
        }
        public ActionResult Edit(int id, CompanyEdit model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            if (model.CompanyID != id)
            {
                ModelState.AddModelError("", "Id Mismatch");
                return(View(model));
            }
            var service = CreateCompanyService();

            if (service.UpdateCompany(model))
            {
                TempData["SaveResult"] = "Your company was updated.";
                return(RedirectToAction("Index"));
            }

            ModelState.AddModelError("", "Your company could not be updated.");
            return(View(model));
        }
Esempio n. 9
0
        /// <summary>
        /// 修改企业单位记录数据
        /// </summary>
        /// <param name="entity">接口参数实体对象</param>
        /// <returns></returns>
        public ResultEntity UpdateCompany(CompanyEdit entity)
        {
            ResultEntity result = CallAPIHelper.CallAPIInPOST <ResultEntity>(APIAddressSetting.API_POST_UPDATEUnit, entity);

            return(result);
        }
Esempio n. 10
0
 public CompanyEditView(CompanyEdit artistEdit) : base(artistEdit)
 {
 }
Esempio n. 11
0
        public Control CreateControl(MetroWindow metroWindow, ClsLoginModel clsLogin, string menuId)
        {
            var control = new Control();

            switch (menuId)
            {
            case "顶部菜单管理":
                control = new TopMenuManager(metroWindow, clsLogin, menuId);
                break;

            case "左侧菜单管理":
                control = new LeftMenuManager(metroWindow, clsLogin, menuId);
                break;

            case "功能组管理":
                control = new NavBarGroupManager(metroWindow, clsLogin, menuId);
                break;

            case "登陆主题设置":
                control = new LoginThemeManager();
                break;

            case "权限管理":
                control = new RolesManager(metroWindow, clsLogin, menuId);
                break;

            case "用户管理":
                control = new UserManager(metroWindow, clsLogin, menuId);
                break;

            case "部门管理":
                control = new DeptManager(metroWindow, clsLogin, menuId);
                break;

            case "登陆日志管理":
                control = new LoginLogManager(metroWindow, clsLogin, menuId);
                break;

            case "操作员管理":
                control = new OperatorManager(metroWindow, clsLogin, menuId);
                break;

            case "公司信息设置":
                control = new CompanyEdit(clsLogin, menuId)
                {
                    Owner = metroWindow
                };
                break;

            case "修改密码":
                control = new ModifyPassword(clsLogin)
                {
                    Owner = metroWindow
                };
                break;

            case "系统初始化":
                control = new SystemInit(clsLogin)
                {
                    Owner = metroWindow
                };
                break;

            case "Banner 设置":
                control = new BannerManager(metroWindow, clsLogin, menuId);
                break;

            case "Banner 默认":
                control = new BannerDefault(metroWindow);
                break;
            }
            return(control);
        }