Inheritance: MonoBehaviour
        public void ReturnTheActualTypeOfControlData_WhenResolveWidgetTypeIsCallWithATypeThatIsNotMvcControllerProxy()
        {
            var pageControl = new PageControl();
            pageControl.ObjectType = typeof(Widget).FullName;

            TypeResolutionService.RegisterType(typeof(Widget));

            var propEditor = new ExtendedPropertyEditorWrapper();
            var widgetType = propEditor.InvokeResolveWidgetType(pageControl);

            Assert.AreEqual(typeof(Widget), widgetType);
        }
Esempio n. 2
0
        private int pcMaterialList_EventPaging(PageControl.EventPagingArg e)
        {
            int count = 0;
            List<AscmMaterialItem> list = GetMaterialItem(ref count);
            pcMaterialList.DataBind(list);

            if (dgMaterialList.DataSource != null)
            {
                dgMaterialList.DataSource = null;
                dgMaterialList.Refresh();
            }
            dgMaterialList.AutoGenerateColumns = false;
            dgMaterialList.DataSource = pcMaterialList.bindingSource;
            return count;
        }
        public void ReturnTheTypeOfTheController_WhenResolveWidgetTypeIsCalledWithATypeThatIsMvcControllerProxy()
        {
            var pageControl = new PageControl();
            pageControl.ObjectType = typeof(MvcControllerProxy).FullName;
            pageControl.Properties.Add(new ControlProperty()
            {
                Name = "ControllerName",
                Value = typeof(WidgetDesigner).FullName
            });

            TypeResolutionService.RegisterType(typeof(WidgetDesigner));

            var propEditor = new ExtendedPropertyEditorWrapper();
            var widgetType = propEditor.InvokeResolveWidgetType(pageControl);

            Assert.AreEqual(typeof(WidgetDesigner), widgetType);
        }
Esempio n. 4
0
 public PresentationFrontSideFormModel(SystemModel systemModel)
 {
     this._model       = systemModel;
     this._pageControl = _model.GetPageControl();
 }
Esempio n. 5
0
        /// <summary>
        /// 初始化列表控件
        /// </summary>
        /// <param name="grid">列表控件</param>
        /// <param name="gridView">列表View控件</param>
        /// <param name="callbackMethod">列表控件双击事件回调方法名称</param>
        /// <param name="callMethod">列表数据改变事件调用方法名称</param>
        /// <param name="pageControl">列表分页控件</param>
        /// <param name="getDataMethod">列表获取数据方法名称</param>
        protected void initGrid(GridControl grid, GridView gridView, string callbackMethod = null, string callMethod = "detailChanged", PageControl pageControl = null, string getDataMethod = null)
        {
            gridView.FocusedRowObjectChanged += (sender, args) =>
            {
                call(callMethod, new object[] { args.FocusedRowHandle });
                if (pageControl != null)
                {
                    pageControl.rowHandle = args.FocusedRowHandle;
                }
            };
            gridView.DoubleClick += (sender, args) =>
            {
                if (callbackMethod == null)
                {
                    return;
                }

                var button = buttons.SingleOrDefault(i => i.Name == callbackMethod);
                if (button == null || !button.Enabled)
                {
                    return;
                }

                callback(callbackMethod);
            };
            grid.MouseDown += (sender, args) => mouseDownEvent(gridView, args);

            Format.gridFormat(gridView);
            grid.ContextMenuStrip = createContextMenu(gridView);

            // 注册分页事件
            if (pageControl == null)
            {
                return;
            }

            pageControl.dataChanged += (sender, args) =>
            {
                gridView.RefreshData();
                gridView.FocusedRowHandle = args.rowHandle;
            };
            pageControl.reloadPage += (sender, args) =>
            {
                call(getDataMethod, new object[] { args.page });
                gridView.FocusedRowHandle = args.handle;
            };
        }
Esempio n. 6
0
        /// <summary>
        /// 分页数据绑定事件 pageControl.bind()可触发
        /// </summary>
        /// <param name="e"></param>
        /// <returns></returns>
        private int pageControlMaterial_EventPaging(PageControl.EventPagingArg e)
        {
            int count = 0;
            List<AscmMaterialItem> listMaterials = materialQuery(ref count);
            pageControlMaterial.DataBind(listMaterials);

            if (dataGridViewMaterials.DataSource != null)
            {
                dataGridViewMaterials.DataSource = null;
                dataGridViewMaterials.Refresh();
            }
            dataGridViewMaterials.AutoGenerateColumns = false;
            dataGridViewMaterials.DataSource = pageControlMaterial.bindingSource;
            return count;
        }
Esempio n. 7
0
        private void OnOptionsClicked(object sender, EventArgs e)
        {
            var         btn     = (Button)sender;
            ContextMenu ctxMenu = new ContextMenu();

            ctxMenu.Style           = (Style)FindResource("ContextMenuStyle");
            ctxMenu.PlacementTarget = btn;
            ctxMenu.Placement       = PlacementMode.Bottom;

            MenuItem settingsDashboard = new MenuItem();

            settingsDashboard.Header = "Settings";
            settingsDashboard.Click += delegate { GoToPage(Pages.Settings); };
            settingsDashboard.Style  = (Style)FindResource("MenuItemStyle");
            ctxMenu.Items.Add(settingsDashboard);
            Menu_AddSeparator(ctxMenu);
            MenuItem refreshDashboard = new MenuItem();

            refreshDashboard.Header = "Refresh dashboard";
            refreshDashboard.Click += delegate { BluetoothService.Instance.SendAsync(SPPMessageBuilder.Info.GetAllData()); };
            refreshDashboard.Style  = (Style)FindResource("MenuItemStyle");
            ctxMenu.Items.Add(refreshDashboard);
            Menu_AddSeparator(ctxMenu);
            MenuItem reconnectDashboard = new MenuItem();

            reconnectDashboard.Header = "Reconnect device";
            reconnectDashboard.Click += delegate
            {
                BluetoothService.Instance.Disconnect();
                BluetoothService.Instance.Connect(GetRegisteredDevice());
            };
            reconnectDashboard.Style = (Style)FindResource("MenuItemStyle");
            ctxMenu.Items.Add(reconnectDashboard);
            Menu_AddSeparator(ctxMenu);
            MenuItem deregDevice = new MenuItem();

            deregDevice.Header = "Deregister device";
            deregDevice.Click += delegate
            {
                BluetoothService.Instance.Disconnect();
                Properties.Settings.Default.RegisteredDevice = "";
                Properties.Settings.Default.Save();

                PageControl.TransitionType = PageTransitionType.Fade;
                PageControl.ShowPage(new WelcomePage(this));
            };
            deregDevice.Style = (Style)FindResource("MenuItemStyle");
            ctxMenu.Items.Add(deregDevice);
            Menu_AddSeparator(ctxMenu);
            MenuItem checkUpdateDashboard = new MenuItem();

            checkUpdateDashboard.Header = "Check for updates";
            checkUpdateDashboard.Click += delegate { CheckForUpdates(manual: true); };
            checkUpdateDashboard.Style  = (Style)FindResource("MenuItemStyle");
            ctxMenu.Items.Add(checkUpdateDashboard);
            Menu_AddSeparator(ctxMenu);
            MenuItem credits = new MenuItem();

            credits.Header = "Credits";
            credits.Click += delegate { GoToPage(Pages.Credits); };
            credits.Style  = (Style)FindResource("MenuItemStyle");
            ctxMenu.Items.Add(credits);

            ctxMenu.IsOpen = true;
        }
Esempio n. 8
0
 public void ShowUnsupportedFeaturePage(String requiredVersion)
 {
     _unsupportedFeaturePage.SetRequiredVersion(requiredVersion);
     PageControl.ShowPage(_unsupportedFeaturePage);
 }
 private void tscbxPageSize2_SelectedIndexChanged(object sender, EventArgs e)
 {
     page = new PageControl();
     page.PageMaxCount = tscbxPageSize2.SelectedItem.ToString();
     LoadData();
 }
