Example #1
0
 private void FromCurrentWeightData_Load(object sender, EventArgs e)
 {
     mainForm = ((WeightAssessmentForm)this.Owner).mainForm;
     if (flag == 0)
     {
         this.Text = "基准重量设计数据  当前重量设计数据";
         refreshTreeView(mainForm.designProjectData.lstWeightArithmetic);
     }
     else if (flag == 1)
     {
         this.Text = "基准重量数据  当前重量调整数据";
         this.refreshTreeView(mainForm.designProjectData.lstAdjustmentResultData);
     }
     else if (flag == 2)
     {
         this.Text = "基准重量数据  型号重量数据库数据";
         this.refreshDB.Visible = true;
         BLLTypeWeightData bllTypeWeightData = new BLLTypeWeightData();
         lstTypeWeight = bllTypeWeightData.GetListModel();
         this.refreshTreeView(lstTypeWeight);
     }
     else if (flag == 3)
     {
         this.Text = "基准重量数据  设计重量数据库数据";
         this.refreshDB.Visible = true;
         BLLWeightDesignData bllWeightDesign = new BLLWeightDesignData();
         lstWeightDesign = bllWeightDesign.GetListModel();
         this.refreshTreeView(lstWeightDesign);
     }
 }
        /// <summary>
        /// 从型号重量数据库导入
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void memu1FromTypeDBImport_Click(object sender, EventArgs e)
        {
            BLLTypeWeightData bllTypeWeight = new BLLTypeWeightData();

            List <TypeWeightData> lstTypeWeight = bllTypeWeight.GetListModel();

            if (lstTypeWeight.Count == 0)
            {
                XLog.Write("数据库没有型号重量数据");
                MessageBox.Show("数据库没有型号重量数据");
                return;
            }
            strWeightDataType = "data1";
            ImportWeightDataListForm form = new ImportWeightDataListForm(this, lstTypeWeight, "typeDB");

            form.ShowDialog();
        }
        /// <summary>
        /// 刷新事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnRefush_Click(object sender, EventArgs e)
        {
            if (strImportType == "typeDB")
            {
                BLLTypeWeightData bllTypeData = new BLLTypeWeightData();
                lstTypeWeight = bllTypeData.GetListModel();
            }
            if (strImportType == "weighteDB")
            {
                BLLWeightDesignData bllWeightDesign = new BLLWeightDesignData();
                lstWeightDesign = bllWeightDesign.GetListModel();
            }

            BindListData();
            selNode = null;
            treeViewWeightData.SelectedNode = null;
        }
        public SelectWeightDataForm(WeightAdjustmentForm _form, string _grpText, bool btnRefresh)
        {
            InitializeComponent();

            this.grpBx_WeightDataList.Text = grpText;
            this.btn_Refresh.Visible = btnRefresh;
            grpText = _grpText;
            form = _form;

            if (grpText == "型号重量数据列表")
            {
                BLLTypeWeightData bllTypeWeightData = new BLLTypeWeightData();
                lstTypeWeight = bllTypeWeightData.GetListModel();
            }
            if (grpText == "重量设计数据列表")
            {
                BLLWeightDesignData bllWeightDesign = new BLLWeightDesignData();
                lstWeightDesign = bllWeightDesign.GetListModel();
            }
        }
        public SelectWeightDataForm(WeightAdjustmentForm _form, string _grpText, bool btnRefresh)
        {
            InitializeComponent();

            this.grpBx_WeightDataList.Text = grpText;
            this.btn_Refresh.Visible       = btnRefresh;
            grpText = _grpText;
            form    = _form;

            if (grpText == "型号重量数据列表")
            {
                BLLTypeWeightData bllTypeWeightData = new BLLTypeWeightData();
                lstTypeWeight = bllTypeWeightData.GetListModel();
            }
            if (grpText == "重量设计数据列表")
            {
                BLLWeightDesignData bllWeightDesign = new BLLWeightDesignData();
                lstWeightDesign = bllWeightDesign.GetListModel();
            }
        }
        /// <summary>
        /// 刷新事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnRefush_Click(object sender, EventArgs e)
        {
            if (strImportType == "typeDB")
            {
                BLLTypeWeightData bllTypeData = new BLLTypeWeightData();
                lstTypeWeight = bllTypeData.GetListModel();
            }
            if (strImportType == "weighteDB")
            {
                BLLWeightDesignData bllWeightDesign = new BLLWeightDesignData();
                lstWeightDesign = bllWeightDesign.GetListModel();
            }

            BindListData();
            selNode = null;
            treeViewWeightData.SelectedNode = null;
        }
 private void FromCurrentWeightData_Load(object sender, EventArgs e)
 {
     mainForm = ((WeightAssessmentForm)this.Owner).mainForm;
     if (flag == 0)
     {
         this.Text = "基准重量设计数据  当前重量设计数据";
         refreshTreeView(mainForm.designProjectData.lstWeightArithmetic);
     }
     else if (flag == 1)
     {
         this.Text = "基准重量数据  当前重量调整数据";
         this.refreshTreeView(mainForm.designProjectData.lstAdjustmentResultData);
     }
     else if (flag == 2)
     {
         this.Text = "基准重量数据  型号重量数据库数据";
         this.refreshDB.Visible = true;
         BLLTypeWeightData bllTypeWeightData = new BLLTypeWeightData();
         lstTypeWeight = bllTypeWeightData.GetListModel();
         this.refreshTreeView(lstTypeWeight);
     }
     else if (flag == 3)
     {
         this.Text = "基准重量数据  设计重量数据库数据";
         this.refreshDB.Visible = true;
         BLLWeightDesignData bllWeightDesign = new BLLWeightDesignData();
         lstWeightDesign = bllWeightDesign.GetListModel();
         this.refreshTreeView(lstWeightDesign);
     }
 }