Example #1
0
        public void BindTopTool()
        {
            ToolBarHelper tsHelper = new ToolBarHelper();

            this.top_tool_bar.SaveClicked += new EventHandler(top_tool_bar_SaveClicked);

            scanBtn = tsHelper.New("扫描", QX.GenFramework.Properties.Resources.gantan, new EventHandler(scanBtn_Click));

            this.top_tool_bar.AddCustomControl(scanBtn);

            Bll_Bse_Dict dcInstance = new Bll_Bse_Dict();
            List<Bse_Dict> list = dcInstance.GetDictByKey("ScanMode");

            comboStat.DataSource = list;
            comboStat.DisplayMember = "Dict_Name";
            comboStat.ValueMember = "Dict_Code";
            comboStat.Tag = list;

            ToolStripControlHost comboStatHost = new ToolStripControlHost(comboStat);
            comboStatHost.Margin = new Padding(5, 0, 0, 0);
            this.top_tool_bar.AddCustomControl(6, comboStatHost);
        }
Example #2
0
        /// <summary>
        /// 零件图号 回车事件处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void comCode_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                var uCom = (UltraCombo)sender;
                string val = uCom.Text;
                if (!string.IsNullOrEmpty(val))
                {
                    try
                    {
                        List<Tpl_ReqDoc> dlist = LoadReqDoc(val);
                        comGrid.EventManager.SetEnabled(EventGroups.AllEvents, false);
                        Bll_Bse_Dict dictInstance = new Bll_Bse_Dict();
                        comGrid.DisplayLayout.Override.AllowAddNew = AllowAddNew.TemplateOnBottom;
                        var dictList = dictInstance.GetDictByKey("DocType");
                        foreach (var d in dlist)
                        {
                            UltraGridRow nrow = comGrid.DisplayLayout.Bands[0].AddNew();
                            nrow.Cells["PRDQ_IsNeed"].Value = d.TPRD_IsReq;
                            var dict = dictList.FirstOrDefault(o => o.Dict_Code == d.TPRD_Type);

                            nrow.Cells["PRDQ_Name"].Value = dict.Dict_Name + "报告";
                            nrow.Cells["PRDQ_Type"].Value = d.TPRD_Type;
                            nrow.Cells["PRDQ_Date"].Value = DateTime.Now;
                            nrow.Cells["PRDQ_Owner"].Value = SessionConfig.UserName;
                            nrow.Cells["PRDQ_Result"].Value = "Check";

                        }

                        uCom.Focus();

                        comGrid.EventManager.SetEnabled(EventGroups.AllEvents, true);
                    }
                    catch (Exception ex)
                    {
                        //写入数据库日志
                        PlateLog.WriteError(SessionConfig.UserID, SessionConfig.UserName,
                            "", "CompManage",
                           ex.Message, PlateLog.LogMessageType.Error, ex);
                    }
                }
            }
        }
Example #3
0
        private void BindTopTool()
        {
            #region 库存

            Bll_Bse_Dict dcInstance = new Bll_Bse_Dict();
            List<Bse_Dict> list = dcInstance.GetDictByKey("SearchType");

            comboStat.DataSource = list;
            comboStat.DisplayMember = "Dict_Name";
            comboStat.ValueMember = "Dict_Code";
            comboStat.Tag = list;

            this.top_tool_bar.SearchClicked += new EventHandler(top_tool_bar_SearchClicked);
            this.top_tool_bar.AddSearchAllModule();

            ToolStripControlHost comboStatHost = new ToolStripControlHost(comboStat);
            comboStatHost.Margin = new Padding(5, 0, 0, 0);
            this.top_tool_bar.AddCustomControl(6, comboStatHost);
            ToolBarHelper tsHelper = new ToolBarHelper();
            ToolStripButton btnDownload = tsHelper.New("下载", QX.GenFramework.Properties.Resources.import, new EventHandler(btnDownload_Click));

            this.top_tool_bar.AddCustomControl(9, btnDownload);
            #endregion
        }
Example #4
0
 void BatchComp_Load(object sender, EventArgs e)
 {
     Bll_Bse_Dict dictInstance = new Bll_Bse_Dict();
     DictList = dictInstance.GetDictByKey("DocType");
     GModel = new Prod_Components();
     this.FormClosed += new FormClosedEventHandler(BatchComp_FormClosed);
     BindData();
 }
Example #5
0
        public void BindData()
        {
            //bmHelper.BindModelToControl<Prod_Components>(GModel, this.gpBse.Controls, "");
            BLL.Bll_Bse_Dict dictInstance = new QX.BLL.Bll_Bse_Dict();
            List<Bse_Dict> list1 = dictInstance.GetDictByKey("DocType");
            List<Prod_Doc> list = new List<Prod_Doc>();
            foreach (var d in list1)
            {
                Prod_Doc doc = new Prod_Doc();
                doc.PRDQ_Type = d.Dict_Code;
                doc.PRDQ_iType = iTypeEnum.Comp.ToString();
                doc.PRDQ_Name = d.Dict_Name + "报告";
                doc.PRDQ_IsNeed = "Yes";
                list.Add(doc);
            }
            //List<Prod_Doc> list = compInstance.getpd(GModel.PRDC_CompNo);
            List<CC_File> fileList = new List<CC_File>();
            CurrentDataSource = fileList.ToList();
            BindingSource dataSource = new BindingSource();
            dataSource.DataSource = list;
            comGrid.DataSource = dataSource;

            BindingSource data11 = new BindingSource();
            data11.DataSource = CompSource;
            otherCompGrid.DataSource = data11;

            InitRefCompList = new Dictionary<string, List<Prod_Components>>();
            RefCompList = new Dictionary<string, List<Prod_Components>>();
        }