Esempio n. 10
0
        public void ShowData()
        {
            string sql1 = System.Web.Configuration.WebConfigurationManager.ConnectionStrings["ConnectionString"]
                          .ConnectionString;
            SqlConnection memberConnection = new SqlConnection(sql1);//建立連線通道
            string        searchString     = "";
            string        commandString    =
                $"WITH ClassData AS\r\n(\r\nselect\r\nROW_NUMBER() OVER(ORDER BY topNews desc,id desc) AS RowNumber\r\n,* from dbo.news \r\n\r\nwhere 1=1\r\n\r\n/*--where begin --*/\r\n\r\n/*--where End--*/\r\n)\r\nselect * from ClassData WHERE RowNumber >=@start  and RowNumber <=@end";

            if (!string.IsNullOrEmpty(timeStart.Value))
            {
                searchString += "and initDate>@timeStart ";
            }
            if (!string.IsNullOrEmpty(timeEnd.Value))
            {
                searchString += "and initDate<@timeEnd ";
            }
            if (!string.IsNullOrEmpty(keyword.Value))
            {
                searchString += " and ((title LIKE '%'+ @keyword +'%') OR (summary LIKE '%'+ @keyword + '%') OR (newsContent LIKE '%' + @keyword +'%'))";
            }

            commandString = commandString.Replace("/*--where begin --*/",
                                                  String.Format("/*--where begin --*/{0}{1}", Environment.NewLine, searchString));
            //分頁
            SqlCommand showcommand = new SqlCommand(commandString, memberConnection);
            int        currentPage = Request.QueryString["Page"] == null ? 1 : Convert.ToInt32(Request.QueryString["Page"]);
            int        pageSize    = 10;

            showcommand.Parameters.Add("@start", SqlDbType.Int);
            showcommand.Parameters["@start"].Value = ((currentPage - 1) * pageSize) + 1;
            showcommand.Parameters.Add("@end", SqlDbType.Int);
            showcommand.Parameters["@end"].Value = currentPage * pageSize;
            showcommand.Parameters.Add("@keyword", SqlDbType.NVarChar);
            showcommand.Parameters["@keyword"].Value = keyword.Value;
            if (!string.IsNullOrEmpty(timeStart.Value))
            {
                showcommand.Parameters.Add("@timeStart", SqlDbType.DateTime);
                showcommand.Parameters["@timeStart"].Value = DateTime.Parse(timeStart.Value).ToString("yyyy-MM-dd");
            }
            if (!string.IsNullOrEmpty(timeEnd.Value))
            {
                showcommand.Parameters.Add("@timeEnd", SqlDbType.DateTime);
                showcommand.Parameters["@timeEnd"].Value = DateTime.Parse(timeEnd.Value).AddDays(1).ToString("yyyy-MM-dd");
            }
            //show總筆數
            string countString = "Select count(*) from news WHERE 1=1 /*--where begin --*/";

            countString = countString.Replace("/*--where begin --*/",
                                              String.Format("/*--where begin --*/{0}{1}", Environment.NewLine, searchString));
            SqlCommand count = new SqlCommand(countString, memberConnection);

            count.Parameters.Add("@keyword", SqlDbType.NVarChar);
            count.Parameters["@keyword"].Value = keyword.Value;
            if (!string.IsNullOrEmpty(timeStart.Value))
            {
                count.Parameters.Add("@timeStart", SqlDbType.DateTime);
                count.Parameters["@timeStart"].Value = DateTime.Parse(timeStart.Value).ToString("yyyy-MM-dd");
            }
            if (!string.IsNullOrEmpty(timeEnd.Value))
            {
                count.Parameters.Add("@timeEnd", SqlDbType.DateTime);
                count.Parameters["@timeEnd"].Value = DateTime.Parse(timeEnd.Value).AddDays(1).ToString("yyyy-MM-dd");
            }
            SqlDataAdapter dataAdapter1 = new SqlDataAdapter(count);
            DataTable      datatable1   = new DataTable();

            dataAdapter1.Fill(datatable1);
            PageControl.totalitems = Convert.ToInt32(datatable1.Rows[0][0]);
            PageControl.limit      = pageSize;
            PageControl.targetpage = "/sys/NEWS/NEWS.aspx";
            PageControl.showPageControls();

            //show資料
            SqlDataAdapter dataAdapter = new SqlDataAdapter(showcommand);
            DataTable      datatable   = new DataTable();

            dataAdapter.Fill(datatable);//這一行做很多事,代表,把通道打開,把資料放進dataset裡,再把通道關起來
            GridView1.DataSource = datatable;
            GridView1.DataBind();
        }
