private void simpleButtonOK_Click(object sender, EventArgs e) { var selected = DevExpressHelper.GetSelectedRecord <ServiceRecord>(gridViewServices); if (selected == null) { DialogResult = DialogResult.None; } }
/// <summary> /// Вызов диалога. /// </summary> /// <param name="parent">окно-родитель</param> /// <returns>выбранный сервис либо null</returns> public static ServiceRecord Execute(IWin32Window parent) { using (var dialog = new SelectServiceDialog()) { var result = dialog.ShowDialog(parent); return((result == DialogResult.OK) ? DevExpressHelper.GetSelectedRecord <ServiceRecord>(dialog.gridViewServices) : null); } }
private void simpleButtonDeleteService_Click(object sender, EventArgs e) { var service = DevExpressHelper.GetSelectedRecord <ServiceRecord>(gridViewServices); if (service == null) { return; } Config.Instance.ControlledServices.Remove(service.ServiceName); refreshServices(); }
public static void AddColumnsSettingViewDataContacto(MVCxGridViewColumnCollection Columns, IEnumerable <CRM.Business.Views.BaseViews.BaseView.DynObject> model, HtmlHelper Html) { if (model.Count() == 0) { return; } foreach (var property in model.First().GetDynamicMemberNames()) { if (property.ToUpper().Trim() == "ID" || property.ToUpper().Trim() == "CODIGOCLIENTE" || property.ToUpper().Trim() == "ESTADO") { continue; } if (property.ToUpper().Trim() == "CODCLIENTE") { Columns.Add(column => { column.Caption = property; column.SetDataItemTemplateContent(container => { Html.DevExpress().HyperLink(hyperlink => { var visibleIndex = container.VisibleIndex; var keyValue = container.KeyValue; var lastName = DataBinder.Eval(container.DataItem, "CodCliente"); var codCliente = DataBinder.Eval(container.DataItem, "CodigoCliente"); hyperlink.Name = "hl" + keyValue.ToString(); hyperlink.Properties.Text = lastName.ToString(); hyperlink.NavigateUrl = DevExpressHelper.GetUrl(new { Controller = "Cliente", Action = "View", id = codCliente }); }).Render(); }); }); //var style = new DevExpress.Web.GridViewHeaderStyle(); // style.BackColor = System.Drawing.Color.LightGray; Columns[property].HeaderStyle.BackColor = System.Drawing.Color.LightGray; Columns[property].HeaderStyle.Font.Bold = true; ((MVCxGridViewColumn)Columns[property]).Settings.AutoFilterCondition = AutoFilterCondition.Contains; } else { Columns.Add(property); //var style = new DevExpress.Web.GridViewHeaderStyle(); // style.BackColor = System.Drawing.Color.LightGray; Columns[property].HeaderStyle.BackColor = System.Drawing.Color.LightGray; Columns[property].HeaderStyle.Font.Bold = true; ((MVCxGridViewColumn)Columns[property]).Settings.AutoFilterCondition = AutoFilterCondition.Contains; } //Columns.Add(property); } }
/// <summary> /// ctor. /// </summary> public ClientMainForm() { InitializeComponent(); // чтение настроек Config.LoadOrCreate(); // загрузка таблицы журнала logControl.LoadFromFolder(Config.LogPath); // пометка цветом состояний служб DevExpressHelper.CreateConditionExpression(gridViewServices, colStatusString, "![IsInstalled]", Color.Yellow); DevExpressHelper.CreateConditionExpression(gridViewServices, colStatusString, "[IsStopped]", Color.Red); DevExpressHelper.CreateConditionExpression(gridViewServices, colStatusString, "[IsInstalled] && ![IsStopped]", Color.Lime); // загрузка настроек refreshSettings(); }
private void simpleButtonVersions_Click(object sender, EventArgs e) { var sp = DevExpressHelper.GetSelectedRecord <SalePoint>(gridViewSalePoints); if (sp != null) { try { var clientService = Protocol.CreateClientProxy(sp.IP); VersionForm.Show(this, sp, clientService.GetVersions()); } catch (Exception ex) { ErrorHelper.ShowError <ErrorForm>(null, ex); } } }
private void controlService(Action <ServiceRecord> routine) { var service = DevExpressHelper.GetSelectedRecord <ServiceRecord>(gridViewServices); if (service == null) { return; } if (service.IsInstalled) { routine.Invoke(service); refreshServices(); } else { XtraMessageBox.Show(this, "Служба не установлена!", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
public static string GetCarImageRouteUrl() { return(DevExpressHelper.GetUrl(new { Controller = "Customization", Action = "CarImage" })); }
public static string rpXuatKho1Phieu() { //var sttct = !string.IsNullOrEmpty(Request.Params["idSuCo"]) ? int.Parse(Request.Params["idSuCo"]) : 0; return(DevExpressHelper.GetUrl(new { Controller = "Report", Action = "rpXuatKho1Phieu" })); }
public static string getDMbaocao() { return(DevExpressHelper.GetUrl(new { Controller = "DanhSach", Action = "DMbaocao" })); }
public static string getDMNhomnguoidung() { return(DevExpressHelper.GetUrl(new { Controller = "DanhSach", Action = "DMNhomnguoidung" })); }
public static string getDMLoaiphieu() { return(DevExpressHelper.GetUrl(new { Controller = "DanhSach", Action = "DMLoaiphieu" })); }
public static string getDonViQL() { return(DevExpressHelper.GetUrl(new { Controller = "DanhSach", Action = "DMDonViQL" })); }
public static string getDMNhaCungCap() { return(DevExpressHelper.GetUrl(new { Controller = "DanhSach", Action = "DMNhaCungCap" })); }
public static string GetEmployeeImageRouteUrl() { return(DevExpressHelper.GetUrl(new { Controller = "GridView", Action = "EmployeeImage" })); }
/// <summary> /// Adds a menu subitem to the group. /// </summary> public static void AddMenuItem(this MVCxNavBarGroup group, string text, string controller, string action) { group.Items.Add(text, action, null, DevExpressHelper.GetUrl(new { Controller = controller, Action = action })); }