public IHttpActionResult Edit(DxModuleViewModel model) { var oldModel = _dxModuleService.FindById(model.Id); oldModel.ClientId = model.ClientId; oldModel.ClientName = model.ClientName; oldModel.Sort = model.Sort; oldModel.Name = model.Name; oldModel.RequestUrl = model.RequestUrl; oldModel.Icon = model.Icon; oldModel.Description = model.Description; var entity = model.ToModel(); entity.Code = model.RequestUrl.Replace("/", "_"); bool a = _dxModuleService.Update(oldModel); DataSourceForm dataSourceForm = new DataSourceForm(); if (a) { dataSourceForm.IsSuccess = true; dataSourceForm.Message = "修改成功!"; } else { dataSourceForm.IsSuccess = false; dataSourceForm.Message = "修改失败!"; } return(Ok(dataSourceForm)); }
public IHttpActionResult Create(DxModuleViewModel model) { ModuleIdentifyCodeBuilder moduleIdentifyCodeBuilder = new ModuleIdentifyCodeBuilder(); model.IdentifyCode = moduleIdentifyCodeBuilder.Build; model.CreatedByUserId = UserContext.Id; model.CreatedByUserName = UserContext.LoginName; model.CreatedOn = DateTime.Now; model.IsEnabled = true; model.IsDeleted = false; model.ParentIdentifyCode = model.ParentIdentifyCode ?? ""; var entity = model.ToModel(); entity.Code = model.RequestUrl.Replace("/", "_"); int a = _dxModuleService.Insert(entity); DataSourceForm dataSourceForm = new DataSourceForm(); if (a > 0) { dataSourceForm.IsSuccess = true; dataSourceForm.Message = "添加成功!"; } else { dataSourceForm.IsSuccess = false; dataSourceForm.Message = "添加失败!"; } return(Ok(dataSourceForm)); }
private bool DataSources_EditDataSource(DataSource ds) { C1FlexReport report = _flexDesigner.Report; if (report == null) { return(false); } Cursor = Cursors.WaitCursor; try { using (DataSourceForm dlg = new DataSourceForm()) { if (dlg.EditDataSource(report, _dataSchema, ds, _services)) { ds.ResetDataSourceInfo(); return(true); } } return(false); } finally { Cursor = Cursors.Default; } }
public IHttpActionResult Edit(LocalManagementViewModel model) { var oldModel = _jmpLocuserService.FindById(model.Id); oldModel.URoleId = model.RoleId; oldModel.ULoginname = model.LoginName; oldModel.UPwd = model.Pwd; oldModel.URealname = model.RealName; oldModel.UDepartment = model.Department; oldModel.UPosition = model.Position; oldModel.UEmailaddress = model.EmailAddress; oldModel.UMobilenumber = model.Mobilenumber; oldModel.UQq = model.QQ; var start = _jmpLocuserService.Update(oldModel); DataSourceForm dataSourceForm = new DataSourceForm(); if (start) { dataSourceForm.IsSuccess = true; dataSourceForm.Message = "修改成功!"; } else { dataSourceForm.IsSuccess = false; dataSourceForm.Message = "修改失败!"; } return(Ok(dataSourceForm)); }
public IHttpActionResult Create(AppViewModel model) { var entity = model.ToModel(); entity.a_time = DateTime.Now; entity.a_state = 1; entity.a_rid = 0; entity.a_key = ""; entity.a_secretkey = ""; var a = _iAppService.Insert(entity); DataSourceForm dataSourceForm = new DataSourceForm(); if (a > 0) { entity.a_key = DesEncrypt.Encrypt(entity.a_user_id + ";" + a + ";" + DateTime.Now.ToString("yyyyMMddssmmfff")); entity.a_secretkey = DesEncrypt.Encrypt(a + ";" + entity.a_key + ";" + DateTime.Now.ToString("yyyyMMddssmmfff")); entity.a_id = a; if (_iAppService.Update(entity)) { dataSourceForm.IsSuccess = true; dataSourceForm.Message = "添加成功!"; _logFactory.Logger.CreateLog("新增应用", entity); } } else { dataSourceForm.IsSuccess = false; dataSourceForm.Message = "添加失败!"; } return(Ok(dataSourceForm)); }
private DataSource DataSources_AddDataSource() { C1FlexReport report = _flexDesigner.Report; if (report == null) { return(null); } Cursor = Cursors.WaitCursor; try { DataSource ds = new DataSource(); ds.Name = DesignerUtil.MakeUniqueName(report.DataSources); report.DataSources.Add(ds); using (DataSourceForm dlg = new DataSourceForm()) { if (dlg.EditDataSource(report, _dataSchema, ds, _services, true)) { return(ds); } } return(null); } finally { Cursor = Cursors.Default; } }
public IHttpActionResult Create(LocalManagementViewModel model) { JmpLocuser entity = new JmpLocuser { URoleId = model.RoleId, ULoginname = model.LoginName, UPwd = model.Pwd, URealname = model.RealName, UDepartment = model.Department, UPosition = model.Position, UCount = 0, UState = 1, UMobilenumber = model.Mobilenumber, UEmailaddress = model.EmailAddress, UQq = model.QQ, UType = 1 }; var start = _jmpLocuserService.Insert(entity); DataSourceForm dataSourceForm = new DataSourceForm(); if (start > 0) { dataSourceForm.IsSuccess = true; dataSourceForm.Message = "添加成功!"; } else { dataSourceForm.IsSuccess = false; dataSourceForm.Message = "添加失败!"; } return(Ok(dataSourceForm)); }
public IHttpActionResult Create(DxRoleViewModel model) { RoleIdentifyCodeBuilder roleIdentifyCodeBuilder = new RoleIdentifyCodeBuilder(); model.IdentifyCode = roleIdentifyCodeBuilder.Build; model.ClientId = (int)DxClient.Administrator; model.ClientName = DxClient.Administrator.GetDescription(); model.CreatedBy = UserContext.LoginName; model.CreatedByUserId = UserContext.Id; model.IsEnabled = true; model.IsBuiltin = false; model.IsDeleted = false; var entity = model.ToEntity(); entity.CreatedOn = DateTime.Now; int a = _dxRoleService.Insert(entity); DataSourceForm dataSourceForm = new DataSourceForm(); if (a > 0) { dataSourceForm.IsSuccess = true; dataSourceForm.Message = "添加成功!"; //添加操作日志 //logger.CreateLog("新增角色", entity); } else { dataSourceForm.IsSuccess = false; dataSourceForm.Message = "添加失败!"; } return(Ok(dataSourceForm)); }
public IHttpActionResult Create(DxModuleActionViewModel model) { model.CreatedOn = DateTime.Now; model.CreatedByUserId = UserContext.Id; model.CreatedBy = UserContext.LoginName; model.IsEnabled = true; var entity = model.ToModel(); entity.IsButton = model.IsButton == "true" ? true : false; int a = _dxModuleActionService.Insert(entity); DataSourceForm dataSourceForm = new DataSourceForm(); if (a > 0) { dataSourceForm.IsSuccess = true; dataSourceForm.Message = "添加成功!"; } else { dataSourceForm.IsSuccess = false; dataSourceForm.Message = "添加失败!"; } return(Ok(dataSourceForm)); }
public IHttpActionResult Edit(AppViewModel model) { var entity = model.ToModel(); var oldmodel = _iAppService.FindById(entity.a_id); var modclone = oldmodel.Clone(); oldmodel.a_name = entity.a_name; oldmodel.a_appsynopsis = entity.a_appsynopsis; oldmodel.a_appurl = entity.a_appurl; oldmodel.a_notifyurl = entity.a_notifyurl; oldmodel.a_paymode_id = entity.a_paymode_id; oldmodel.a_apptype_id = entity.a_apptype_id; oldmodel.a_showurl = entity.a_showurl; oldmodel.a_user_id = entity.a_user_id; oldmodel.a_platform_id = entity.a_platform_id; var a = _iAppService.Update(oldmodel); DataSourceForm dataSourceForm = new DataSourceForm(); if (a) { dataSourceForm.IsSuccess = true; dataSourceForm.Message = "修改成功!"; _logFactory.Logger.ModifyLog("修改应用", modclone, entity); } else { dataSourceForm.IsSuccess = false; dataSourceForm.Message = "修改失败!"; } return(Ok(dataSourceForm)); }
public IHttpActionResult Edit(DxModuleActionViewModel model) { var oldModel = _dxModuleActionService.FindById(model.Id); oldModel.Name = model.Name; oldModel.ButtonIcon = model.ButtonIcon; oldModel.ButtonType = model.ButtonType; oldModel.Code = model.Code; oldModel.IsButton = model.IsButton == "on"?true:false; oldModel.JsOperatingFunction = model.JsOperatingFunction; bool a = _dxModuleActionService.Update(oldModel); DataSourceForm dataSourceForm = new DataSourceForm(); if (a) { dataSourceForm.IsSuccess = true; dataSourceForm.Message = "修改成功!"; } else { dataSourceForm.IsSuccess = false; dataSourceForm.Message = "修改失败!"; } return(Ok(dataSourceForm)); }
private void btnOk_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(tbDataSource.Text)) { DataSourceForm.ReportDataSourceError(Strings.SqlServerCeConnectionStringEditorForm.ErrSpecifyDbFileName); ActiveControl = tbDataSource; return; } DialogResult = System.Windows.Forms.DialogResult.OK; }
/// <summary> /// Filter /// </summary> void Filter() { List <XmlField> dataSource = null; string layoutXml = string.Empty; string formId = this.lueForm.Properties.DBValue; List <EntityFormCtrl> formCtrls = null; EntityObjectList vo = DataSourceForm.FirstOrDefault(t => t.formId == formId); if (formId.StartsWith("a")) { using (ProxyFormDesign proxy = new ProxyFormDesign()) { EntityFormDesign vo1 = proxy.Service.GetForm(int.Parse(formId.Substring(1)), true)[0]; layoutXml = vo1.Layout; } formCtrls = FormTool.Entities(layoutXml).FindAll(t => t.ItemType == "1" || t.ItemType == "2" || t.ItemType == "6"); if (formCtrls != null) { dataSource = new List <XmlField>(); foreach (EntityFormCtrl item in formCtrls) { dataSource.Add(new XmlField() { check = 0, itemName = item.ItemName, itemCaption = item.ItemCaption }); } } } else if (formId.StartsWith("b")) { using (ProxyFormDesign proxy = new ProxyFormDesign()) { List <EntityEmrTableFieldInfo> tabFields = proxy.Service.GetTableFieldInfo(formId.Substring(1)); if (tabFields != null && tabFields.Count > 0) { dataSource = new List <XmlField>(); foreach (EntityEmrTableFieldInfo item in tabFields) { dataSource.Add(new XmlField() { check = 0, itemName = item.fieldName, itemCaption = item.fieldCaptain }); } } } } this.gcFields.DataSource = dataSource; }
private void btnOk_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(tbDataSource.Text)) { DataSourceForm.ReportDataSourceError(Strings.SqlServerCeConnectionStringEditorForm.ErrSpecifyDbFileName); ActiveControl = tbDataSource; return; } if (string.Compare(cbFileMode.Text, Strings.SqlServerCeConnectionStringEditorForm.FileModeRO, true) == 0 && string.IsNullOrEmpty(tbTempFilePath.Text)) { DataSourceForm.ReportDataSourceError(Strings.SqlServerCeConnectionStringEditorForm.ErrSpecifyTempDir); ActiveControl = tbTempFilePath; return; } DialogResult = System.Windows.Forms.DialogResult.OK; }
/// <summary> /// LoadDataSource /// </summary> internal void LoadDataSource() { try { uiHelper.BeginLoading(Viewer); using (ProxyFormDesign proxy = new ProxyFormDesign()) { this.IsInit = true; DataSourceForm = proxy.Service.GetForm(0, false); if (DataSourceForm == null) { DataSourceForm = new List <EntityFormDesign>(); } foreach (EntityFormDesign item in DataSourceForm) { item.imageIndex = 2; item.parent = 99; item.isLeaf = true; } EntityFormDesign defaultVo = null; if (DataSourceForm.Count > 0) { defaultVo = DataSourceForm[0]; } EntityFormDesign vo = new EntityFormDesign(); vo.Formid = 99; vo.Formname = "全部表单"; vo.imageIndex = 1; DataSourceForm.Add(vo); Viewer.tvForm.BeginUpdate(); Viewer.tvForm.DataSource = DataSourceForm; Viewer.tvForm.ExpandAll(); Viewer.tvForm.EndUpdate(); if (defaultVo != null) { SetData(defaultVo); } this.IsInit = false; } } finally { uiHelper.CloseLoading(Viewer); } }
public IHttpActionResult EnabledOrDisable(UpdateSateCommand command) { var a = _dxModuleActionService.UpdateStart(command.SearchState, command.IdList); DataSourceForm dataSourceForm = new DataSourceForm(); if (a) { dataSourceForm.IsSuccess = true; dataSourceForm.Message = "操作成功!"; } else { dataSourceForm.IsSuccess = false; dataSourceForm.Message = "操作失败!"; } return(Ok(dataSourceForm)); }
public IHttpActionResult EnabledOrDisable(UpdateSateCommand command) { var a = _iAppService.UpdateStart(command.SearchState, command.IdList); DataSourceForm dataSourceForm = new DataSourceForm(); if (a) { dataSourceForm.IsSuccess = true; dataSourceForm.Message = "操作成功!"; _logFactory.Logger.OperateLog("一键启用或者禁用应用", "操作人员" + UserContext.LoginName + ",应用ID为" + command.IdList + ""); } else { dataSourceForm.IsSuccess = false; dataSourceForm.Message = "操作失败!"; } return(Ok(dataSourceForm)); }
public IHttpActionResult AppAuditing(AppAuditing auditing) { int auditstate = string.IsNullOrEmpty(auditing.State) ? 0 : int.Parse(auditing.State); string name = UserContext.LoginName; var a = _iAppService.Updateauditstate(auditing.Id, auditstate, auditing.Rid, name); DataSourceForm dataSourceForm = new DataSourceForm(); if (a) { dataSourceForm.IsSuccess = true; dataSourceForm.Message = "审核成功!"; _logFactory.Logger.OperateLog("审核应用", "审核应用的ID是" + auditing.Id + ",审核状态为" + auditstate + ",审核人员是" + name + ""); } else { dataSourceForm.IsSuccess = false; dataSourceForm.Message = "审核失败!"; } return(Ok(dataSourceForm)); }
public IHttpActionResult Edit(AppTypeViewModel model) { var oldModel = _iAppTypeService.FindById(model.Id); oldModel.t_name = model.Name; oldModel.t_sort = model.Sort; oldModel.t_topid = model.ParentId; var a = _iAppTypeService.Update(oldModel); DataSourceForm dataSourceForm = new DataSourceForm(); if (a) { dataSourceForm.IsSuccess = true; dataSourceForm.Message = "修改成功!"; } else { dataSourceForm.IsSuccess = false; dataSourceForm.Message = "修改失败!"; } return(Ok(dataSourceForm)); }
public IHttpActionResult Create(AppTypeViewModel model) { jmp_apptype entity = new jmp_apptype { t_topid = model.ParentId, t_name = model.Name, t_sort = model.Sort, t_state = 1 }; var a = _iAppTypeService.Insert(entity); DataSourceForm dataSourceForm = new DataSourceForm(); if (a > 0) { dataSourceForm.IsSuccess = true; dataSourceForm.Message = "添加成功!"; } else { dataSourceForm.IsSuccess = false; dataSourceForm.Message = "添加失败!"; } return(Ok(dataSourceForm)); }
public IHttpActionResult Edit(DxRole model) { var oldModel = _dxRoleService.FindById(model.Id); oldModel.Name = model.Name; oldModel.Description = model.Description; bool a = _dxRoleService.Update(oldModel); DataSourceForm dataSourceForm = new DataSourceForm(); if (a) { dataSourceForm.IsSuccess = true; dataSourceForm.Message = "修改成功!"; //添加操作日志 //logger.ModifyLog("修改角色",model,oldModel); } else { dataSourceForm.IsSuccess = false; dataSourceForm.Message = "修改失败!"; } return(Ok(dataSourceForm)); }
public IHttpActionResult AppRateSetup(AppRateSetupCommand AppRateModel) { foreach (var apprate in AppRateModel.AppRateList) { apprate.r_name = UserContext.LoginName; apprate.r_time = DateTime.Now; apprate.r_appid = AppRateModel.Id; } var a = _iAppService.AppRateSetup(AppRateModel.Id, AppRateModel.AppRateList); DataSourceForm dataSourceForm = new DataSourceForm(); if (a) { dataSourceForm.IsSuccess = true; dataSourceForm.Message = "通道费率设置成功!"; _logFactory.Logger.OperateLog("应用通道费率设置", "设置应用的ID是" + AppRateModel.Id + ",设置的人员是" + UserContext.LoginName + ""); } else { dataSourceForm.IsSuccess = false; dataSourceForm.Message = "通道费率设置成功!"; } return(Ok(dataSourceForm)); }
public IHttpActionResult Permissionsetopert(DxPermissionViewModel dxPermission) { var listPermission = _dxRoleService.FindPerssionByRoleId(dxPermission.RoleId); var role = _dxRoleService.FindById(dxPermission.RoleId); var listPermissionmodle = new List <DxPermission>(); var listPermissionActionModel = new List <DxPermissionAction>(); var idlist = new List <string>(); //权限唯一标识集合 if (listPermission.Count > 0) { var listp = listPermission.Select(x => new { x.IdentifyCode }).Distinct().ToList(); foreach (var identityCode in listp) { idlist.Add(identityCode.IdentifyCode); } } //模块集合去重复 var list = dxPermission.DxPerMissionAction.Select(x => new { x.ModuleIdentifyCode }).Distinct().ToList(); //权限集合 和权限操作码集合 foreach (var dxPerMissionAction in list) { PermissionIdentifyCodeBuilder moduleIdentifyCodeBuilder = new PermissionIdentifyCodeBuilder(); var identifyCode = moduleIdentifyCodeBuilder.Build; var dxPermissionModel = new DxPermission { IdentifyCode = identifyCode, CreatedBy = UserContext.LoginName, CreatedByUserId = UserContext.Id, CreatedOn = DateTime.Now, IsEnabled = true, RoleIdentifyCode = role.IdentifyCode, ModuleIdentifyCode = dxPerMissionAction.ModuleIdentifyCode, }; var dxPermissionActionModel = dxPermission.DxPerMissionAction.FindAll(x => x.ModuleIdentifyCode == dxPermissionModel.ModuleIdentifyCode).Select(x => new DxPermissionAction { PermissionIdentifyCode = identifyCode, Code = x.Code, IsEnabled = true }).ToList(); listPermissionmodle.Add(dxPermissionModel); listPermissionActionModel.AddRange(dxPermissionActionModel); } var IsDeleted = listPermission.Count > 0 ? true : false; var a = _dxRoleService.PermissionSet(IsDeleted, idlist, listPermissionmodle, listPermissionActionModel); DataSourceForm dataSourceForm = new DataSourceForm(); if (a) { dataSourceForm.IsSuccess = true; dataSourceForm.Message = "权限设置成功!"; //添加操作日志 _logFactory.Logger.OperateLog("设置权限", "设置的角色ID为'" + dxPermission.RoleId + "'"); } else { dataSourceForm.IsSuccess = false; dataSourceForm.Message = "权限设置失败!"; } return(Ok(dataSourceForm)); }