예제 #1
0
        /// <summary>
        /// 当前工程材机
        /// </summary>
        private void initCurrentUnit()
        {
            CurrentUnit form = new CurrentUnit();

            form.Activitie       = this.Activitie;
            form.DataSource      = this.DataSource;
            form.Text            = "当前工程材机";
            form.TopLevel        = false;
            form.Dock            = DockStyle.Fill;
            form.FormBorderStyle = FormBorderStyle.None;
            form.Visible         = true;
            xtraTabPage1.Controls.Add(form);
        }
예제 #2
0
        /// <summary>
        /// 获取要植入的信息
        /// </summary>
        public DataRow GetNewInfo()
        {
            switch (this.xtraTabControl1.SelectedTabPage.Text)
            {
            case "当前工程材机":
                CurrentUnit m_CurrentUnitSelect = this.xtraTabControl1.SelectedTabPage.Controls[0] as CurrentUnit;
                DataRow     m_CurrentUnit       = m_CurrentUnitSelect.bandedGridViewBDGLJ.GetFocusedDataRow();
                if (m_CurrentUnit != null)
                {
                    this.new_info         = this.Activitie.StructSource.ModelQuantity.NewRow();
                    this.new_info["YSBH"] = m_CurrentUnit["YSBH"];
                    this.new_info["YSMC"] = m_CurrentUnit["YSMC"];
                    this.new_info["YSDW"] = m_CurrentUnit["YSDW"];
                    this.new_info["DEDJ"] = m_CurrentUnit["DEDJ"];
                    this.new_info["BH"]   = m_CurrentUnit["BH"];
                    this.new_info["MC"]   = m_CurrentUnit["MC"];
                    this.new_info["DW"]   = m_CurrentUnit["DW"];
                    this.new_info["LB"]   = m_CurrentUnit["LB"];
                    this.new_info["SCDJ"] = m_CurrentUnit["SCDJ"];
                }
                break;

            case "系统材机库":
                SysWoodMachineForm sysWoodMachineForm = this.xtraTabControl1.SelectedTabPage.Controls[0] as SysWoodMachineForm;
                DataRowView        drv = sysWoodMachineForm.bindingSource1.Current as DataRowView;
                if (drv != null)
                {
                    this.new_info           = this.Activitie.StructSource.ModelQuantity.NewRow();
                    this.new_info["IFSC"]   = drv.Row["CAIJSC"].Equals("是") ? true : false;
                    this.new_info["YSBH"]   = drv.Row["CAIJBH"];
                    this.new_info["YSMC"]   = drv.Row["CAIJMC"];
                    this.new_info["YSDW"]   = drv.Row["CAIJDW"];
                    this.new_info["DEDJ"]   = ToolKit.ParseDecimal(drv.Row["CAIJDJ"]);
                    this.new_info["BH"]     = drv.Row["CAIJBH"];
                    this.new_info["MC"]     = drv.Row["CAIJMC"];
                    this.new_info["DW"]     = drv.Row["CAIJDW"];
                    this.new_info["IFZYCL"] = drv.Row["CAIJXSJG"].Equals("是") ? true : false;
                    this.new_info["LB"]     = drv.Row["CAIJLB"];
                    this.new_info["SCDJ"]   = ToolKit.ParseDecimal(drv.Row["CAIJDJ"]);
                    this.new_info["SDCLB"]  = drv.Row["SANDCMC"];
                    this.new_info["SDCXS"]  = ToolKit.ParseDecimal(drv.Row["SANDCXS"]);
                }
                break;

            case "用户价格库":    //"用户材机库":
                UserQuantityUnitSelect userQuantityUnitSelect = this.xtraTabControl1.SelectedTabPage.Controls[0] as UserQuantityUnitSelect;
                DataRowView            m_UserQuantityUnit     = userQuantityUnitSelect.bindingSource1.Current as DataRowView;
                if (m_UserQuantityUnit != null)
                {
                    this.new_info         = this.Activitie.StructSource.ModelQuantity.NewRow();
                    this.new_info["YSBH"] = m_UserQuantityUnit["YSBH"];
                    this.new_info["YSMC"] = m_UserQuantityUnit["YSMC"];
                    this.new_info["YSDW"] = m_UserQuantityUnit["YSDW"];
                    this.new_info["DEDJ"] = m_UserQuantityUnit["DEDJ"];
                    this.new_info["BH"]   = m_UserQuantityUnit["BH"];
                    this.new_info["MC"]   = m_UserQuantityUnit["MC"];
                    this.new_info["DW"]   = m_UserQuantityUnit["DW"];
                    this.new_info["LB"]   = m_UserQuantityUnit["LB"];
                    this.new_info["SCDJ"] = m_UserQuantityUnit["SCDJ"];
                }
                break;

            case "补充材机库":
                RepairQuantityUnitSelect repairQuantityUnitSelect = this.xtraTabControl1.SelectedTabPage.Controls[0] as RepairQuantityUnitSelect;
                DataRowView m_RepairQuantityUnit = repairQuantityUnitSelect.bindingSource1.Current as DataRowView;
                if (m_RepairQuantityUnit != null)
                {
                    this.new_info         = this.Activitie.StructSource.ModelQuantity.NewRow();
                    this.new_info["YSBH"] = m_RepairQuantityUnit["YSBH"];
                    this.new_info["YSMC"] = m_RepairQuantityUnit["YSMC"];
                    this.new_info["YSDW"] = m_RepairQuantityUnit["YSDW"];
                    this.new_info["DEDJ"] = m_RepairQuantityUnit["DEDJ"];
                    this.new_info["BH"]   = m_RepairQuantityUnit["BH"];
                    this.new_info["MC"]   = m_RepairQuantityUnit["MC"];
                    this.new_info["DW"]   = m_RepairQuantityUnit["DW"];
                    this.new_info["LB"]   = m_RepairQuantityUnit["LB"];
                    this.new_info["SCDJ"] = m_RepairQuantityUnit["SCDJ"];
                }
                break;

            default:
                break;
            }
            return(this.new_info);
        }