Esempio n. 11
0
        public MainWindow()
        {
            if (Settings.Default.DarkMode2 == DarkMode.Unset)
            {
                Settings.Default.DarkMode2 = (DarkMode)Convert.ToInt32(Settings.Default.DarkMode);
                Settings.Default.Save();
            }

            DarkModeHelper.Update();

            _mainPage               = new MainPage(this);
            _systemPage             = new SystemPage(this);
            _selfTestPage           = new SelfTestPage(this);
            _factoryResetPage       = new FactoryResetPage(this);
            _findMyGearPage         = new FindMyGearPage(this);
            _touchpadPage           = new TouchpadPage(this);
            _customActionPage       = new CustomActionPage(this);
            _ambientSoundPage       = new AmbientSoundPage(this);
            _equalizerPage          = new EqualizerPage(this);
            _connectionLostPage     = new ConnectionLostPage(this);
            _deviceSelectPage       = new DeviceSelectPage(this);
            _settingPage            = new SettingPage(this);
            _updatePage             = new UpdatePage(this);
            _advancedPage           = new AdvancedPage(this);
            _unsupportedFeaturePage = new UnsupportedFeaturePage(this);
            _popupSettingPage       = new PopupSettingPage(this);

            InitializeComponent();

            _tbi = new TaskbarIcon();
            Stream iconStream = Application.GetResourceStream(new Uri("pack://*****:*****@"CRITICAL: Unknown Win32 Bluetooth service error");
                Console.WriteLine(e);
            }
            catch (InvalidOperationException e)
            {
                SentrySdk.AddBreadcrumb(e.Message, "bluetoothInRange", level: Sentry.Protocol.BreadcrumbLevel.Error);
                Console.WriteLine(@"CRITICAL: Unknown Win32 Bluetooth service error");
                Console.WriteLine(e);
                MessageBox.Show(e.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
        /// <summary>
        /// 添加菜单
        /// </summary>
        private void btn_Add_Click(object sender, EventArgs e)
        {
            try
            {
                if (TV_MenuInfo.SelectedNode != null)
                {
                    if (GetInt(TV_MenuInfo.SelectedNode.Tag.ToString()) < 0)
                    {
                        MessageBox.Show("请选中节点 ", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                }
                if (TV_MenuInfo.SelectedNode == null)
                {
                    MessageBox.Show("请选中节点 ", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
                PageControl mf = new PageControl();
                if (string.IsNullOrEmpty(cob_Menu_ControlType.Text))
                {
                    mf.ShowToolTip(ToolTipIcon.Info, "提示", "控件类型不能为空!", cob_Menu_ControlType, this);
                    return;
                }
                if (string.IsNullOrEmpty(txt_Menu_ControlText.Text))
                {
                    mf.ShowToolTip(ToolTipIcon.Info, "提示", "菜单名称不能为空!", txt_Menu_ControlText, this);
                    return;
                }

                var mi = new MenuInfo
                {
                    Menu_Order       = Convert.ToInt32(cmkMenuOderID.Text),
                    Menu_MenuType_ID = Convert.ToInt32(cob_Menu_ControlType.SelectedValue),
                    Menu_ControlText = txt_Menu_ControlText.Text,                                                                                                             //菜单名称txt_Menu_ControlText
                    Menu_OtherID     = Convert.ToInt32(cob_Menu_ControlType.Text.ToString().Trim() == "一级菜单" ? 0 : Convert.ToInt32(TV_MenuInfo.SelectedNode.Tag.ToString())), //父级ID
                    Menu_ControlType = cob_Menu_ControlType.SelectedValue.ToString(),                                                                                         //控件类型
                    Menu_ControlName = txt_Menu_ControlName.Text.ToString(),
                    Menu_FromName    = txt_Menu_FromName.Text.ToString(),
                    Menu_FromText    = txt_Menu_FromText.Text,
                    Menu_Enabled     = radioButtons.Checked == true ? true : false,        //控件是否启用
                    Menu_Visible     = radioButton2.Checked == true ? true : false,        //控件是否是否可见
                    Menu_Type        = 1
                };
                if (MenuInfoDAL.InsertOneQCRecord(mi) == false)
                {
                    MessageBox.Show("添加失败!", "系统提示!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    string Log_Content = String.Format("角色名称:{0}", Name);
                    CommonalityEntity.WriteLogData("新增", Log_Content, CommonalityEntity.USERNAME);//添加日志
                    return;
                }
                else
                {
                    clean(this);
                }
            }
            catch
            {
                CommonalityEntity.WriteTextLog("MenuInfoADD.btn_Add_Click()");
            }
            finally
            {
                TV_MenuInfo.Nodes.Clear();
                InitMenu();//重新绑定控件
            }
        }
Esempio n. 13
0
        private void btnQCOneInfo_Click(object sender, EventArgs e)
        {
            try
            {
                if (!isnames)
                {
                    mexpr = (Expression <Func <MATERIAL_QC_INTERFACE, bool> >)PredicateExtensionses.True <MATERIAL_QC_INTERFACE>();
                    var i = 0;
                    //按车牌号搜索
                    if (!string.IsNullOrEmpty(txtCarNO.Text.Trim()))
                    {
                        mexpr = mexpr.And(c => SqlMethods.Like(c.CNTR_NO, "%" + txtCarNO.Text.Trim() + "%"));
                        i++;
                    }
                    //按磅单号
                    if (!string.IsNullOrEmpty(txtWEIGHT_TICKET_NO.Text.Trim()))
                    {
                        mexpr = mexpr.And(c => c.WEIGHT_TICKET_NO.Contains(txtWEIGHT_TICKET_NO.Text.Trim()));
                        i++;
                    }

                    //按采购单
                    if (!string.IsNullOrEmpty(txtPO_NO.Text.Trim()))
                    {
                        mexpr = mexpr.And(c => c.PO_NO.Contains(txtPO_NO.Text.Trim()));
                        i++;
                    }
                    //送货单
                    if (!string.IsNullOrEmpty(txtSHIPMENT_NO.Text.Trim()))
                    {
                        mexpr = mexpr.And(c => c.SHIPMENT_NO.Contains(txtSHIPMENT_NO.Text.Trim()));
                        i++;
                    }
                    if (!string.IsNullOrEmpty(cboxState.Text.Trim()))
                    {
                        if (cboxState.Text.Trim() == "已过数")
                        {
                            mexpr = mexpr.And(c => c.TRANS_TO_DTS_FLAG.Contains("Y"));
                            i++;
                        }
                        else
                        {
                            expr = expr.And(c => c.TRANS_TO_DTS_FLAG.ToString().ToLower() != "Y");
                            i++;
                        }
                    }
                    if (i == 0)
                    {
                        expr = null;
                    }
                }
                else
                {
                    expr = (Expression <Func <OCC_MOIST_INTERFACE, bool> >)PredicateExtensionses.True <OCC_MOIST_INTERFACE>();
                    var i = 0;
                    //按车牌号搜索
                    if (!string.IsNullOrEmpty(txtCarNO.Text.Trim()))
                    {
                        expr = expr.And(c => SqlMethods.Like(c.CNTR_NO, "%" + txtCarNO.Text.Trim() + "%"));
                        i++;
                    }
                    //按磅单号
                    if (!string.IsNullOrEmpty(txtWEIGHT_TICKET_NO.Text.Trim()))
                    {
                        expr = expr.And(c => c.WEIGHT_TICKET_NO.Contains(txtWEIGHT_TICKET_NO.Text.Trim()));
                        i++;
                    }

                    //按采购单
                    if (!string.IsNullOrEmpty(txtPO_NO.Text.Trim()))
                    {
                        expr = expr.And(c => c.PO_NO.Contains(txtPO_NO.Text.Trim()));
                        i++;
                    }
                    //送货单
                    if (!string.IsNullOrEmpty(txtSHIPMENT_NO.Text.Trim()))
                    {
                        expr = expr.And(c => c.SHIPMENT_NO.Contains(txtSHIPMENT_NO.Text.Trim()));
                        i++;
                    }
                    if (!string.IsNullOrEmpty(cboxState.Text.Trim()))
                    {
                        if (cboxState.Text.Trim() == "已过数")
                        {
                            expr = expr.And(c => c.TRANS_TO_DTS_FLAG.ToString().ToLower() == "Y"); i++;
                        }
                        else
                        {
                            expr = expr.And(c => c.TRANS_TO_DTS_FLAG.ToString().ToLower() != "Y");
                            i++;
                        }
                    }
                    if (i == 0)
                    {
                        expr = null;
                    }
                }
            }
            catch (Exception ex)
            {
                Common.WriteTextLog("InsetfaceFrom 搜索异常" + ex.Message.ToString());
            }
            finally
            {
                page = new PageControl();
                page.PageMaxCount = tscbxPageSize2.SelectedItem.ToString();
                LoadData();
            }
        }
Esempio n. 14
0
        /// <summary>
        /// 分页数据绑定事件 pageControl.bind()可触发
        /// </summary>
        /// <param name="e"></param>
        /// <returns></returns>
        private int pageControlTask_EventPaging(PageControl.EventPagingArg e)
        {
            int count = 0;
            List<AscmGetMaterialTask> listTasks = taskQuery(ref count);
            pageControlTask.DataBind(listTasks);

            if (dataGridViewTasks.DataSource != null)
            {
                dataGridViewTasks.DataSource = null;
                dataGridViewTasks.Refresh();
            }
            dataGridViewTasks.AutoGenerateColumns = false;
            dataGridViewTasks.DataSource = pageControlTask.bindingSource;
            return count;
        }
Esempio n. 15
0
        /// <summary>
        /// 删除信息
        /// </summary>
        private void tsbDelete_Click()
        {
            try
            {
                bool isdel = false;
                int  j     = 0;
                if (this.dvgCarList.SelectedRows.Count > 0)//选中删除
                {
                    if (MessageBox.Show("将会同时删除该车辆过数DTS水分数据表的信息,确定要删除吗?", "系统提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        isdel = true;
                        //选中数量
                        int count = dvgCarList.SelectedRows.Count;
                        //遍历
                        for (int i = 0; i < count; i++)
                        {
                            Expression <Func <MATERIAL_QC_INTERFACE, bool> > material_qc = n => n.PO_NO == dvgCarList.SelectedRows[i].Cells["PO_NO"].Value.ToString() && n.SHIPMENT_NO == dvgCarList.SelectedRows[i].Cells["SHIPMENT_NO"].Value.ToString();
                            Expression <Func <OCC_MOIST_INTERFACE, bool> >   occ_moist   = n => n.PO_NO == dvgCarList.SelectedRows[i].Cells["PO_NO"].Value.ToString() && n.SHIPMENT_NO == dvgCarList.SelectedRows[i].Cells["SHIPMENT_NO"].Value.ToString();
                            IEnumerable <OCC_MOIST_INTERFACE> occ_erface = OCC_MOIST_INTERFACEDAL.Query(occ_moist);
                            string trans_to_dtsflag = "";
                            foreach (var occ in occ_erface)
                            {
                                if (!string.IsNullOrEmpty(occ.TRANS_TO_DTS_FLAG))
                                {
                                    trans_to_dtsflag = occ.TRANS_TO_DTS_FLAG;
                                }
                            }
                            if (!string.IsNullOrEmpty(trans_to_dtsflag))
                            {
                                if (MessageBox.Show("编号为:" + dvgCarList.SelectedRows[i].Cells["MATERIAL_QC_INTERFACE_ID"].Value.ToString() + "车牌号为:" + dvgCarList.SelectedRows[i].Cells["CNTRNO"].Value.ToString() + " 已经过数,确定要删除吗?", "系统提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
                                {
                                    if (!MATERIAL_QC_INTERFACEDAL.DeleteToMany(material_qc))
                                    {
                                        j++;
                                    }
                                    if (!OCC_MOIST_INTERFACEDAL.DeleteToMany(occ_moist))
                                    {
                                        j++;
                                    }
                                }
                                else
                                {
                                    isdel = false;
                                }
                            }
                            else
                            {
                                if (!MATERIAL_QC_INTERFACEDAL.DeleteToMany(material_qc))
                                {
                                    j++;
                                }
                                if (!OCC_MOIST_INTERFACEDAL.DeleteToMany(occ_moist))
                                {
                                    j++;
                                }
                            }
                        }

                        if (j == 0)
                        {
                            if (isdel)
                            {
                                MessageBox.Show("删除成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            }
                        }
                        else
                        {
                            if (isdel)
                            {
                                MessageBox.Show("删除失败", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            }
                        }
                        string strContent = "编号为:" + dvgCarList.SelectedRows[0].Cells["MATERIAL_QC_INTERFACE_ID"].Value.ToString() + ",车牌号为:" + dvgCarList.SelectedRows[0].Cells["CNTRN"].Value.ToString() + ",删除成功!";
                        LogInfoDAL.loginfoadd("删除", "删除过数DTS水分数据与过数DTS重量数据", Common.USERNAME);//添加日志
                    }
                }
                else if (this.dataGridView1.SelectedRows.Count > 0)//选中删除
                {
                    if (MessageBox.Show("将会同时删除该车辆过数DTS重量数据表的信息,确定要删除吗?", "系统提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        isdel = true;
                        //选中数量
                        int count = dataGridView1.SelectedRows.Count;
                        //遍历
                        for (int i = 0; i < count; i++)
                        {
                            Expression <Func <MATERIAL_QC_INTERFACE, bool> > material_qc = n => n.PO_NO == dataGridView1.SelectedRows[i].Cells["PONO"].Value.ToString() && n.SHIPMENT_NO == dataGridView1.SelectedRows[i].Cells["SHIPMENTNO"].Value.ToString();
                            Expression <Func <OCC_MOIST_INTERFACE, bool> >   occ_moist   = n => n.PO_NO == dataGridView1.SelectedRows[i].Cells["PONO"].Value.ToString() && n.SHIPMENT_NO == dataGridView1.SelectedRows[i].Cells["SHIPMENTNO"].Value.ToString();
                            IEnumerable <OCC_MOIST_INTERFACE> occ_erface = OCC_MOIST_INTERFACEDAL.Query(occ_moist);
                            string trans_to_dtsflag = "";
                            foreach (var occ in occ_erface)
                            {
                                if (!string.IsNullOrEmpty(occ.TRANS_TO_DTS_FLAG))
                                {
                                    trans_to_dtsflag = occ.TRANS_TO_DTS_FLAG;
                                }
                            }
                            if (!string.IsNullOrEmpty(trans_to_dtsflag))
                            {
                                if (MessageBox.Show("编号为:" + dataGridView1.SelectedRows[i].Cells["OCC_MOIST_INTERFACE_ID"].Value.ToString() + "车牌号为:" + dataGridView1.SelectedRows[i].Cells["CNTRN"].Value.ToString() + " 已经过数,确定要删除吗?", "系统提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
                                {
                                    if (!MATERIAL_QC_INTERFACEDAL.DeleteToMany(material_qc))
                                    {
                                        j++;
                                    }
                                    if (!OCC_MOIST_INTERFACEDAL.DeleteToMany(occ_moist))
                                    {
                                        j++;
                                    }
                                }
                                else
                                {
                                    isdel = false;
                                }
                            }
                            else
                            {
                                if (!MATERIAL_QC_INTERFACEDAL.DeleteToMany(material_qc))
                                {
                                    j++;
                                }
                                if (!OCC_MOIST_INTERFACEDAL.DeleteToMany(occ_moist))
                                {
                                    j++;
                                }
                            }
                        }
                        if (j == 0)
                        {
                            if (isdel)
                            {
                                MessageBox.Show("删除成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            }
                        }
                        else
                        {
                            if (isdel)
                            {
                                MessageBox.Show("删除失败", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            }
                        }
                        string strContent = "编号为:" + dataGridView1.SelectedRows[0].Cells["OCC_MOIST_INTERFACE_ID"].Value.ToString() + ",车牌号为:" + dataGridView1.SelectedRows[0].Cells["CNTRN"].Value.ToString() + ",删除成功!";
                        LogInfoDAL.loginfoadd("删除", "删除过数DTS水分数据与过数DTS重量数据", Common.USERNAME);//添加日志
                    }
                }
                else//没有选中
                {
                    MessageBox.Show("请选择要删除的行!");
                }
            }
            catch (Exception ex)
            {
                Common.WriteTextLog("InsetfaceFrom tsbDelete_Click()+" + ex.Message.ToString());
            }
            finally
            {
                page = new PageControl();
                page.PageMaxCount = tscbxPageSize2.SelectedItem.ToString();
                LoadData();
            }
        }
Esempio n. 16
0
 /// <summary>
 /// 设置每页显示条数
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void tscbxPageSize1_SelectedIndexChanged(object sender, EventArgs e)
 {
     page = new PageControl();
     page.PageMaxCount = tscbxPageSize1.SelectedItem.ToString();
     BindDgvDictionary("");
 }
Esempio n. 17
0
 public void GetPageControlTest()
 {
     PageControl pageControl = _model.GetPageControl();
 }
        /// <summary>
        /// 添加事件
        /// </summary>
        private void btnAdd_Click(object sender, EventArgs e)
        {
            #region --验证用户名是否重复--
            DataTable table = LinQBaseDao.Query(" SELECT * FROM [RoleInfo] where Role_Name='" + txtRoleName.Text.Trim() + "'").Tables[0];
            if (table.Rows.Count > 0)
            {
                MessageBox.Show("角色名称已存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (comboxState.SelectedItem == null)
            {
                MessageBox.Show("请选择状态!");
                return;
            }

            #endregion
            int j    = 0;
            int rint = 0;

            if (string.IsNullOrEmpty(txtRoleName.Text))
            {
                MessageBox.Show(this, "角色名称不能为空!");
                return;
            }
            if (comboxState.SelectedIndex < 0)
            {
                MessageBox.Show(this, "请选择状态!");
                return;
            }
            string name   = txtRoleName.Text; //角色名
            string remark = txtRemark.Text;   //备注
            try
            {
                if (!btnCheck())
                {
                    return;
                }
                var rf = new RoleInfo
                {
                    Role_Name       = name,
                    Role_Remark     = remark,
                    Role_State      = comboxState.SelectedItem.ToString(),
                    Role_Permission = ""
                };
                if (!RoleInfoAdd.InsertOneRoleInfo(rf, out rint))
                {
                    j++;
                }

                if (j == 0)
                {
                    MessageBox.Show("成功增加", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    string Log_Content = String.Format("角色名称:{0}", name);
                    CommonalityEntity.WriteLogData("新增", "新增" + Log_Content + "的信息", CommonalityEntity.USERNAME);
                }
                else
                {
                    MessageBox.Show("成功失败", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch
            {
                CommonalityEntity.WriteTextLog("角色管理 btnAdd_Click()");
            }
            finally
            {
                page = new PageControl();
                LoadData();//更新数据
            }
        }
Esempio n. 19
0
 // Use this for initialization
 void Awake()
 {
     Instance      = this;
     _pageControll = EditPage.GetComponent <PageControl>();
 }
Esempio n. 20
0
        private int pageControlTask_EventPaging(PageControl.EventPagingArg e)
        {
            int count = 0;
            List<AscmGetMaterialTask> listTasks = GetTaskTree(ref count);
            if (listTasks != null && listTasks.Count > 0)
            {
                DataBindTaskTree(listTasks);
            }
            pageControlTask.DataBind(listTasks);

            DataBindTaskTree(listTasks);
            return count;
        }
        protected async Task <bool> SetResultAsync(TResponse response)
        {
            await PageControl.PopModalAsync();

            return(TaskCompletionSource.TrySetResult(response));
        }
Esempio n. 22
0
        public static MvcHtmlString GetPagingRoute(this UrlHelper helper, object substitutes, PageControl pageControl)
        {
            if (string.IsNullOrEmpty(pageControl.RouteName))
            {
                return(helper.Current(substitutes));
            }
            else
            {
                foreach (PropertyDescriptor property in TypeDescriptor.GetProperties(substitutes.GetType()))
                {
                    var value = property.GetValue(substitutes) == null ? null : property.GetValue(substitutes).ToString();
                    pageControl.RouteValue[property.Name] = value;
                }
            }
            var url = helper.RouteUrl(pageControl.RouteName, new RouteValueDictionary(pageControl.RouteValue));

            return(new MvcHtmlString(url));
        }
        protected async Task <bool> ThrowExceptionAsync(Exception e)
        {
            await PageControl.PopModalAsync();

            return(TaskCompletionSource.TrySetException(e));
        }
 /// <summary>
 /// 搜索
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnQCOneInfo_Click(object sender, EventArgs e)
 {
     try
     {
         expr = (Expression <Func <View_QCRecordInfo, bool> >)PredicateExtensionses.True <View_QCRecordInfo>();
         var i = 0;
         if (iqcinfoid > 0)
         {
             expr = expr.And(c => (c.QCInfo_ID == iqcinfoid));//一次组合
             i++;
         }
         //按车牌号搜索
         if (!string.IsNullOrEmpty(txtCarNO.Text.Trim()))
         {
             expr = expr.And(c => SqlMethods.Like(c.CNTR_NO, "%" + txtCarNO.Text.Trim() + "%"));
             //expr = expr.And(c => c.CNTR_NO.Contains(txtCarNO.Text.Trim()));
             i++;
         }
         //按磅单号
         if (!string.IsNullOrEmpty(txtWEIGHT_TICKET_NO.Text.Trim()))
         {
             //expr = expr.And(c => SqlMethods.Like(c.WEIGHT_TICKET_NO, "%" + txtWEIGHT_TICKET_NO.Text.Trim() + "%"));
             expr = expr.And(c => c.WEIGHT_TICKET_NO.Contains(txtWEIGHT_TICKET_NO.Text.Trim()));
             i++;
         }
         //按质检状态
         if (this.cboxState.SelectedValue != null)//质检状态
         {
             int stateID = Converter.ToInt(cboxState.SelectedValue.ToString());
             if (stateID > 0)
             {
                 expr = expr.And(n => n.Dictionary_ID == Converter.ToInt(cboxState.SelectedValue.ToString()));
                 i++;
             }
         }
         //按采购单
         if (!string.IsNullOrEmpty(txtPO_NO.Text.Trim()))
         {
             //expr = expr.And(c => SqlMethods.Like(c.PO_NO, "%" + txtPO_NO.Text.Trim() + "%"));
             expr = expr.And(c => c.PO_NO.Contains(txtPO_NO.Text.Trim()));
             i++;
         }
         //送货单
         if (!string.IsNullOrEmpty(txtSHIPMENT_NO.Text.Trim()))
         {
             //expr = expr.And(c => SqlMethods.Like(c.SHIPMENT_NO, "%" + txtSHIPMENT_NO.Text.Trim() + "%"));
             expr = expr.And(c => c.SHIPMENT_NO.Contains(txtSHIPMENT_NO.Text.Trim()));
             i++;
         }
         if (i == 0)
         {
             expr = null;
         }
     }
     catch (Exception ex)
     {
         Common.WriteTextLog("UpdateQCDetailsForm 搜索异常" + ex.Message.ToString());
     }
     finally
     {
         page = new PageControl();
         page.PageMaxCount = "18";
         LoadData();
     }
 }
Esempio n. 25
0
        /// <summary>
        /// 初始化列表控件
        /// </summary>
        /// <param name="grid">列表View控件</param>
        /// <param name="callMethod">列表数据改变事件调用方法名称</param>
        /// <param name="callbackMethod">列表控件双击事件回调方法名称</param>
        /// <param name="pageControl">列表分页控件</param>
        /// <param name="getDataMethod">列表获取数据方法名称</param>
        public void initGrid(GridView grid, string callMethod = null, string callbackMethod = null, PageControl pageControl = null, string getDataMethod = "loadData")
        {
            grid.FocusedRowObjectChanged += (sender, args) =>
            {
                if (pageControl != null)
                {
                    pageControl.focusedRowHandle = args.FocusedRowHandle;
                }

                call(callMethod, new object[] { args.FocusedRowHandle });
            };
            grid.DoubleClick += (sender, args) =>
            {
                if (callbackMethod == null)
                {
                    return;
                }

                callback(callbackMethod);
            };

            Format.gridFormat(grid);
            if (pageControl == null)
            {
                return;
            }

            pageControl.pageReload        += (sender, args) => call(getDataMethod, new object[] { args.page, args.handle });
            pageControl.focusedRowChanged += (sender, args) => grid.FocusedRowHandle = args.rowHandle;
            pageControl.selectDataChanged += (sender, args) => grid.RefreshData();
        }
Esempio n. 26
0
 public InfoDock(PageControl page) : base(page)
 {
     this.InitializeComponent();
 }
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            _aboutButton         = new Button();
            _taskCreatorButton   = new Button();
            _settingsButton      = new Button();
            _additionalsButton   = new Button();
            _downloadControl     = new DownloadControl(this);
            _logRichTextBox      = new LoggerRichTextBox();
            _queueRequestListBox = new AdvancedListBox();
            _helpToolTip         = new HelpToolTip();
            _pageControl         = new PageControl <Control>();
            SuspendLayout();

            _pageControl.Size = new Size(LayoutGUI.DownloadControlSizeWidth,
                                         LayoutGUI.MainFormSizeHeight - LayoutGUI.ButtonSizeHeight - LayoutGUI.DistanceBetweenControls);
            _pageControl.Location  = new Point(0, LayoutGUI.ButtonSizeHeight + 1);
            _pageControl.Font      = new Font(Font.Name, Font.Size + 2);
            _pageControl.Position  = TabAlignment.Bottom;
            _pageControl.Alignment = ContentAlignment.BottomCenter;
            _pageControl.NextPageButton.Enabled     = false;
            _pageControl.PreviousPageButton.Enabled = false;
            _pageControl.PageValueLabel.Enabled     = false;
            _pageControl.NextPageButton.Visible     = false;
            _pageControl.PreviousPageButton.Visible = false;
            _pageControl.PageValueLabel.Visible     = false;
            _pageControl.Add(_downloadControl);
            //
            //DownloadControl
            //
            _downloadControl.Location        = new Point(0, 0);
            _downloadControl.Size            = new Size(_pageControl.Size.Width, _pageControl.Size.Height - _pageControl.ButtonHeight);
            _downloadControl.VisibleChanged += (sender, args) => UpdateText();
            //
            // taskCreatorButton
            //
            _taskCreatorButton.Location = new Point(0, 0);
            _taskCreatorButton.Size     = new Size(LayoutGUI.ButtonSizeWidth, LayoutGUI.ButtonSizeHeight);
            _taskCreatorButton.Image    = new Bitmap(Images.Lineal.Plus, new Size(LayoutGUI.ButtonSizeWidth / 2, LayoutGUI.ButtonSizeHeight / 2));
            _taskCreatorButton.UseVisualStyleBackColor = true;
            _taskCreatorButton.Enabled = Globals.APIKey.IsValid;
            _taskCreatorButton.Click  += (sender, args) =>
            {
                if (_downloadControl.CurrentTasks < DownloadControl.MaximumTasks &&
                    (ModifierKeys == Keys.Control || ModifierKeys == (Keys.Shift | Keys.Control)))
                {
                    _downloadControl.AddDownloadTaskControl();
                    return;
                }

                OpenTaskCreatorForm(ModifierKeys.HasFlag(Keys.Shift));
            };
            Globals.APIKey.Changed += () => { _taskCreatorButton.Enabled = Globals.APIKey.IsValid; };
            Globals.APIKey.Changed += () =>
            {
                if (Globals.APIKey.IsValid && _downloadControl.CurrentTasks <= 0)
                {
                    _downloadControl.AddDownloadTaskControl();
                }
            };
            //
            // settingsButton
            //
            _settingsButton.Size     = new Size(LayoutGUI.ButtonSizeWidth, LayoutGUI.ButtonSizeHeight);
            _settingsButton.Location = new Point(LayoutGUI.MainFormSizeWidth - _settingsButton.Size.Width, 0);
            _settingsButton.Image    = new Bitmap(Images.Line.Settings, new Size(LayoutGUI.ButtonSizeWidth / 2, LayoutGUI.ButtonSizeHeight / 2));
            _settingsButton.UseVisualStyleBackColor = true;
            _settingsButton.Click += (sender, args) => { _settingsForm.ShowDialog(); };
            //
            // additionalsButton
            //
            _additionalsButton.Size     = new Size(LayoutGUI.ButtonSizeWidth, LayoutGUI.ButtonSizeHeight);
            _additionalsButton.Location = new Point(LayoutGUI.MainFormSizeWidth - _settingsButton.Size.Width - _additionalsButton.Size.Width, 0);
            _additionalsButton.Image    = new Bitmap(Images.Line.Tech, new Size(LayoutGUI.ButtonSizeWidth / 2, LayoutGUI.ButtonSizeHeight / 2));
            _additionalsButton.UseVisualStyleBackColor = true;
            _additionalsButton.Click += (sender, args) => { _additionalsForm.ShowDialog(); };
            //
            // aboutButton
            //
            _aboutButton.Size     = new Size(LayoutGUI.ButtonSizeWidth, LayoutGUI.ButtonSizeHeight);
            _aboutButton.Location =
                new Point(LayoutGUI.MainFormSizeWidth - _settingsButton.Size.Width - _additionalsButton.Size.Width - _aboutButton.Size.Width, 0);
            _aboutButton.UseVisualStyleBackColor = true;
            _aboutButton.Image  = new Bitmap(Images.Basic.Question, new Size(LayoutGUI.ButtonSizeWidth / 2, LayoutGUI.ButtonSizeHeight / 2));
            _aboutButton.Click += (sender, args) =>
            {
                new MessageForm(ModifierKeys == Keys.Shift ? Globals.Localization.FirstKnowText : Globals.Localization.AboutProgramText,
                                Globals.Localization.AboutProgramTitle, Images.Basic.Information, Resource.icon.ToBitmap(), MessageBoxButtons.OK,
                                new[] { Globals.Localization.Close }).ShowDialog();
            };

            _logRichTextBox.Size     = new Size(LayoutGUI.MainFormLoggerRichTextBoxSizeWidth - 2, LayoutGUI.MainFormLoggerRichTextBoxSizeHeight);
            _logRichTextBox.Location = new Point(LayoutGUI.MainFormSizeWidth - _logRichTextBox.Size.Width - LayoutGUI.QueueRequestListBoxWidth,
                                                 LayoutGUI.MainFormSizeHeight - _logRichTextBox.Size.Height - _pageControl.ButtonHeight - LayoutGUI.DistanceBetweenControls + 1);
            _logRichTextBox.BorderStyle = BorderStyle.None;
            _logRichTextBox.ScrollBars  = RichTextBoxScrollBars.None;
            _logRichTextBox.Reversed    = false;
            _logRichTextBox.BorderStyle = BorderStyle.Fixed3D;
            Globals.Logger.Logged      += _logRichTextBox.Log;

            _queueRequestListBox.Size             = new Size(LayoutGUI.QueueRequestListBoxWidth, _logRichTextBox.Size.Height);
            _queueRequestListBox.Location         = new Point(_logRichTextBox.Location.X + _logRichTextBox.Size.Width, _logRichTextBox.Location.Y);
            _queueRequestListBox.AddButton.Click += (sender, args) =>
            {
                OpenTaskCreatorForm(ModifierKeys.HasFlag(Keys.Shift));
            };
            _queueRequestListBox.ListBox.ItemAdded += (index, obj) =>
            {
                if (obj is DownloadRequest request)
                {
                    AddedRequest?.Invoke(request);
                }
            };

            //
            // MainForm
            //
            AutoScaleDimensions = new SizeF(7F, 15F);
            AutoScaleMode       = AutoScaleMode.Font;
            ClientSize          = new Size(LayoutGUI.MainFormSizeWidth, LayoutGUI.MainFormSizeHeight);
            FormBorderStyle     = FormBorderStyle.FixedSingle;
            MaximizeBox         = false;
            Controls.Add(_logRichTextBox);
            Controls.Add(_queueRequestListBox);
            Controls.Add(_aboutButton);
            Controls.Add(_additionalsButton);
            Controls.Add(_taskCreatorButton);
            Controls.Add(_settingsButton);
            Controls.Add(_pageControl);
            Icon   = Resource.icon;
            Shown += OnForm_Shown;
            Globals.APIKey.Changed += OnAPIKeyChanged;
            OnAPIKeyChanged();
            JsonAPI.OnExceptionResponce += code =>
            {
                switch (code)
                {
                case HttpStatusCode.Forbidden:
                case HttpStatusCode.Unauthorized:
                    new MessageForm(Globals.Localization.CurrentAPIKeyInvalid, Globals.Localization.APIKeyInvalid, Images.Basic.Error, Images.Basic.Error)
                    .ShowDialog();
                    _settingsForm.ResetAPI();
                    _settingsForm.ShowDialog();
                    break;

                default:
                    new MessageForm($"{Globals.Localization.UnknownError}: {code}", Globals.Localization.UnknownError, Images.Basic.Error,
                                    Images.Basic.Error).ShowDialog();
                    break;
                }
            };
            ResumeLayout();
        }
Esempio n. 28
0
        protected override IEnumerable <PageControlBase> CreateItems()
        {
            var pageControl = new PageControl(SourceExpr, ID, GetIndentation());

#if NAV2015
            pageControl.Properties.AccessByPermission.Set(AccessByPermission);
#endif
#if NAV2017
            pageControl.Properties.ApplicationArea.Set(ApplicationArea);
#endif
            pageControl.Properties.AssistEdit     = NullableBooleanFromSwitch(nameof(AssistEdit));
            pageControl.Properties.AutoFormatExpr = AutoFormatExpr;
            pageControl.Properties.AutoFormatType = AutoFormatType;
            pageControl.Properties.BlankNumbers   = BlankNumbers;
            pageControl.Properties.BlankZero      = NullableBooleanFromSwitch(nameof(BlankZero));
            pageControl.Properties.CaptionClass   = CaptionClass;
            pageControl.Properties.CaptionML.Set(CaptionML);
            pageControl.Properties.CharAllowed           = CharAllowed;
            pageControl.Properties.ClosingDates          = NullableBooleanFromSwitch(nameof(ClosingDates));
            pageControl.Properties.ColumnSpan            = ColumnSpan;
            pageControl.Properties.ControlAddIn          = ControlAddIn;
            pageControl.Properties.DateFormula           = NullableBooleanFromSwitch(nameof(DateFormula));
            pageControl.Properties.DecimalPlaces.AtLeast = DecimalPlacesAtLeast;
            pageControl.Properties.DecimalPlaces.AtMost  = DecimalPlacesAtMost;
            pageControl.Properties.Description           = Description;
            pageControl.Properties.DrillDown             = NullableBooleanFromSwitch(nameof(DrillDown));
            pageControl.Properties.DrillDownPageID       = DrillDownPageID;
            pageControl.Properties.Editable         = Editable;
            pageControl.Properties.Enabled          = Enabled;
            pageControl.Properties.ExtendedDatatype = ExtendedDataType;
            pageControl.Properties.HideValue        = HideValue;
#if NAV2015
            pageControl.Properties.Image = Image;
#endif
            pageControl.Properties.Importance   = Importance;
            pageControl.Properties.Lookup       = NullableBooleanFromSwitch(nameof(Lookup));
            pageControl.Properties.LookupPageID = LookupPageID;
            pageControl.Properties.MaxValue     = MaxValue;
            pageControl.Properties.MinValue     = MinValue;
            pageControl.Properties.MultiLine    = NullableBooleanFromSwitch(nameof(MultiLine));
            pageControl.Properties.Name         = Name;
            pageControl.Properties.NotBlank     = NullableBooleanFromSwitch(nameof(NotBlank));
            pageControl.Properties.Numeric      = NullableBooleanFromSwitch(nameof(Numeric));
            pageControl.Properties.OnAssistEdit.Set(OnAssistEdit);
            pageControl.Properties.OnControlAddIn.Set(OnControlAddIn);
            pageControl.Properties.OnDrillDown.Set(OnDrillDown);
            pageControl.Properties.OnLookup.Set(OnLookup);
            pageControl.Properties.OnValidate.Set(OnValidate);
            pageControl.Properties.OptionCaptionML.Set(OptionCaptionML);
            pageControl.Properties.QuickEntry  = QuickEntry;
            pageControl.Properties.RowSpan     = RowSpan;
            pageControl.Properties.ShowCaption = NullableBooleanFromSwitch(nameof(ShowCaption));
#if NAV2015
            pageControl.Properties.ShowMandatory = ShowMandatory;
#endif
            pageControl.Properties.Style     = Style;
            pageControl.Properties.StyleExpr = StyleExpr;
            pageControl.Properties.Title     = NullableBooleanFromSwitch(nameof(Title));
            pageControl.Properties.ToolTipML.Set(ToolTipML);
            pageControl.Properties.ValuesAllowed = ValuesAllowed;
            pageControl.Properties.Visible       = Visible;
            pageControl.Properties.Width         = Width;
            pageControl.AutoCaption(AutoCaption);

            if (SubObjects != null)
            {
                var subObjects = SubObjects.Invoke().Select(o => o.BaseObject);
                pageControl.Properties.TableRelation.AddRange(subObjects.OfType <TableRelationLine>());
            }

            yield return(pageControl);
        }
		public void SetElement(VisualElement element)
		{
			if (element != null && !(element is NavigationPage))
				throw new ArgumentException("Element must be a Page", "element");

			NavigationPage oldElement = Element;
			Element = (NavigationPage)element;

			if (oldElement != null)
			{
				((INavigationPageController)oldElement).PushRequested -= OnPushRequested;
				((INavigationPageController)oldElement).PopRequested -= OnPopRequested;
				oldElement.InternalChildren.CollectionChanged -= OnChildrenChanged;
				oldElement.PropertyChanged -= OnElementPropertyChanged;
			}

			if (element != null)
			{
				if (_container == null)
				{
					_container = new PageControl();
					_container.PointerPressed += OnPointerPressed;
					_container.SizeChanged += OnNativeSizeChanged;
					_container.BackClicked += OnBackClicked;

					Tracker = new BackgroundTracker<PageControl>(Control.BackgroundProperty) { Element = (Page)element, Container = _container };

					SetPage(Element.CurrentPage, false, false);

					_container.Loaded += OnLoaded;
					_container.Unloaded += OnUnloaded;
				}

				_container.DataContext = Element.CurrentPage;

				UpdatePadding();
				LookupRelevantParents();
				UpdateTitleColor();
				UpdateNavigationBarBackground();
				Element.PropertyChanged += OnElementPropertyChanged;
				((INavigationPageController)Element).PushRequested += OnPushRequested;
				((INavigationPageController)Element).PopRequested += OnPopRequested;
				Element.InternalChildren.CollectionChanged += OnChildrenChanged;

				if (!string.IsNullOrEmpty(Element.AutomationId))
					_container.SetValue(AutomationProperties.AutomationIdProperty, Element.AutomationId);

				PushExistingNavigationStack();
			}

			OnElementChanged(new VisualElementChangedEventArgs(oldElement, element));
		}
Esempio n. 30
0
        public void GoToPage(Pages page, bool back = false)
        {
            PageControl.TransitionType = back ? PageTransitionType.SlideAndFadeReverse : PageTransitionType.SlideAndFade;
            if (Properties.Settings.Default.DisableSlideTransition)
            {
                PageControl.TransitionType = PageTransitionType.Fade;
            }
            switch (page)
            {
            case Pages.Home:
                PageControl.ShowPage(_mainPage);
                break;

            case Pages.System:
                PageControl.ShowPage(_systemPage);
                break;

            case Pages.SelfTest:
                PageControl.ShowPage(_selfTestPage);
                break;

            case Pages.FactoryReset:
                PageControl.ShowPage(_factoryResetPage);
                break;

            case Pages.FindMyGear:
                PageControl.ShowPage(_findMyGearPage);
                break;

            case Pages.Touch:
                PageControl.ShowPage(_touchpadPage);
                break;

            case Pages.AmbientSound:
                PageControl.ShowPage(_ambientSoundPage);
                break;

            case Pages.Equalizer:
                PageControl.ShowPage(_equalizerPage);
                break;

            case Pages.Credits:
                PageControl.ShowPage(new CreditsPage(this));
                break;

            case Pages.NoConnection:
                PageControl.ShowPage(_connectionLostPage);
                break;

            case Pages.Welcome:
                PageControl.ShowPage(new WelcomePage(this));
                break;

            case Pages.DeviceSelect:
                PageControl.ShowPage(_deviceSelectPage);
                break;

            case Pages.Settings:
                PageControl.ShowPage(_settingPage);
                break;

            case Pages.Advanced:
                PageControl.ShowPage(_advancedPage);
                break;
            }
        }
Esempio n. 31
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MonoKit.UI.PagedViews.ScrollingPageView"/> class.
 /// </summary>
 /// <param name='frame'>
 /// The frame that the view should be in.
 /// </param>
 /// <param name='showNextPagePreview'>
 /// Determines if the view should show a little bit of the left side of the next page
 /// </param>
 public ScrollingPageView(RectangleF frame, bool showNextPagePreview) : base(frame)
 {
     this.showNextPagePreview = showNextPagePreview;
     this.visiblePages = new List<ScrollPage>();
     this.recycledPages = new List<ScrollPage>();
     
     if (!showNextPagePreview)
     {
         var fm = frame;
         fm.X = 0;
         fm.Width = frame.Width;
         fm.Y = frame.Height - 20;
         fm.Height = 20;
         
         this.pageControl = new PageControl(fm);
         this.pageControl.AutoresizingMask = UIViewAutoresizing.All;
         this.AddSubview(this.pageControl);
     }
     
     this.Initialize(frame, showNextPagePreview);
 }
        public void SetElement(VisualElement element)
        {
            if (element != null && !(element is NavigationPage))
            {
                throw new ArgumentException("Element must be a Page", "element");
            }

            NavigationPage oldElement = Element;

            Element = (NavigationPage)element;

            if (oldElement != null)
            {
                ((INavigationPageController)oldElement).PushRequested            -= OnPushRequested;
                ((INavigationPageController)oldElement).PopRequested             -= OnPopRequested;
                ((INavigationPageController)oldElement).PopToRootRequested       -= OnPopToRootRequested;
                ((IPageController)oldElement).InternalChildren.CollectionChanged -= OnChildrenChanged;
                oldElement.PropertyChanged -= OnElementPropertyChanged;
            }

            if (element != null)
            {
                if (_container == null)
                {
                    _container = new PageControl();
                    _container.PointerPressed += OnPointerPressed;
                    _container.SizeChanged    += OnNativeSizeChanged;
                    _container.BackClicked    += OnBackClicked;

                    Tracker = new BackgroundTracker <PageControl>(Control.BackgroundProperty)
                    {
                        Element = (Page)element, Container = _container
                    };

#if WINDOWS_UWP
                    // Enforce consistency rules on toolbar (show toolbar if top-level page is Navigation Page)
                    _container.ShouldShowToolbar = _parentMasterDetailPage == null && _parentMasterDetailPage == null;
#endif

                    SetPage(Element.CurrentPage, false, false);

                    _container.Loaded   += OnLoaded;
                    _container.Unloaded += OnUnloaded;
                }

                _container.DataContext = Element.CurrentPage;

                UpdatePadding();
                LookupRelevantParents();
                UpdateTitleColor();
                UpdateNavigationBarBackground();
                UpdateToolbarPlacement();
                Element.PropertyChanged += OnElementPropertyChanged;
                ((INavigationPageController)Element).PushRequested      += OnPushRequested;
                ((INavigationPageController)Element).PopRequested       += OnPopRequested;
                ((INavigationPageController)Element).PopToRootRequested += OnPopToRootRequested;
                PageController.InternalChildren.CollectionChanged       += OnChildrenChanged;

                if (!string.IsNullOrEmpty(Element.AutomationId))
                {
                    _container.SetValue(AutomationProperties.AutomationIdProperty, Element.AutomationId);
                }

                PushExistingNavigationStack();
            }

            OnElementChanged(new VisualElementChangedEventArgs(oldElement, element));
        }
Esempio n. 33
0
        void ReleaseDesignerOutlets()
        {
            if (BackgroundImage != null)
            {
                BackgroundImage.Dispose();
                BackgroundImage = null;
            }

            if (FirstPageLabel != null)
            {
                FirstPageLabel.Dispose();
                FirstPageLabel = null;
            }

            if (JumbotronLabel != null)
            {
                JumbotronLabel.Dispose();
                JumbotronLabel = null;
            }

            if (LastPageItems != null)
            {
                LastPageItems.Dispose();
                LastPageItems = null;
            }

            if (Login != null)
            {
                Login.Dispose();
                Login = null;
            }

            if (Next != null)
            {
                Next.Dispose();
                Next = null;
            }

            if (PageControl != null)
            {
                PageControl.Dispose();
                PageControl = null;
            }

            if (PhoneContents != null)
            {
                PhoneContents.Dispose();
                PhoneContents = null;
            }

            if (PhoneFrame != null)
            {
                PhoneFrame.Dispose();
                PhoneFrame = null;
            }

            if (Previous != null)
            {
                Previous.Dispose();
                Previous = null;
            }

            if (ScrollView != null)
            {
                ScrollView.Dispose();
                ScrollView = null;
            }

            if (SecondPageLabel != null)
            {
                SecondPageLabel.Dispose();
                SecondPageLabel = null;
            }

            if (SignUp != null)
            {
                SignUp.Dispose();
                SignUp = null;
            }

            if (Skip != null)
            {
                Skip.Dispose();
                Skip = null;
            }

            if (ThirdPageLabel != null)
            {
                ThirdPageLabel.Dispose();
                ThirdPageLabel = null;
            }
        }
Esempio n. 34
0
        private int pageControlMaterial_EventPaging(PageControl.EventPagingArg e)
        {
            int count = 0;
            List<AscmWipRequirementOperations> list = GetWipRequirementOperations(ref count);
            pageControlMaterial.DataBind(list);

            if (dgMaterialList.DataSource != null)
            {
                dgMaterialList.DataSource = null;
                dgMaterialList.Refresh();
            }
            dgMaterialList.AutoGenerateColumns = false;
            dgMaterialList.DataSource = pageControlMaterial.bindingSource;
            return count;
        }
Esempio n. 35
0
        private void bntUpUser_Click()
        {
            try
            {
                int j = 0;
                Expression <Func <UserInfo, bool> > p = n => n.UserLoginId == txtLoginId.Text.Trim();
                Action <UserInfo> ap = n =>
                {
                    n.UserAddress        = txtAddress.Text.Trim();
                    n.UserLoginId        = txtLoginId.Text.Trim();
                    n.UserName           = txtName.Text.Trim();
                    n.UserLoginPwd       = txtPassword.Text.Trim();
                    n.UserPhone          = txtPhone.Text.Trim();
                    n.UserRemark         = txtRemark.Text.Trim();
                    n.User_Role_Id       = Convert.ToInt32(cmbRole.SelectedValue);
                    n.UserCarId          = txtCardNo.Text.Trim();
                    n.User_Duty_ID       = Convert.ToInt32(cobDuty_Name.SelectedValue);
                    n.User_Dictionary_ID = Convert.ToInt32(cbxState.SelectedValue);
                };
                if (!UserInfoDAL.Update(p, ap))//用户是否修改失败
                {
                    MessageBox.Show(" 修改失败", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("修改成功", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                //if (!UserInfoDAL.Update(p, ap))//用户是否修改失败
                //{
                //    j++;

                //}

                ////删除角色的所有权限
                //Expression<Func<PermissionsInfo, bool>> funmenuinfo = n => n.Permissions_UserId == Common.UserID;
                //if (!PermissionsInfoDAL.DeleteToMany(funmenuinfo))//用户权限菜单是否删除失败
                //{
                //    j++;
                //}
                //for (int i = 0; i < Common.arraylist.Count; i++)
                //{

                //    var permissionsInfo = new PermissionsInfo
                //    {
                //        Permissions_Menu_ID = Common.GetInt(Common.arraylist[i].ToString()),
                //        Permissions_Dictionary_ID = DictionaryDAL.GetDictionaryID("启动"),
                //        Permissions_Visible = true,
                //        Permissions_Enabled = true,
                //        Permissions_UserId = Common.UserID

                //    };
                //    if (!PermissionsInfoDAL.InsertOneQCRecord(permissionsInfo))//是否添加失败
                //    {
                //        j++;
                //    }
                //}


                //if (j == 0)
                //{
                //    MessageBox.Show("修改成功", "系统提示");
                //}
                //else
                //{
                //    MessageBox.Show(" 修改失败", "系统提示");
                //}
                string Log_Content = String.Format("用户名称:{0} ", txtLoginId.Text.Trim());
                Common.WriteLogData("修改", Log_Content, Common.USERNAME);//添加日志
            }
            catch (Exception ex)
            {
                Common.WriteTextLog("用户管理 bntUpUser_Click()" + ex.Message.ToString());
            }
            finally
            {
                page = new PageControl();
                page.PageMaxCount = tscbxPageSize2.SelectedItem.ToString();
                LoadData();
                ShowAddButton();
            }
        }
Esempio n. 36
0
        /// <summary>
        ///删除用户信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private void tbtnDelUser_delete()
        {
            try
            {
                string Log_Content = "";
                int    j           = 0;
                if (lvwUserList.SelectedRows.Count > 0)//选中删除
                {
                    if (MessageBox.Show("确定要删除吗?", "系统提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        //选中数量
                        int    count = lvwUserList.SelectedRows.Count;
                        string id    = "";
                        //遍历
                        for (int i = 0; i < count; i++)
                        {
                            //if (i == 0)
                            //{
                            //    id = lvwUserList.SelectedRows[i].Cells["UserLoginId"].Value.ToString();
                            //    continue;
                            //}
                            if (lvwUserList.SelectedRows[i].Cells["UserLoginId"].Value != null)
                            {
                                Log_Content += lvwUserList.SelectedRows[i].Cells["UserLoginId"].Value.ToString();
                                Expression <Func <UserInfo, bool> > funuserinfo = n => n.UserLoginId == lvwUserList.SelectedRows[i].Cells["UserLoginId"].Value.ToString();

                                if (!UserInfoDAL.DeleteToMany(funuserinfo))
                                {
                                    j++;
                                }
                            }
                            // if (lvwUserList.SelectedRows[i].Cells["UserId"].Value!=null)
                            //{
                            //    //删除用户的所有权限
                            //    Expression<Func<PermissionsInfo, bool>> funmenuinfo = n => n.Permissions_UserId ==Common.GetInt( lvwUserList.SelectedRows[i].Cells["UserId"].Value.ToString());
                            //    if (!PermissionsInfoDAL.DeleteToMany(funmenuinfo))//用户权限菜单是否删除失败
                            //    {
                            //        j++;
                            //    }
                            //}
                        }
                        if (j == 0)
                        {
                            MessageBox.Show("成功删除", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                        else
                        {
                            MessageBox.Show("删除失败", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                        Common.WriteLogData("删除", "删除用户" + Log_Content, Common.USERNAME);//操作日志
                    }
                }
                else//没有选中
                {
                    MessageBox.Show("请选择要删除的行!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                Common.WriteTextLog("用户管理 tbtnDelUser_delete()+" + ex.Message.ToString());
            }
            finally
            {
                page = new PageControl();
                page.PageMaxCount = tscbxPageSize2.SelectedItem.ToString();
                LoadData();//更新
            }
        }
Esempio n. 37
0
        protected bool ImportFromExcelToCreateAndModify(DataSet ds)
        {
            string strKPIError = "";

            try
            {
                System.Data.DataTable dt = ds.Tables[0];

                int  nAll      = dt.Rows.Count;
                int  nCreate   = 0;
                int  nModify   = 0;
                int  nNotValid = 0;
                bool bExist    = false;

                foreach (System.Data.DataRow dr in dt.Rows)
                {
                    if (dr["SelectX"].ToString().ToLower() == "x")
                    {
                        string ECCode = dr["ECCode"].ToString().Trim();

                        strKPIError = ECCode;

                        //判断是否存在
                        bExist = ECTagDal.CodeExist(ECCode, "");

                        string keyid = PageControl.GetGuid();
                        if (bExist)
                        {
                            keyid = ECTagDal.GetECIDByCode(ECCode);

                            //MessageBox.popupClientMessage(this.Page, " 该机组的输出标签已存在!", "call();");
                            //nExist += 1;
                            //continue;
                        }
                        else
                        {
                            //其他表存在也不能创建
                            if (ALLDal.CodeExist(ECCode, ""))
                            {
                                nNotValid += 1;
                                continue;
                            }
                        }

                        ECTagEntity mEntity = new ECTagEntity();

                        mEntity.ECID = keyid;
                        string UnitName = dr["UnitName"].ToString().Trim();
                        mEntity.UnitID = KPI_UnitDal.GetUnitID(UnitName);
                        string SeqName = dr["SeqName"].ToString().Trim();
                        mEntity.SeqID = KPI_SeqDal.GetSeqID(SeqName);
                        string KpiName = dr["KpiName"].ToString().Trim();
                        mEntity.KpiID = KpiDal.GetKpiID(KpiName);
                        string EngunitName = dr["EngunitName"].ToString().Trim();
                        mEntity.EngunitID = EngunitDal.GetEngunitID(EngunitName);
                        string CycleName = dr["CycleName"].ToString().Trim();
                        mEntity.CycleID = CycleDal.GetCycleID(CycleName);

                        mEntity.ECCode    = dr["ECCode"].ToString().Trim();
                        mEntity.ECName    = dr["ECName"].ToString().Trim();
                        mEntity.ECDesc    = dr["ECDesc"].ToString().Trim();
                        mEntity.ECIndex   = int.Parse(dr["ECIndex"].ToString().Trim());
                        mEntity.ECWeb     = dr["ECWeb"].ToString().Trim();
                        mEntity.ECIsValid = int.Parse(dr["ECIsValid"].ToString().Trim());

                        mEntity.ECIsCalc    = int.Parse(dr["ECIsCalc"].ToString().Trim());
                        mEntity.ECIsAsses   = int.Parse(dr["ECIsAsses"].ToString().Trim());
                        mEntity.ECIsZero    = int.Parse(dr["ECIsZero"].ToString().Trim());
                        mEntity.ECIsDisplay = int.Parse(dr["ECIsDisplay"].ToString().Trim());
                        mEntity.ECIsTotal   = int.Parse(dr["ECIsTotal"].ToString().Trim());
                        mEntity.ECDesign    = dr["ECDesign"].ToString().Trim();

                        mEntity.ECOptimal = dr["ECOptimal"].ToString().Trim();
                        if (dr["ECMaxValue"].ToString().Trim() != "")
                        {
                            mEntity.ECMaxValue = decimal.Parse(dr["ECMaxValue"].ToString().Trim());
                        }
                        if (dr["ECMinValue"].ToString().Trim() != "")
                        {
                            mEntity.ECMinValue = decimal.Parse(dr["ECMinValue"].ToString().Trim());
                        }
                        mEntity.ECWeight    = decimal.Parse(dr["ECWeight"].ToString().Trim());
                        mEntity.ECCalcClass = int.Parse(dr["ECCalcClass"].ToString().Trim());
                        mEntity.ECFilterExp = dr["ECFilterExp"].ToString().Trim();

                        mEntity.ECCalcExp       = dr["ECCalcExp"].ToString().Trim();
                        mEntity.ECCalcDesc      = dr["ECCalcDesc"].ToString().Trim();
                        mEntity.ECIsSnapshot    = int.Parse(dr["ECIsSnapshot"].ToString().Trim());
                        mEntity.ECXLineType     = int.Parse(dr["ECXLineType"].ToString().Trim());
                        mEntity.ECXLineGetType  = int.Parse(dr["ECXLineGetType"].ToString().Trim());
                        mEntity.ECXLineXRealTag = dr["ECXLineXRealTag"].ToString().Trim();

                        mEntity.ECXLineYRealTag = dr["ECXLineYRealTag"].ToString().Trim();
                        mEntity.ECXLineZRealTag = dr["ECXLineZRealTag"].ToString().Trim();
                        mEntity.ECXLineXYZ      = dr["ECXLineXYZ"].ToString().Trim();
                        mEntity.ECScoreExp      = dr["ECScoreExp"].ToString().Trim();
                        mEntity.ECCurveGroup    = dr["ECCurveGroup"].ToString().Trim();
                        mEntity.ECIsSort        = int.Parse(dr["ECIsSort"].ToString().Trim());
                        mEntity.ECType          = int.Parse(dr["ECType"].ToString().Trim());

                        mEntity.ECSort    = int.Parse(dr["ECSort"].ToString().Trim());
                        mEntity.ECScore   = dr["ECScore"].ToString().Trim();
                        mEntity.ECExExp   = dr["ECExExp"].ToString().Trim();
                        mEntity.ECExScore = dr["ECExScore"].ToString().Trim();
                        mEntity.ECNote    = dr["ECNote"].ToString().Trim();

                        mEntity.ECCreateTime = DateTime.Now.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss");
                        mEntity.ECModifyTime = mEntity.ECCreateTime;


                        if (bExist)
                        {
                            ECTagDal.Update(mEntity);
                            nModify += 1;
                        }
                        else
                        {
                            ECTagDal.Insert(mEntity);
                            nCreate += 1;
                        }
                    }
                }

                string strInfor = "标签点总数为:{0}个, 创建成功:{1}个, 修改成功: {2}个,其他表存在Code: {3}个。";
                strInfor = string.Format(strInfor, nAll, nCreate, nModify, nNotValid);

                MessageBox.popupClientMessage(this.Page, strInfor, "call();");

                return(true);
            }
            catch (Exception ee)
            {
                //
                MessageBox.popupClientMessage(this.Page, strKPIError + ": " + ee.Message, "call();");

                return(false);
            }
        }
Esempio n. 38
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="pc"></param>
        /// <param name="page"></param>
        /// <param name="table"></param>
        /// <returns></returns>
        public CommandStatus ModeSense(PageControl pc, byte page, out ModeTable table)
        {
            if (m_logger != null)
            {
                string args = pc.ToString() + ", " + page.ToString() + ", out result";
                m_logger.LogMessage(new UserMessage(UserMessage.Category.Debug, 8, "Bwg.Scsi.Device.ModeSense(" + args + ")"));
            }

            ushort len = 0;

            table = null;

            byte b = 0;
            b |= (byte)((byte)(pc) << 7);
            b |= (byte)(page & 0x3f);

            using (Command cmd = new Command(ScsiCommandCode.ModeSense, 10, 8, Command.CmdDirection.In, 60 * 5))
            {
                cmd.SetCDB8(1, 8);              // Disable block descriptors
                cmd.SetCDB8(2, b);
                cmd.SetCDB16(7, 8);

                CommandStatus st = SendCommand(cmd);
                if (st != CommandStatus.Success)
                    return st;

                len = cmd.GetBuffer16(0);
                len += 2;
            }

            using (Command cmd = new Command(ScsiCommandCode.ModeSense, 10, len, Command.CmdDirection.In, 60 * 5))
            {
                cmd.SetCDB8(1, 8);              // Disable block descriptors
                cmd.SetCDB8(2, b);
                cmd.SetCDB16(7, len);

                CommandStatus st = SendCommand(cmd);
                if (st != CommandStatus.Success)
                    return st;

                table = new ModeTable(cmd.GetBuffer(), cmd.BufferSize);
            }

            return CommandStatus.Success;
        }
Esempio n. 39
0
        private void OnOptionsClicked(object sender, EventArgs e)
        {
            var         btn     = (Button)sender;
            ContextMenu ctxMenu = new ContextMenu();

            ctxMenu.Style           = (Style)FindResource("ContextMenuStyle");
            ctxMenu.PlacementTarget = btn;
            ctxMenu.Placement       = PlacementMode.Bottom;

            if (!_restrictOptionsMenu)
            {
                MenuItem settingsDashboard = new MenuItem();
                settingsDashboard.Header = Loc.GetString("optionsmenu_settings");
                settingsDashboard.Click += delegate { GoToPage(Pages.Settings); };
                settingsDashboard.Style  = (Style)FindResource("MenuItemStyle");
                ctxMenu.Items.Add(settingsDashboard);
                Menu_AddSeparator(ctxMenu);

                MenuItem refreshDashboard = new MenuItem();
                refreshDashboard.Header = Loc.GetString("optionsmenu_refresh");
                refreshDashboard.Click += delegate
                {
                    BluetoothService.Instance.SendAsync(SPPMessageBuilder.Info.GetAllData());
                };
                refreshDashboard.Style = (Style)FindResource("MenuItemStyle");
                ctxMenu.Items.Add(refreshDashboard);
                Menu_AddSeparator(ctxMenu);
            }

            MenuItem deregDevice = new MenuItem();

            deregDevice.Header = Loc.GetString("optionsmenu_deregister");
            deregDevice.Click += delegate
            {
                GenerateTrayContext(-1, -1, -1);
                _popupShownCurrentSession = false;
                BluetoothService.Instance.Disconnect();
                Properties.Settings.Default.RegisteredDevice      = "";
                Properties.Settings.Default.RegisteredDeviceModel = Model.NULL;
                Properties.Settings.Default.Save();

                PageControl.TransitionType = PageTransitionType.Fade;
                PageControl.ShowPage(new WelcomePage(this));
            };
            deregDevice.Style = (Style)FindResource("MenuItemStyle");
            ctxMenu.Items.Add(deregDevice);

            Menu_AddSeparator(ctxMenu);
            MenuItem checkUpdateDashboard = new MenuItem();

            checkUpdateDashboard.Header = Loc.GetString("optionsmenu_update");
            checkUpdateDashboard.Click += delegate { CheckForUpdates(manual: true); };
            checkUpdateDashboard.Style  = (Style)FindResource("MenuItemStyle");
            ctxMenu.Items.Add(checkUpdateDashboard);

            if (!_restrictOptionsMenu)
            {
                Menu_AddSeparator(ctxMenu);
                MenuItem credits = new MenuItem();
                credits.Header = Loc.GetString("optionsmenu_credits");
                credits.Click += delegate { GoToPage(Pages.Credits); };
                credits.Style  = (Style)FindResource("MenuItemStyle");
                ctxMenu.Items.Add(credits);
            }

            ctxMenu.IsOpen = true;
        }
Esempio n. 40
0
        private int pageControlJob_EventPaging(PageControl.EventPagingArg e)
        {
            int count = 0;
            List<AscmWipDiscreteJobs> listJobs = getWipDiscreteJobsList(ref count);
            pageControlJob.DataBind(listJobs);

            if (dataGridViewJobs.DataSource != null)
            {
                dataGridViewJobs.DataSource = null;
                dataGridViewJobs.Refresh();
            }
            dataGridViewJobs.AutoGenerateColumns = false;
            dataGridViewJobs.DataSource = pageControlJob.bindingSource;
            return count;
        }
Esempio n. 41
0
        /// <summary>
        /// 搜索条件
        /// </summary>
        ///
        private void btnxSearchWhere()
        {
            try
            {
                int    i   = 0;
                string str = "";
                //得到查询的条件
                string name      = txtOperName.Text.Trim();
                string beginTime = this.dtiBegin.Text.Trim();
                string endTime   = this.dtiEnd.Text.Trim();
                string begin     = beginTime; // + " 00:00:00"
                string end       = endTime;   // + "23:59:59 "

                //if (expr == null )
                //{
                expr = PredicateExtensionses.True <View_LogInfo_Dictionary>();
                //}
                if (name != "")//操作人
                {
                    expr = expr.And(n => SqlMethods.Like(n.Log_Name, "%" + txtOperName.Text.Trim() + "%"));


                    i++;
                }
                if (beginTime != "")//开始时间
                {
                    expr = expr.And(n => n.Log_Time >= Common.GetDateTime(begin));

                    i++;
                }
                if (endTime != "")//结束时间
                {
                    expr = expr.And(n => n.Log_Time <= Common.GetDateTime(end));

                    i++;
                }
                if (beginTime != "" && endTime != "")
                {
                    if (Common.GetDateTime(beginTime) > Common.GetDateTime(endTime))
                    {
                        MessageBox.Show("查询开始时间不能大于结束时间!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        dtiBegin.Text = "";
                        dtiEnd.Text   = "";
                        return;
                    }
                }
                if (cmb_type.SelectedValue != null)
                {
                    int stateID = Converter.ToInt(cmb_type.SelectedValue.ToString());
                    if (stateID > 0)
                    {
                        Dictionary dicEntity = cmb_type.SelectedItem as Dictionary;
                        if (dicEntity.Dictionary_Value == "全部")
                        {
                            expr = n => n.Log_ID != null;
                        }
                        else
                        {
                            expr = expr.And(n => n.Log_Dictionary_ID == Common.GetInt(cmb_type.SelectedValue.ToString()));
                        }
                    }


                    i++;
                }

                if (i == 0)
                {
                    expr = n => n.Log_ID != null;
                }
            }
            catch (Exception ex)
            {
                Common.WriteTextLog("SystemOperate.btnxSearchWhere()" + ex.Message.ToString());
            }
            finally
            {
                page = new PageControl();
                page.PageMaxCount = tscbxPageSize2.SelectedItem.ToString();
                LoadData();
            }
        }