Ejemplo n.º 1
0
        public async Task <ActionResult> Save(CheckSettingViewModel model)
        {
            using (CheckSettingServiceClient client = new CheckSettingServiceClient())
            {
                CheckSetting obj = new CheckSetting()
                {
                    Key                 = Convert.ToString(Guid.NewGuid()),
                    GroupName           = model.GroupName.ToUpper(),
                    ActionName          = model.ActionName,
                    EquipmentCode       = model.EquipmentCode,
                    MaterialCode        = model.MaterialCode,
                    MaterialType        = model.MaterialType,
                    ProductionLineCode  = model.ProductionLineCode,
                    RouteEnterpriseName = model.RouteEnterpriseName,
                    RouteName           = model.RouteName,
                    RouteOperationName  = model.RouteOperationName,
                    RouteStepName       = model.RouteStepName,
                    Status              = model.Status,
                    Description         = model.Description,
                    Editor              = User.Identity.Name,
                    EditTime            = DateTime.Now,
                    CreateTime          = DateTime.Now,
                    Creator             = User.Identity.Name
                };
                MethodReturnResult rst = await client.AddAsync(obj);

                if (rst.Code == 0)
                {
                    rst.Message = string.Format(QAMResources.StringResource.CheckSetting_Save_Success
                                                , model.GroupName);
                }
                return(Json(rst));
            }
        }
        public ActionResult CheckIfSettings()
        {
            string       setting    = _dal.CheckSetting();
            CheckSetting theSetting = new CheckSetting();

            theSetting.SettingValue = setting;
            var jsonResult = Json(theSetting, JsonRequestBehavior.AllowGet);

            return(jsonResult);
        }