Ejemplo n.º 1
0
        public void Init()
        {
            var list = new DAL_dt_Settings().GetCodeList();

            cbb_code.DataSource    = list;
            cbb_code.DisplayMember = "name";
            cbb_code.ValueMember   = "id";
            cbb_code.SelectedIndex = 0;
        }
Ejemplo n.º 2
0
        private void btn_Ok_Click(object sender, EventArgs e)
        {
            string code = btn_JianYanBianHao.Text;

            if (string.IsNullOrWhiteSpace(txt_jianceshuliang.Text))
            {
                MessageBox.Show("请输入规格数量!", "警告!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (string.IsNullOrWhiteSpace(cb_DangQianDangHao.Text))
            {
                MessageBox.Show("请设置樘号!", "警告!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (string.IsNullOrWhiteSpace(code))
            {
                MessageBox.Show("请设置当前编号!", "警告!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            DAL_dt_Settings dal = new DAL_dt_Settings();

            try
            {
                var setting = GetSettings();
                var tong    = this.cb_DangQianDangHao.Text;
                if (dal.Add(setting, tong))
                {
                    //  MessageBox.Show("设定完成!", "完成", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    //获取樘号
                    deleBottomTypeEvent(GetBottomType(true));
                    DefaultBase.base_SpecCount = int.Parse(txt_jianceshuliang.Text);
                    DefaultBase.base_TestItem  = cb_JianCeXiangMu.Text;
                    DefaultBase.LockPoint      = cbb_danshandansuodian.Text == "是" ? true : false;

                    int def = 0;
                    int.TryParse(txt_ganjianchangdu.Text, out def);

                    DefaultBase.BarLength   = def;
                    this.btn_add.Enabled    = true;
                    this.btn_select.Enabled = true;
                    this.btn_delete.Enabled = true;
                    this.btn_Ok.Enabled     = true;

                    // this.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("添加异常!", "异常", MessageBoxButtons.OK, MessageBoxIcon.Information);
                Logger.Error(ex);
            }
        }
Ejemplo n.º 3
0
        private void btn_Ok_Click(object sender, EventArgs e)
        {
            string code = btn_JianYanBianHao.Text;

            if (string.IsNullOrWhiteSpace(btn_GuiGeShuLiang.Text))
            {
                MessageBox.Show("请输入规格数量!", "警告!", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification);
                return;
            }

            if (string.IsNullOrWhiteSpace(cb_DangQianDangHao.Text))
            {
                MessageBox.Show("请设置樘号!", "警告!", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification);
                return;
            }

            if (string.IsNullOrWhiteSpace(code))
            {
                MessageBox.Show("请设置当前编号!", "警告!", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification);
                return;
            }

            DAL_dt_Settings dal = new DAL_dt_Settings();

            try
            {
                var setting = GetSettings();
                var tong    = this.cb_DangQianDangHao.Text;
                if (dal.Add(setting, tong))
                {
                    MessageBox.Show("设定完成!", "完成", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification);
                    //获取樘号
                    deleBottomTypeEvent(GetBottomType(true));
                    DefaultBase.base_SpecCount = int.Parse(btn_GuiGeShuLiang.Text);
                    DefaultBase.base_TestItem  = cb_JianYanXiangMu.Text;

                    this.btn_add.Enabled    = true;
                    this.btn_select.Enabled = true;
                    this.btn_delete.Enabled = true;
                    this.btn_Ok.Enabled     = true;
                    //this.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("添加异常!", "异常", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification);
                Logger.Error(ex);
            }
        }
Ejemplo n.º 4
0
        private void btn_Ok_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(txt_Code.Text))
            {
                MessageBox.Show("请输入编号", " 警告", MessageBoxButtons.OKCancel, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification);
                return;
            }

            DataTable dt = new DAL_dt_Settings().Getdt_SettingsByCode(txt_Code.Text);

            if (dt == null)
            {
                MessageBox.Show("暂未查询此编号内容", " 警告", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification);
                return;
            }

            var args = new TransmitEventArgs(dt.Rows[0]["dt_Code"].ToString(), dt.Rows[0]["info_DangH"].ToString());

            Transmit(this, args);
            this.Dispose();
        }
        private void btn_audit_Click(object sender, EventArgs e)
        {
            try
            {
                #region     修改数据
                if (_settings.dt_qm_Info != null && _settings.dt_qm_Info.Count > 0)
                {
                    for (int i = 0; i < _settings.dt_qm_Info.Count; i++)
                    {
                        var setting = _settings.dt_qm_Info[i];
                        setting.dt_Code    = _code;
                        setting.info_DangH = groupBox1.Text;
                        if (i == 0)
                        {
                            setting.info_DangH = groupBox1.Text;
                            setting.qm_Z_FC    = txt_1zfc.Text;
                            setting.qm_F_FC    = txt_1ffc.Text;
                            setting.qm_Z_MJ    = txt_1zmj.Text;
                            setting.qm_F_MJ    = txt_1fmj.Text;
                        }
                        if (i == 1)
                        {
                            setting.info_DangH = groupBox2.Text;
                            setting.qm_Z_FC    = txt_2zfc.Text;
                            setting.qm_F_FC    = txt_2ffc.Text;
                            setting.qm_Z_MJ    = txt_2zmj.Text;
                            setting.qm_F_MJ    = txt_2fmj.Text;
                        }
                        if (i == 2)
                        {
                            setting.info_DangH = groupBox3.Text;
                            setting.qm_Z_FC    = txt_3zfc.Text;
                            setting.qm_F_FC    = txt_3ffc.Text;
                            setting.qm_Z_MJ    = txt_3zmj.Text;
                            setting.qm_F_MJ    = txt_3fmj.Text;
                        }
                    }
                }

                if (_settings.dt_sm_Info != null && _settings.dt_sm_Info.Count > 0)
                {
                    for (int i = 0; i < _settings.dt_sm_Info.Count; i++)
                    {
                        var setting = _settings.dt_sm_Info[i];
                        setting.info_DangH = groupBox1.Text;
                        if (i == 0)
                        {
                            setting.info_DangH = groupBox1.Text;
                            setting.sm_Pa      = txt_1fy.Text;
                            setting.sm_PaDesc  = lbl_1resdesc.Text;
                            setting.sm_Remark  = lbl_1desc.Text;
                        }
                        if (i == 1)
                        {
                            setting.info_DangH = groupBox2.Text;
                            setting.sm_Pa      = txt_2fy.Text;
                            setting.sm_PaDesc  = lbl_2resdesc.Text;
                            setting.sm_Remark  = lbl_2desc.Text;
                        }
                        if (i == 2)
                        {
                            setting.info_DangH = groupBox3.Text;
                            setting.sm_Pa      = txt_3fy.Text;
                            setting.sm_PaDesc  = lbl_3resdesc.Text;
                            setting.sm_Remark  = lbl_3desc.Text;
                        }
                    }
                }
                if (_settings.dt_kfy_Info != null && _settings.dt_kfy_Info.Count > 0)
                {
                    for (int i = 0; i < _settings.dt_kfy_Info.Count; i++)
                    {
                        var setting = _settings.dt_kfy_Info[i];
                        setting.info_DangH = groupBox1.Text;
                        if (i == 0)
                        {
                            setting.info_DangH = groupBox1.Text;
                            setting.p1         = txt_p11.Text;
                            setting._p1        = txt_f_p11.Text;
                            setting.p2         = txt_p21.Text;
                            setting._p2        = txt_f_p21.Text;
                            setting.p3         = txt_p31.Text;
                            setting._p3        = txt_f_p31.Text;
                        }
                        if (i == 1)
                        {
                            setting.info_DangH = groupBox2.Text;
                            setting.p1         = txt_p12.Text;
                            setting._p1        = txt_f_p12.Text;
                            setting.p2         = txt_p22.Text;
                            setting._p2        = txt_f_p22.Text;
                            setting.p3         = txt_p32.Text;
                            setting._p3        = txt_f_p32.Text;
                        }
                        if (i == 2)
                        {
                            setting.info_DangH = groupBox3.Text;
                            setting.p1         = txt_p13.Text;
                            setting._p1        = txt_f_p13.Text;
                            setting.p2         = txt_p23.Text;
                            setting._p2        = txt_f_p23.Text;
                            setting.p3         = txt_p33.Text;
                            setting._p3        = txt_f_p33.Text;
                        }
                    }
                }
                new DAL_dt_qm_Info().UpdateResult(_settings);

                #endregion

                #region 获取设置后的樘号信息 --   判定

                InitResult();


                Formula   formula  = new Formula();
                DataTable settings = new DAL_dt_Settings().Getdt_SettingsByCode(_code);
                if (settings != null && settings.Rows.Count > 0)
                {
                    txt_sjz0.Text = settings.Rows[0]["KangFengYaSheJiZhi"].ToString();
                    txt_sjz1.Text = settings.Rows[0]["ShuiMiSheJiZhi"].ToString();
                    txt_sjz2.Text = settings.Rows[0]["QiMiZhengYaDanWeiFengChangSheJiZhi"].ToString();
                    txt_sjz3.Text = settings.Rows[0]["QiMiFuYaDanWeiFengChangSheJiZhi"].ToString();
                    txt_sjz4.Text = settings.Rows[0]["QiMiZhengYaDanWeiMianJiSheJiZhi"].ToString();
                    txt_sjz5.Text = settings.Rows[0]["QiMiFuYaDanWeiMianJiSheJiZhi"].ToString();
                }
                if (_settings.dt_qm_Info != null && _settings.dt_qm_Info.Count > 0)
                {
                    var airTight = _settings.dt_qm_Info;
                    txt_dj1.Text = formula.Get_Z_AirTightLevel(airTight).ToString();
                    txt_dj4.Text = formula.Get_F_AirTightLevel(airTight).ToString();

                    double zFc = Math.Round(airTight.Sum(t => double.Parse(t.qm_Z_FC)) / airTight.Count, 2);
                    double fFc = Math.Round(airTight.Sum(t => double.Parse(t.qm_F_FC)) / airTight.Count, 2);
                    double zMj = Math.Round(airTight.Sum(t => double.Parse(t.qm_Z_MJ)) / airTight.Count, 2);
                    double fMj = Math.Round(airTight.Sum(t => double.Parse(t.qm_F_MJ)) / airTight.Count, 2);

                    if (zFc <= double.Parse(txt_sjz2.Text))
                    {
                        txt_jg2.Text = "合格";
                    }
                    else
                    {
                        txt_jg2.Text = "不合格";
                    }

                    if (fFc <= double.Parse(txt_sjz3.Text))
                    {
                        txt_jg3.Text = "合格";
                    }
                    else
                    {
                        txt_jg3.Text = "不合格";
                    }

                    if (zMj <= double.Parse(txt_sjz4.Text))
                    {
                        txt_jg4.Text = "合格";
                    }
                    else
                    {
                        txt_jg4.Text = "不合格";
                    }

                    if (fMj <= double.Parse(txt_sjz4.Text))
                    {
                        txt_jg5.Text = "合格";
                    }
                    else
                    {
                        txt_jg5.Text = "不合格";
                    }
                }

                if (_settings.dt_sm_Info != null && _settings.dt_sm_Info.Count > 0)
                {
                    txt_dj2.Text = formula.GetWaterTightLevel(_settings.dt_sm_Info).ToString();

                    sm_value = _settings.dt_sm_Info.Sum(t => Convert.ToInt32(t.sm_Pa)) / _settings.dt_sm_Info.Count;

                    if (sm_value >= int.Parse(txt_sjz1.Text))
                    {
                        txt_jg1.Text = "合格";
                    }
                    else
                    {
                        txt_jg1.Text = "不合格";
                    }
                }

                if (_settings.dt_kfy_Info != null && _settings.dt_kfy_Info.Count > 0)
                {
                    var value = new List <int>();

                    foreach (var item in _settings.dt_kfy_Info)
                    {
                        value.Add(int.Parse(item.p3));
                        value.Add(int.Parse(item._p3));
                    }
                    var minValue = value.Min(t => t);
                    txt_dj3.Text = Formula.GetWindPressureLevel(minValue).ToString();
                    if (minValue >= double.Parse(txt_sjz0.Text))
                    {
                        txt_jg0.Text = "合格";
                    }
                    else
                    {
                        txt_jg0.Text = "不合格";
                    }
                }

                #endregion
                MessageBox.Show("生成成功!", "完成", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Logger.Error(ex);
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 绑定控件
        /// </summary>
        private void BindInfoText()
        {
            try
            {
                DataTable dt = new DAL_dt_Settings().Getdt_SettingsByCode(_tempCode);
                if (dt != null)
                {
                    this.txt_WeiTuoBianHao.Text      = dt.Rows[0]["weituobianhao"].ToString();
                    this.txt_WeiTuoDanWei.Text       = dt.Rows[0]["weituodanwei"].ToString();
                    this.txt_dizhi.Text              = dt.Rows[0]["dizhi"].ToString();
                    this.txt_dianhua.Text            = dt.Rows[0]["dianhua"].ToString();
                    this.txt_chouyangriqi.Text       = dt.Rows[0]["chouyangriqi"].ToString();
                    this.txt_chouyangdidian.Text     = dt.Rows[0]["chouyangdidian"].ToString();
                    this.txt_gongchengmingcheng.Text = dt.Rows[0]["gongchengmingcheng"].ToString();
                    this.txt_gongchengdidian.Text    = dt.Rows[0]["gongchengdidian"].ToString();
                    this.txt_shengchandanwei.Text    = dt.Rows[0]["shengchandanwei"].ToString();
                    this.cb_JianCeXiangMu.Text       = dt.Rows[0]["jiancexiangmu"].ToString();
                    this.txt_jiancedidian.Text       = dt.Rows[0]["jiancedidian"].ToString();
                    this.txt_JianCeRiQi.Text         = dt.Rows[0]["jianceriqi"].ToString();
                    this.txt_jianceshebei.Text       = dt.Rows[0]["jianceshebei"].ToString();
                    this.cb_jianceyiju.Text          = dt.Rows[0]["jianceyiju"].ToString();

                    this.txt_YangPinMingCheng.Text = dt.Rows[0]["yangpinmingcheng"].ToString();
                    this.txt_yangpinshangbiao.Text = dt.Rows[0]["yangpinshangbiao"].ToString();
                    this.txt_yangpinzhuangtai.Text = dt.Rows[0]["yangpinzhuangtai"].ToString();
                    this.txt_GuiGeXingHao.Text     = dt.Rows[0]["guigexinghao"].ToString();
                    this.cb_KaiQiFangShi.Text      = dt.Rows[0]["kaiqifangshi"].ToString();
                    this.cb_mianbanpinzhong.Text   = dt.Rows[0]["mianbanpinzhong"].ToString();
                    this.txt_zuidamianban.Text     = dt.Rows[0]["zuidamianban"].ToString();
                    this.txt_mianbanhoudu.Text     = dt.Rows[0]["mianbanhoudu"].ToString();
                    this.cb_anzhuangfangshi.Text   = dt.Rows[0]["anzhuangfangshi"].ToString();
                    this.cb_mianbanxiangqian.Text  = dt.Rows[0]["mianbanxiangqian"].ToString();
                    this.cb_KuangShanMiFang.Text   = dt.Rows[0]["kuangshanmifeng"].ToString();
                    this.txt_wujinpeijian.Text     = dt.Rows[0]["wujinpeijian"].ToString();
                    this.txt_jianceshuliang.Text   = dt.Rows[0]["jianceshuliang"].ToString();
                    this.cb_DangQianDangHao.Text   = dt.Rows[0]["dangqiandanghao"].ToString();

                    this.txt_DangQianWenDu.Text   = dt.Rows[0]["dangqianwendu"].ToString();
                    this.txt_DaQiYaLi.Text        = dt.Rows[0]["daqiyali"].ToString();
                    this.txt_KaiQiFengChang.Text  = dt.Rows[0]["kaiqifengchang"].ToString();
                    this.txt_shijianmianji.Text   = dt.Rows[0]["shijianmianji"].ToString();
                    this.txt_ganjianchangdu.Text  = dt.Rows[0]["ganjianchangdu"].ToString();
                    this.txt_penlinshuiliang.Text = dt.Rows[0]["penlinshuiliang"].ToString();
                    this.txt_qimidangweifengchangshejizhi.Text = dt.Rows[0]["qimidanweifengchangshejizhi"].ToString();
                    this.txt_QiMiDanWeiMianJiSheJiZhi.Text     = dt.Rows[0]["qimidanweimianjishejizhi"].ToString();
                    this.txt_shuimijingyashejizhi.Text         = dt.Rows[0]["shuimijingyashejizhi"].ToString();
                    this.txt_shuimidongyashejizhi.Text         = dt.Rows[0]["shuimidongyashejizhi"].ToString();
                    this.txt_kangfengyazhengyashejizhi.Text    = dt.Rows[0]["kangfengyazhengyashejizhi"].ToString();
                    this.txt_kangfengyafuyashejizhi.Text       = dt.Rows[0]["kangfengyafuyashejizhi"].ToString();
                    this.cbb_danshandansuodian.Text            = dt.Rows[0]["danshandansuodian"].ToString();

                    this.txt_kangfengyazhengp3shejizhi.Text   = dt.Rows[0]["kangfengyazhengp3shejizhi"].ToString();
                    this.txt_kangfengyazhengpmaxshejizhi.Text = dt.Rows[0]["kangfengyazhengpmaxshejizhi"].ToString();


                    _tempCode = dt.Rows[0]["dt_Code"].ToString();
                    if (_tempTong == "")
                    {
                        _tempTong = dt.Rows[0]["info_DangH"].ToString();
                    }
                    cb_DangQianDangHao.Text         = dt.Rows[0]["info_DangH"].ToString();
                    btn_JianYanBianHao.Text         = dt.Rows[0]["dt_Code"].ToString();
                    this.cb_JianCeXiangMu.Enabled   = false;
                    this.txt_jianceshuliang.Enabled = false;
                }
                else
                {
                    btn_JianYanBianHao.Text = DateTime.Now.ToString("yyyyMMdd") + "-01";
                }

                if (string.IsNullOrEmpty(txt_jianceshuliang.Text))
                {
                    txt_jianceshuliang.Text = "3";
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Logger.Error(ex);
            }
        }
        /// <summary>
        /// 绑定风速
        /// </summary>
        private void BindWindSpeedBase()
        {
            Model_dt_Settings dt_Settings  = new DAL_dt_Settings().GetInfoByCode(_tempCode);
            List <Pressure>   pressureList = new List <Pressure>();

            if (dt_Settings.dt_qm_Info != null && dt_Settings.dt_qm_Info.Count > 0)
            {
                var qm = dt_Settings.dt_qm_Info.FindAll(t => t.info_DangH == _tempTong && string.IsNullOrWhiteSpace(t.qm_j_f_zd100) == false).OrderBy(t => t.info_DangH);
                //是否首次加载
                if (IsFirst && (qm != null && qm.Count() > 0))
                {
                    gv_list.Enabled = false;
                    foreach (var item in qm)
                    {
                        Pressure model1 = new Pressure();
                        model1.Pressure_F   = string.IsNullOrWhiteSpace(item.qm_s_f_fj100) ? 0 : double.Parse(item.qm_s_f_fj100);
                        model1.Pressure_F_Z = string.IsNullOrWhiteSpace(item.qm_s_f_zd100) ? 0 : double.Parse(item.qm_s_f_zd100);

                        model1.Pressure_Z   = string.IsNullOrWhiteSpace(item.qm_s_z_fj100) ? 0 : double.Parse(item.qm_s_z_fj100);
                        model1.Pressure_Z_Z = string.IsNullOrWhiteSpace(item.qm_s_z_zd100) ? 0 : double.Parse(item.qm_s_z_zd100);
                        model1.PressurePa   = 100;
                        pressureList.Add(model1);

                        Pressure model2 = new Pressure();
                        model2.Pressure_F   = string.IsNullOrWhiteSpace(item.qm_s_f_fj150) ? 0 : double.Parse(item.qm_s_f_fj150);
                        model2.Pressure_F_Z = string.IsNullOrWhiteSpace(item.qm_s_f_zd150) ? 0 : double.Parse(item.qm_s_f_zd150);

                        model2.Pressure_Z   = string.IsNullOrWhiteSpace(item.qm_s_z_fj150) ? 0 : double.Parse(item.qm_s_z_fj150);
                        model2.Pressure_Z_Z = string.IsNullOrWhiteSpace(item.qm_s_z_zd150) ? 0 : double.Parse(item.qm_s_z_zd150);
                        model2.PressurePa   = 150;
                        pressureList.Add(model2);

                        Pressure model3 = new Pressure();
                        model3.Pressure_F   = string.IsNullOrWhiteSpace(item.qm_j_f_fj100) ? 0 : double.Parse(item.qm_j_f_fj100);
                        model3.Pressure_F_Z = string.IsNullOrWhiteSpace(item.qm_j_f_zd100) ? 0 : double.Parse(item.qm_j_f_zd100);

                        model3.Pressure_Z   = string.IsNullOrWhiteSpace(item.qm_j_z_fj100) ? 0 : double.Parse(item.qm_j_z_fj100);
                        model3.Pressure_Z_Z = string.IsNullOrWhiteSpace(item.qm_j_z_zd100) ? 0 : double.Parse(item.qm_j_z_zd100);
                        model3.PressurePa   = 100;
                        pressureList.Add(model3);
                    }
                }
                else
                {
                    pressureList = pressure.GetPressure();
                }
            }
            else
            {
                pressureList = pressure.GetPressure();
            }

            dgv_WindSpeed.DataSource                  = pressureList;
            dgv_WindSpeed.Height                      = 115;
            dgv_WindSpeed.RowHeadersVisible           = false;
            dgv_WindSpeed.AllowUserToResizeColumns    = false;
            dgv_WindSpeed.AllowUserToResizeRows       = false;
            dgv_WindSpeed.Columns[0].HeaderText       = "压力Pa";
            dgv_WindSpeed.Columns[0].Width            = 37;
            dgv_WindSpeed.Columns[0].ReadOnly         = true;
            dgv_WindSpeed.Columns[0].DataPropertyName = "PressurePa";
            dgv_WindSpeed.Columns[1].HeaderText       = "正压附加";
            dgv_WindSpeed.Columns[1].Width            = 55;
            dgv_WindSpeed.Columns[1].DataPropertyName = "Pressure_Z";
            dgv_WindSpeed.Columns[2].HeaderText       = "正压总的";
            dgv_WindSpeed.Columns[2].Width            = 55;
            dgv_WindSpeed.Columns[2].DataPropertyName = "Pressure_Z_Z";
            dgv_WindSpeed.Columns[3].HeaderText       = "负压附加";
            dgv_WindSpeed.Columns[3].Width            = 55;
            dgv_WindSpeed.Columns[3].DataPropertyName = "Pressure_F";
            dgv_WindSpeed.Columns[4].HeaderText       = "负压总的";
            dgv_WindSpeed.Columns[4].Width            = 55;
            dgv_WindSpeed.Columns[4].DataPropertyName = "Pressure_F_Z";


            dgv_WindSpeed.Columns["Pressure_Z"].DefaultCellStyle.Format   = "N2";
            dgv_WindSpeed.Columns["Pressure_Z_Z"].DefaultCellStyle.Format = "N2";
            dgv_WindSpeed.Columns["Pressure_F"].DefaultCellStyle.Format   = "N2";
            dgv_WindSpeed.Columns["Pressure_F_Z"].DefaultCellStyle.Format = "N2";
        }
Ejemplo n.º 8
0
        private void btn_audit_Click(object sender, EventArgs e)
        {
            try
            {
                #region     修改数据
                if (_settings.dt_qm_Info != null && _settings.dt_qm_Info.Count > 0)
                {
                    for (int i = 0; i < _settings.dt_qm_Info.Count; i++)
                    {
                        var setting = _settings.dt_qm_Info[i];
                        setting.dt_Code    = _code;
                        setting.info_DangH = groupBox1.Text;
                        if (i == 0)
                        {
                            setting.qm_Z_FC = txt_1zfc.Text;
                            setting.qm_F_FC = txt_1ffc.Text;
                            setting.qm_Z_MJ = txt_1zmj.Text;
                            setting.qm_F_MJ = txt_1fmj.Text;
                        }
                        if (i == 1)
                        {
                            setting.info_DangH = groupBox2.Text;
                            setting.qm_Z_FC    = txt_2zfc.Text;
                            setting.qm_F_FC    = txt_2ffc.Text;
                            setting.qm_Z_MJ    = txt_2zmj.Text;
                            setting.qm_F_MJ    = txt_2fmj.Text;
                        }
                        if (i == 2)
                        {
                            setting.info_DangH = groupBox3.Text;
                            setting.qm_Z_FC    = txt_3zfc.Text;
                            setting.qm_F_FC    = txt_3ffc.Text;
                            setting.qm_Z_MJ    = txt_3zmj.Text;
                            setting.qm_F_MJ    = txt_3fmj.Text;
                        }
                    }
                }

                if (_settings.dt_sm_Info != null && _settings.dt_sm_Info.Count > 0)
                {
                    for (int i = 0; i < _settings.dt_sm_Info.Count; i++)
                    {
                        var setting = _settings.dt_sm_Info[i];
                        setting.info_DangH = groupBox1.Text;
                        if (i == 0)
                        {
                            setting.sm_Pa     = txt_1fy.Text;
                            setting.sm_PaDesc = lbl_1resdesc.Text;
                            setting.sm_Remark = lbl_1desc.Text;
                        }
                        if (i == 1)
                        {
                            setting.sm_Pa     = txt_2fy.Text;
                            setting.sm_PaDesc = lbl_2resdesc.Text;
                            setting.sm_Remark = lbl_2desc.Text;
                        }
                        if (i == 2)
                        {
                            setting.sm_Pa     = txt_3fy.Text;
                            setting.sm_PaDesc = lbl_3resdesc.Text;
                            setting.sm_Remark = lbl_3desc.Text;
                        }
                    }
                    new DAL_dt_qm_Info().UpdateResult(_settings);

                    #endregion

                    #region 获取设置后的樘号信息 --   判定

                    InitResult();


                    Formula   formula  = new Formula();
                    DataTable settings = new DAL_dt_Settings().Getdt_SettingsByCode(_code);
                    if (settings != null && settings.Rows.Count > 0)
                    {
                        txt_sjz1.Text = settings.Rows[0]["ShuiMiSheJiZhi"].ToString();
                        txt_sjz2.Text = settings.Rows[0]["QiMiZhengYaDanWeiFengChangSheJiZhi"].ToString();
                        txt_sjz3.Text = settings.Rows[0]["QiMiFuYaDanWeiFengChangSheJiZhi"].ToString();
                        txt_sjz4.Text = settings.Rows[0]["QiMiZhengYaDanWeiMianJiSheJiZhi"].ToString();
                        txt_sjz5.Text = settings.Rows[0]["QiMiFuYaDanWeiMianJiSheJiZhi"].ToString();
                    }
                    if (_settings.dt_qm_Info != null && _settings.dt_qm_Info.Count > 0)
                    {
                        var airTight = _settings.dt_qm_Info;
                        txt_dj1.Text = formula.GetAirTightLevel(airTight).ToString();


                        double zFc = Math.Round(airTight.Sum(t => double.Parse(t.qm_Z_FC)) / airTight.Count, 2);
                        double fFc = Math.Round(airTight.Sum(t => double.Parse(t.qm_F_FC)) / airTight.Count, 2);
                        double zMj = Math.Round(airTight.Sum(t => double.Parse(t.qm_Z_MJ)) / airTight.Count, 2);
                        double fMj = Math.Round(airTight.Sum(t => double.Parse(t.qm_F_MJ)) / airTight.Count, 2);


                        if (zFc >= double.Parse(txt_sjz2.Text))
                        {
                            txt_jg2.Text = "合格";
                        }
                        else
                        {
                            txt_jg2.Text = "不合格";
                        }

                        if (fFc >= double.Parse(txt_sjz3.Text))
                        {
                            txt_jg3.Text = "合格";
                        }
                        else
                        {
                            txt_jg3.Text = "不合格";
                        }

                        if (zMj >= double.Parse(txt_sjz4.Text))
                        {
                            txt_jg4.Text = "合格";
                        }
                        else
                        {
                            txt_jg4.Text = "不合格";
                        }

                        if (fMj <= double.Parse(txt_sjz4.Text))
                        {
                            txt_jg5.Text = "合格";
                        }
                        else
                        {
                            txt_jg5.Text = "不合格";
                        }
                    }


                    if (_settings.dt_sm_Info != null && _settings.dt_sm_Info.Count > 0)
                    {
                        txt_dj2.Text = formula.GetWaterTightLevel(_settings.dt_sm_Info).ToString();

                        if (sm_value >= int.Parse(txt_sjz1.Text))
                        {
                            txt_jg1.Text = "合格";
                        }
                        else
                        {
                            txt_jg1.Text = "不合格";
                        }
                    }

                    if (_settings.dt_kfy_Info != null && _settings.dt_kfy_Info.Count > 0)
                    {
                        //todo:抗风压
                    }

                    #endregion
                    MessageBox.Show("生成成功!", "完成", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Logger.Error(ex);
            }
        }
        /// <summary>
        /// 绑定水密初始值
        /// </summary>
        private void Initial()
        {
            //todo
            // Model_dt_Settings dt_Settings = new DAL_dt_Settings().Getdt_SettingsResByCode(_tempCode);
            Model_dt_Settings dt_Settings  = new DAL_dt_Settings().GetInfoByCode(_tempCode);
            List <Pressure>   pressureList = new List <Pressure>();

            if (dt_Settings.dt_qm_Info != null && dt_Settings.dt_qm_Info.Count > 0)
            {
                var sm = dt_Settings.dt_sm_Info.FindAll(t => t.info_DangH == _tempTong);
                if (sm != null && sm.Count() > 0)
                {
                    #region 绑定
                    var checkDesc = sm[0].sm_PaDesc;
                    var sm_pa     = sm[0].sm_Pa;
                    var remark    = sm[0].sm_Remark;

                    var      flish = "";
                    var      two   = "";
                    string[] temp  = null;
                    if (!string.IsNullOrWhiteSpace(checkDesc))
                    {
                        if (checkDesc.Contains("〇"))
                        {
                            temp  = checkDesc.Split(new char[] { '〇' }, StringSplitOptions.RemoveEmptyEntries);
                            flish = temp[0];
                            two   = "〇" + temp[1];
                        }
                        else if (checkDesc.Contains("□"))
                        {
                            temp  = checkDesc.Split(new char[] { '□' }, StringSplitOptions.RemoveEmptyEntries);
                            flish = temp[0];
                            two   = "□" + temp[1];
                        }
                        else if (checkDesc.Contains("△"))
                        {
                            temp  = checkDesc.Split(new char[] { '△' }, StringSplitOptions.RemoveEmptyEntries);
                            flish = temp[0];
                            two   = "△" + temp[1];
                        }
                        else if (checkDesc.Contains("▲"))
                        {
                            temp  = checkDesc.Split(new char[] { '▲' }, StringSplitOptions.RemoveEmptyEntries);
                            flish = temp[0];
                            two   = "▲" + temp[1];
                        }
                        else if (checkDesc.Contains("●"))
                        {
                            temp  = checkDesc.Split(new char[] { '●' }, StringSplitOptions.RemoveEmptyEntries);
                            flish = temp[0];
                            two   = "●" + temp[1];
                        }
                        else
                        {
                            temp  = checkDesc.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                            flish = temp[0];
                            two   = temp[1];
                        }

                        if (sm_pa == "0")
                        {
                            cbb_1_0Pa.Text = flish;
                            cbb_2_0Pa.Text = two;
                        }
                        if (sm_pa == "100")
                        {
                            cbb_1_100Pa.Text = flish;
                            cbb_2_100Pa.Text = two;
                        }
                        if (sm_pa == "150")
                        {
                            cbb_1_150Pa.Text = flish;
                            cbb_2_150Pa.Text = two;
                        }
                        if (sm_pa == "200")
                        {
                            cbb_1_200Pa.Text = flish;
                            cbb_2_200Pa.Text = two;
                        }
                        if (sm_pa == "250")
                        {
                            cbb_1_250Pa.Text = flish;
                            cbb_2_250Pa.Text = two;
                        }
                        if (sm_pa == "300")
                        {
                            cbb_1_300Pa.Text = flish;
                            cbb_2_300Pa.Text = two;
                        }
                        if (sm_pa == "350")
                        {
                            cbb_1_350Pa.Text = flish;
                            cbb_2_350Pa.Text = two;
                        }
                        if (sm_pa == "400")
                        {
                            cbb_1_400Pa.Text = flish;
                            cbb_2_400Pa.Text = two;
                        }
                        if (sm_pa == "500")
                        {
                            cbb_1_500Pa.Text = flish;
                            cbb_2_500Pa.Text = two;
                        }
                        if (sm_pa == "600")
                        {
                            cbb_1_600Pa.Text = flish;
                            cbb_2_600Pa.Text = two;
                        }
                        if (sm_pa == "700")
                        {
                            cbb_1_700Pa.Text = flish;
                            cbb_2_700Pa.Text = two;
                        }

                        if (checkDesc.Contains("▲") || checkDesc.Contains("●"))
                        {
                            if (sm_pa == "100")
                            {
                                sm_pa = "0";
                            }
                            if (sm_pa == "150")
                            {
                                sm_pa = "100";
                            }
                            if (sm_pa == "200")
                            {
                                sm_pa = "150";
                            }
                            if (sm_pa == "250")
                            {
                                sm_pa = "200";
                            }
                            if (sm_pa == "300")
                            {
                                sm_pa = "250";
                            }
                            if (sm_pa == "350")
                            {
                                sm_pa = "300";
                            }
                            if (sm_pa == "400")
                            {
                                sm_pa = "350";
                            }
                            if (sm_pa == "500")
                            {
                                sm_pa = "400";
                            }
                            if (sm_pa == "600")
                            {
                                sm_pa = "500";
                            }
                            if (sm_pa == "700")
                            {
                                sm_pa = "600";
                            }
                        }
                    }
                    txt_zgfy.Text = sm_pa;
                    txt_desc.Text = remark;
                    #endregion
                }
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 绑定控件
        /// </summary>
        private void BindInfoText()
        {
            try
            {
                DataTable dt = new DAL_dt_Settings().Getdt_SettingsByCode(_tempCode);
                if (dt != null)
                {
                    btn_WeiTuoBianHao.Text        = dt.Rows[0]["WeiTuoBianHao"].ToString();
                    btn_WeiTuoDanWei.Text         = dt.Rows[0]["WeiTuoDanWei"].ToString();
                    btn_WeiTuoRen.Text            = dt.Rows[0]["WeiTuoRen"].ToString();
                    btn_YangPinMingCheng.Text     = dt.Rows[0]["YangPinMingCheng"].ToString();
                    cb_CaiYangFangShi.Text        = dt.Rows[0]["CaiYangFangShi"].ToString();
                    cb_JianYanXiangMu.Text        = dt.Rows[0]["JianYanXiangMu"].ToString();
                    btn_GuiGeXingHao.Text         = dt.Rows[0]["GuiGeXingHao"].ToString();
                    btn_GuiGeShuLiang.Text        = dt.Rows[0]["GuiGeShuLiang"].ToString();
                    btn_JianYanRiQi.Text          = dt.Rows[0]["JianYanRiQi"].ToString();
                    cb_KaiQiFangShi.Text          = dt.Rows[0]["KaiQiFangShi"].ToString();
                    btn_DaQiYaLi.Text             = dt.Rows[0]["DaQiYaLi"].ToString();
                    cb_BoLiPinZhong.Text          = dt.Rows[0]["BoLiPinZhong"].ToString();
                    btn_DangQianWenDu.Text        = dt.Rows[0]["DangQianWenDu"].ToString();
                    btn_BoLiHouDu.Text            = dt.Rows[0]["BoLiHouDu"].ToString();
                    btn_ZongMianJi.Text           = dt.Rows[0]["ZongMianJi"].ToString();
                    btn_ZuiDaBoLi.Text            = dt.Rows[0]["ZuiDaBoLi"].ToString();
                    btn_KaiQiFengChang.Text       = dt.Rows[0]["KaiQiFengChang"].ToString();
                    cb_BoLiMiFeng.Text            = dt.Rows[0]["BoLiMiFeng"].ToString();
                    cb_XiangQianFangShi.Text      = dt.Rows[0]["XiangQianFangShi"].ToString();
                    btn_ShuiMiDengJiSheJiZhi.Text = dt.Rows[0]["ShuiMiDengJiSheJiZhi"].ToString();
                    cb_KuangShanMiFang.Text       = dt.Rows[0]["KuangShanMiFang"].ToString();
                    btn_QiMiZhengYaDanWeiFengChangSheJiZhi.Text = dt.Rows[0]["QiMiZhengYaDanWeiFengChangSheJiZhi"].ToString();
                    btn_ZhengYaQiMiDengJiSheJiZhi.Text          = dt.Rows[0]["ZhengYaQiMiDengJiSheJiZhi"].ToString();
                    btn_QiMiFuYaDanWeiFengChangSheJiZhi.Text    = dt.Rows[0]["QiMiFuYaDanWeiFengChangSheJiZhi"].ToString();
                    btn_FuYaQiMiDengJiSheJiZhi.Text             = dt.Rows[0]["FuYaQiMiDengJiSheJiZhi"].ToString();
                    btn_ShuiMiSheJiZhi.Text = dt.Rows[0]["ShuiMiSheJiZhi"].ToString();
                    btn_QiMiZhengYaDanWeiMianJiSheJiZhi.Text = dt.Rows[0]["QiMiZhengYaDanWeiMianJiSheJiZhi"].ToString();
                    btn_QiMiFuYaDanWeiMianJiSheJiZhi.Text    = dt.Rows[0]["QiMiFuYaDanWeiMianJiSheJiZhi"].ToString();
                    cb_JianYanYiJu.Text                = dt.Rows[0]["JianYanYiJu"].ToString();
                    btn_GongChengMingCheng.Text        = dt.Rows[0]["GongChengMingCheng"].ToString();
                    btn_GongChengDiDian.Text           = dt.Rows[0]["GongChengDiDian"].ToString();
                    btn_ShengChanDanWei.Text           = dt.Rows[0]["ShengChanDanWei"].ToString();
                    btn_JianLiDanWei.Text              = dt.Rows[0]["JianLiDanWei"].ToString();
                    btn_JianZhengRen.Text              = dt.Rows[0]["JianZhengRen"].ToString();
                    btn_JianZhengHao.Text              = dt.Rows[0]["JianZhengHao"].ToString();
                    btn_ShiGongDanWei.Text             = dt.Rows[0]["ShiGongDanWei"].ToString();
                    btn_WuJinJianZhuangKuang.Text      = dt.Rows[0]["WuJinJianZhuangKuang"].ToString();
                    btn_SuLiaoChuangChenJinChiCun.Text = dt.Rows[0]["SuLiaoChuangChenJinChiCun"].ToString();
                    btn_ShiFouJiaLuoSi.Text            = dt.Rows[0]["ShiFouJiaLuoSi"].ToString();
                    btn_XingCaiGuiGe.Text              = dt.Rows[0]["XingCaiGuiGe"].ToString();
                    btn_XingCaiBiHou.Text              = dt.Rows[0]["XingCaiBiHou"].ToString();
                    btn_XingCaiShengChanChang.Text     = dt.Rows[0]["XingCaiShengChanChang"].ToString();

                    txt_ganjianchadu.Text             = dt.Rows[0]["GanJianChangDu"].ToString();
                    txt_KangFengyadengjishejizhi.Text = dt.Rows[0]["KangFengYaDengJiSheJiZhi"].ToString();
                    txt_kangfengyashejizhi.Text       = dt.Rows[0]["KangFengYaSheJiZhi"].ToString();
                    cbb_danshandansuodian.Text        = dt.Rows[0]["DanShanDanSuoDian"].ToString();

                    _tempCode = dt.Rows[0]["dt_Code"].ToString();
                    _tempTong = dt.Rows[0]["info_DangH"].ToString();
                    cb_DangQianDangHao.Text        = dt.Rows[0]["info_DangH"].ToString();
                    btn_JianYanBianHao.Text        = dt.Rows[0]["dt_Code"].ToString();
                    this.cb_JianYanXiangMu.Enabled = false;
                    this.btn_GuiGeShuLiang.Enabled = false;
                }
                else
                {
                    btn_JianYanBianHao.Text = DateTime.Now.ToString("yyyyMMdd") + "-01";
                }

                if (string.IsNullOrEmpty(btn_GuiGeShuLiang.Text))
                {
                    btn_GuiGeShuLiang.Text = "3";
                }
                if (_temppressure != 0 && _temperature != 0)
                {
                    btn_DaQiYaLi.Text      = _temppressure.ToString();
                    btn_DangQianWenDu.Text = _temperature.ToString();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Logger.Error(ex);
            }
        }
Ejemplo n.º 11
0
        private void Eexport(string fileName)
        {
            try
            {
                string strResult = string.Empty;
                string strPath   = System.Windows.Forms.Application.StartupPath + "\\template";
                string strFile   = string.Format(@"{0}\{1}", strPath, fileName);

                FolderBrowserDialog path = new FolderBrowserDialog();
                path.ShowDialog();

                label3.Visible = true;

                btn_ok.Enabled    = false;
                cm_Report.Enabled = false;
                btn_close.Enabled = false;


                string[] name = fileName.Split('.');

                string _name = name[0] + "_" + _tempCode + "." + name[1];

                var saveExcelUrl = path.SelectedPath + "\\" + _name;

                Model_dt_Settings settings = new DAL_dt_Settings().Getdt_SettingsResByCode(_tempCode);

                if (settings == null)
                {
                    MessageBox.Show("未查询到相关编号");
                    this.Close();
                    return;
                }

                var dc = new Dictionary <string, string>();
                if (fileName == "门窗检验报告.doc")
                {
                    dc = GetDWDetectionReport(settings);
                }
                else if (fileName == "试验室记录.doc")
                {
                    dc = GetDetectionReport(settings);
                }
                else if (fileName == "现场报告(1樘).doc")
                {
                    dc = GetTong1(settings);
                }
                else if (fileName == "现场报告(2樘).doc")
                {
                    dc = GetTong2(settings);
                }
                else if (fileName == "现场报告(3樘).doc")
                {
                    dc = GetTong3(settings);
                }

                WordUtility wu = new WordUtility(strFile, saveExcelUrl);
                if (wu.GenerateWordByBookmarks(dc))
                {
                    MessageBox.Show("导出成功", "导出成功",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.None,
                                    MessageBoxDefaultButton.Button1,
                                    MessageBoxOptions.ServiceNotification
                                    );
                    this.Hide();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("数据出现问题,导出失败!");
                this.Close();
            }
        }