Beispiel #1
0
        private void simpleButtonOK_Click(object sender, EventArgs e)
        {
            var selected = DevExpressHelper.GetSelectedRecord <ServiceRecord>(gridViewServices);

            if (selected == null)
            {
                DialogResult = DialogResult.None;
            }
        }
Beispiel #2
0
 /// <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();
        }
Beispiel #4
0
        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();
        }
Beispiel #6
0
        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);
            }
        }
Beispiel #8
0
 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" }));
 }
Beispiel #10
0
 public static string getDMbaocao()
 {
     return(DevExpressHelper.GetUrl(new { Controller = "DanhSach", Action = "DMbaocao" }));
 }
Beispiel #11
0
 public static string getDMNhomnguoidung()
 {
     return(DevExpressHelper.GetUrl(new { Controller = "DanhSach", Action = "DMNhomnguoidung" }));
 }
Beispiel #12
0
 public static string getDMLoaiphieu()
 {
     return(DevExpressHelper.GetUrl(new { Controller = "DanhSach", Action = "DMLoaiphieu" }));
 }
Beispiel #13
0
 public static string getDonViQL()
 {
     return(DevExpressHelper.GetUrl(new { Controller = "DanhSach", Action = "DMDonViQL" }));
 }
Beispiel #14
0
 public static string getDMNhaCungCap()
 {
     return(DevExpressHelper.GetUrl(new { Controller = "DanhSach", Action = "DMNhaCungCap" }));
 }
Beispiel #15
0
 public static string GetEmployeeImageRouteUrl()
 {
     return(DevExpressHelper.GetUrl(new { Controller = "GridView", Action = "EmployeeImage" }));
 }
Beispiel #16
0
 /// <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 }));
 }