예제 #1
0
 public RepairEditForm(string eqasset, string eqname, string eqdep, string repairId)
 {
     InitializeComponent();
     text_eqasset.Text = eqasset;
     text_eqname.Text = eqname;
     text_dep.Text = eqdep;
     globalRepairId = repairId;
     //
     DataSet ds_department1 = null, ds_department2 = null, ds_level = null, ds = null;
     AccountAdd aa = new AccountAdd();
     Account ads = new Account();
     ds_department1 = aa.CreateDataSet_Department();//部门列表
     ds_department2 = aa.CreateDataSet_Department();//部门列表
     ds_level = aa.CreateDataSet_RepairLevel();//维修级别列表
     ds = ads.queryRepairById(repairId);
     //
     InitComboBox(combo_targetdep, ds_department1, "id", "departname", ds, "target_department");
     InitComboBox(combo_sourcedep, ds_department2, "id", "departname", ds, "source_department");
     InitComboBox(combo_level, ds_level, "id", "level_name", ds, "repair_level");
     //表头塞值
     text_repairasset.DataBindings.Add(new Binding("Text", ds.Tables[0], "repair_asset"));
     dateTime_startdate.DataBindings.Add(new Binding("Value", ds.Tables[0], "start_date"));
     dateTime_enddate.DataBindings.Add(new Binding("Value", ds.Tables[0], "end_date"));
     numeric_stopday.DataBindings.Add(new Binding("Value", ds.Tables[0], "stop_time"));
     text_group.DataBindings.Add(new Binding("Text", ds.Tables[0], "repair_group"));
     text_fuzeren.DataBindings.Add(new Binding("Text", ds.Tables[0], "principal"));
     richText_before.DataBindings.Add(new Binding("Text", ds.Tables[0], "memo_before"));
     richText_record.DataBindings.Add(new Binding("Text", ds.Tables[0], "memo_record"));
     richText_after.DataBindings.Add(new Binding("Text", ds.Tables[0], "memo_after"));
 }
예제 #2
0
 private void ok_Click(object sender, EventArgs e)
 {
     bool flag = false;
     AccountAdd aa = new AccountAdd();
     //Account acc = new Account();
     //float value,power;
     //byte[] threeD = new byte[] { 0 };
     flag = aa.updateKnowledge(text_eqname.Text, text_partname.Text, combo_level.SelectedValue.ToString(), richText_fault_process.Text, richText_fault_reason.Text, richText_countermeasure.Text, globalId);
     //flag = aa.addKnowledge(text_eqname.Text, text_partname.Text, combo_level.SelectedValue.ToString(), richText_fault_process.Text, richText_fault_reason.Text, richText_countermeasure.Text);
         //flag = aa.addFault(globalEqId, text_partname.Text, combo_level.SelectedValue.ToString(), dateTime_fault.Text, dateTime_begin.Text, dateTime_end.Text, richText_fault_process.Text, richText_fault_reason.Text, richText_countermeasure.Text, img);
         //flag = aa.addRepair(text_partname.Text, globalPlanId, dateTime_fault.Text, dateTime_begin.Text, numeric_stopday.Value.ToString(), combo_targetdep.SelectedValue.ToString(), combo_sourcedep.SelectedValue.ToString(), text_group.Text, text_fuzeren.Text, richText_.Text, richText_after.Text, richText_record.Text,combo_level.SelectedValue.ToString());
         //flag = aa.addRepairPlan(text_repairasset.Text, globalEqId, dateTime_startdate.Text, overtime, stoptime,combo_targetdep.SelectedValue.ToString(),combo_sourcedep.SelectedValue.ToString(), text_fuzeren.Text, richText_before.Text, combo_level.SelectedValue.ToString());
         //flag = aa.addAccount(false, text_asset.Text, text_eqname.Text, text_model.Text, text_specification.Text, Convert.ToInt32(combo_depart.SelectedValue.ToString()), text_weight.Text, text_brand.Text, text_manufacturer.Text, text_supplier.Text, dateTime_manu_date.Text, dateTime_produ_date.Text, dateTime_filing_date.Text, float.Parse(maskedText_value.Text), Convert.ToInt32(numeric_count.Value.ToString()), Convert.ToInt32(numeric_electromotor.Value.ToString()), float.Parse(maskedText_power.Text), Convert.ToInt32(combo_status.SelectedValue.ToString()), Convert.ToInt32(combo_eqType.SelectedValue.ToString()), text_address.Text, aa.getFileBytes(fileDialog_img.FileName), aa.getFileBytes(fileDialog_3d.FileName));
         //flag = aa.addAccount(false, text_eqasset.Text, text_eqname.Text, text_repairasset.Text, text_specification.Text, Convert.ToInt32(combo_sourcedep.SelectedValue.ToString()), text_fuzeren.Text, text_dep.Text, text_manufacturer.Text, text_supplier.Text, dateTime_plandate.Text, dateTime_produ_date.Text, dateTime_filing_date.Text, value, count, electromotor, power, Convert.ToInt32(combo_status.SelectedValue.ToString()), Convert.ToInt32(combo_targetdep.SelectedValue.ToString()), text_address.Text, img, threeD);
         if (flag)
         {
             MessageBox.Show("数据保存成功!");
             this.DialogResult = DialogResult.OK;
             this.Close();
         }
         else
         {
             MessageBox.Show("数据保存失败,请检查网络连接!");
         }
 }
예제 #3
0
 public RepairPlanEditForm(string planId)
 {
     InitializeComponent();
     globalPlanId = planId;
     //
     DataSet ds_department1 = null, ds_department2 = null, ds_level = null, ds = null;
     AccountAdd aa = new AccountAdd();
     Account ads = new Account();
     //初始化下拉列表
     ds_department1 = aa.CreateDataSet_Department();//部门列表
     ds_department2 = aa.CreateDataSet_Department();//部门列表
     ds_level = aa.CreateDataSet_RepairLevel();//维修级别列表
     ds = ads.queryRepairPlanById(planId);
     InitComboBox(combo_targetdep, ds_department1, "id", "departname", ds, "target_department");
     InitComboBox(combo_sourcedep, ds_department2, "id", "departname", ds, "source_department");
     InitComboBox(combo_level, ds_level, "id", "level_name", ds, "level_id");
     //表头塞值
     text_eqasset.DataBindings.Add(new Binding("Text", ds.Tables[0], "asset"));
     text_eqname.DataBindings.Add(new Binding("Text", ds.Tables[0], "eqname"));
     text_dep.DataBindings.Add(new Binding("Text", ds.Tables[0], "departname"));
     text_repairasset.DataBindings.Add(new Binding("Text", ds.Tables[0], "plan_asset"));
     dateTime_plandate.DataBindings.Add(new Binding("Value", ds.Tables[0], "start_date"));
     numeric_repairday.DataBindings.Add(new Binding("Value", ds.Tables[0], "over_time"));
     numeric_stopday.DataBindings.Add(new Binding("Value", ds.Tables[0], "stop_time"));
     text_fuzeren.DataBindings.Add(new Binding("Text", ds.Tables[0], "principal"));
     richText_memo.DataBindings.Add(new Binding("Text", ds.Tables[0], "memo"));
 }
예제 #4
0
 public KnowledgeAddForm()
 {
     InitializeComponent();
     DataSet ds_level = null;
     AccountAdd aa = new AccountAdd();
     ds_level = aa.CreateDataSet_FaultLevel();//故障模式列表
     InitComboBox(combo_level, ds_level, "id", "level_name");
 }
예제 #5
0
 private void AccountAddForm_Load(object sender, EventArgs e)
 {
     DataSet ds_eqType = null, ds_department = null, ds_Status=null ;
     AccountAdd aa = new AccountAdd();
     ds_eqType = aa.CreateDataSet_EquipmentType();
     ds_department = aa.CreateDataSet_Department();
     ds_Status = aa.CreateDataSet_Status();
     InitComboBox(combo_eqType, ds_eqType, "id", "type_name");
     InitComboBox(combo_depart, ds_department, "id", "departname");
     InitComboBox(combo_status, ds_Status, "id", "status_name");
 }
예제 #6
0
 public FaultAddForm(string eqasset, string eqname, string eqdep, string eqId)
 {
     InitializeComponent();
     text_eqasset.Text = eqasset;
     text_eqname.Text = eqname;
     text_dep.Text = eqdep;
     globalEqId = eqId;
     //
     DataSet ds_level = null;
     AccountAdd aa = new AccountAdd();
     ds_level = aa.CreateDataSet_FaultLevel();//故障模式列表
     InitComboBox(combo_level, ds_level, "id", "level_name");
 }
예제 #7
0
 public RepairPlanAddForm(string eqasset,string eqname,string eqdep,string eqId)
 {
     InitializeComponent();
     text_eqasset.Text = eqasset;
     text_eqname.Text = eqname;
     text_dep.Text = eqdep;
     globalEqId = eqId;
     //
     DataSet ds_department1 = null, ds_department2 = null, ds_level = null;
     AccountAdd aa = new AccountAdd();
     ds_department1 = aa.CreateDataSet_Department();//部门列表
     ds_department2 = aa.CreateDataSet_Department();//部门列表
     ds_level = aa.CreateDataSet_RepairLevel();//维修级别列表
     InitComboBox(combo_targetdep, ds_department1, "id", "departname");
     InitComboBox(combo_sourcedep, ds_department2, "id", "departname");
     InitComboBox(combo_level, ds_level, "id", "level_name");
 }
예제 #8
0
 public KnowledgeEditForm(string id)
 {
     InitializeComponent();
     globalId = id;
     DataSet ds_level = null, ds = null;
     AccountAdd aa = new AccountAdd();
     Account acc = new Account();
     ds_level = aa.CreateDataSet_FaultLevel();//故障模式列表
     ds = acc.queryKnowledgeByIdForEdit(id);
     //InitComboBox(combo_level, ds_level, "id", "level_name");
     text_eqname.DataBindings.Add(new Binding("Text", ds.Tables[0], "eq_name"));
     text_partname.DataBindings.Add(new Binding("Text", ds.Tables[0], "part_name"));
     richText_fault_process.DataBindings.Add(new Binding("Text", ds.Tables[0], "fault_process"));
     richText_fault_reason.DataBindings.Add(new Binding("Text", ds.Tables[0], "fault_reason"));
     richText_countermeasure.DataBindings.Add(new Binding("Text", ds.Tables[0], "countermeasure"));
     InitComboBox(combo_level, ds_level, "id", "level_name", ds, "fault_level");
 }
예제 #9
0
 private void ok_Click(object sender, EventArgs e)
 {
     bool flag = false;
     AccountAdd aa = new AccountAdd();
     //Account acc = new Account();
     //float value,power;
     byte[] img = new byte[] { 0 };
     try
         {
             if (!fileDialog_img.FileName.Equals(""))
             {
                 img = aa.getFileBytes(fileDialog_img.FileName);
             }
             else
             {
                 img = aa.getFileBytes("pic\\no_photo.jpg");
             }
         }
         catch (Exception mye)
         {
             MessageBox.Show("图像读取失败,请取消文件的只读属性!", "文件读取错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
             log.Error(mye.Message);
             return;
         }
     flag = aa.addTrouble(globalEqId, dateTime_troubletime.Text, richText_process.Text, richText_reason.Text, richText_lose.Text, richText_todo.Text, img);
     //flag = aa.addKnowledge(text_eqname.Text, text_partname.Text, combo_level.SelectedValue.ToString(), richText_process.Text, richText_lose.Text, richText_reason.Text);
         //flag = aa.addFault(globalEqId, text_partname.Text, combo_level.SelectedValue.ToString(), dateTime_fault.Text, dateTime_begin.Text, dateTime_end.Text, richText_fault_process.Text, richText_fault_reason.Text, richText_countermeasure.Text, img);
         //flag = aa.addRepair(text_partname.Text, globalPlanId, dateTime_fault.Text, dateTime_begin.Text, numeric_stopday.Value.ToString(), combo_targetdep.SelectedValue.ToString(), combo_sourcedep.SelectedValue.ToString(), text_group.Text, text_fuzeren.Text, richText_.Text, richText_after.Text, richText_record.Text,combo_level.SelectedValue.ToString());
         //flag = aa.addRepairPlan(text_repairasset.Text, globalEqId, dateTime_startdate.Text, overtime, stoptime,combo_targetdep.SelectedValue.ToString(),combo_sourcedep.SelectedValue.ToString(), text_fuzeren.Text, richText_before.Text, combo_level.SelectedValue.ToString());
         //flag = aa.addAccount(false, text_asset.Text, text_eqname.Text, text_model.Text, text_specification.Text, Convert.ToInt32(combo_depart.SelectedValue.ToString()), text_weight.Text, text_brand.Text, text_manufacturer.Text, text_supplier.Text, dateTime_manu_date.Text, dateTime_produ_date.Text, dateTime_filing_date.Text, float.Parse(maskedText_value.Text), Convert.ToInt32(numeric_count.Value.ToString()), Convert.ToInt32(numeric_electromotor.Value.ToString()), float.Parse(maskedText_power.Text), Convert.ToInt32(combo_status.SelectedValue.ToString()), Convert.ToInt32(combo_eqType.SelectedValue.ToString()), text_address.Text, aa.getFileBytes(fileDialog_img.FileName), aa.getFileBytes(fileDialog_3d.FileName));
         //flag = aa.addAccount(false, text_eqasset.Text, text_eqname.Text, text_repairasset.Text, text_specification.Text, Convert.ToInt32(combo_sourcedep.SelectedValue.ToString()), text_fuzeren.Text, text_dep.Text, text_manufacturer.Text, text_supplier.Text, dateTime_plandate.Text, dateTime_produ_date.Text, dateTime_filing_date.Text, value, count, electromotor, power, Convert.ToInt32(combo_status.SelectedValue.ToString()), Convert.ToInt32(combo_targetdep.SelectedValue.ToString()), text_address.Text, img, threeD);
         if (flag)
         {
             MessageBox.Show("数据保存成功!");
             this.DialogResult = DialogResult.OK;
             this.Close();
         }
         else
         {
             MessageBox.Show("数据保存失败,请检查网络连接!");
         }
 }
예제 #10
0
 public AccountEditForm(string id)
 {
     InitializeComponent();
     accountId = id;
     DataSet ds_eqType = null, ds_department = null, ds_Status = null;
     DataSet ds = null;
        // DataTable data = null;
     AccountAdd aa = new AccountAdd();
     Account ads = new Account();
     //初始化下拉列表用
     ds_eqType = aa.CreateDataSet_EquipmentType();
     ds_department = aa.CreateDataSet_Department();
     ds_Status = aa.CreateDataSet_Status();
     //获取指定id的信息
     ds = ads.queryAccountById(id);
     //ds2.Tables[0].Rows[0][]
     //log.Debug("设备类型是:"+ds.Tables[0].Rows[0][19].ToString());
     InitComboBox(combo_eqType, ds_eqType, "id", "type_name",ds,"type");
     InitComboBox(combo_depart, ds_department, "id", "departname",ds,"department");
     InitComboBox(combo_status, ds_Status, "id", "status_name",ds ,"status");
     text_asset.DataBindings.Add(new Binding("Text", ds.Tables[0], "asset"));
     text_eqname.DataBindings.Add(new Binding("Text",ds.Tables[0],"eqname"));
     text_model.DataBindings.Add(new Binding("Text", ds.Tables[0], "model"));
     text_specification.DataBindings.Add(new Binding("Text", ds.Tables[0], "specification"));
     text_weight.DataBindings.Add(new Binding("Text", ds.Tables[0], "weight"));
     text_brand.DataBindings.Add(new Binding("Text", ds.Tables[0], "brand"));
     text_manufacturer.DataBindings.Add(new Binding("Text", ds.Tables[0], "manufacturer"));
     text_supplier.DataBindings.Add(new Binding("Text", ds.Tables[0], "supplier"));
     maskedText_value.DataBindings.Add(new Binding("Value", ds.Tables[0], "value"));
     numeric_count.DataBindings.Add(new Binding("Value", ds.Tables[0], "count"));
     numeric_electromotor.DataBindings.Add(new Binding("Value", ds.Tables[0], "electromotor"));
     maskedText_power.DataBindings.Add(new Binding("Value", ds.Tables[0], "power"));
     dateTime_manu_date.DataBindings.Add(new Binding("Value", ds.Tables[0], "manu_date"));
     dateTime_produ_date.DataBindings.Add(new Binding("Value", ds.Tables[0], "produ_date"));
     dateTime_filing_date.DataBindings.Add(new Binding("Value", ds.Tables[0], "filing_date"));
     text_address.DataBindings.Add(new Binding("Text", ds.Tables[0], "address"));
     img = (byte[])(ds.Tables[0]).Rows[0][21];
     threeD = (byte[])(ds.Tables[0]).Rows[0][22];
 }
예제 #11
0
        public FaultEditForm(string faultId)
        {
            InitializeComponent();
            globalFaultId = faultId;
            //
            DataSet ds_level = null, ds = null;
            AccountAdd aa = new AccountAdd();
            Account acc = new Account();
            ds_level = aa.CreateDataSet_FaultLevel();//故障模式列表
            ds = acc.queryFaultById(faultId);

            text_eqasset.DataBindings.Add(new Binding("Text", ds.Tables[0], "asset"));
            text_eqname.DataBindings.Add(new Binding("Text", ds.Tables[0], "eqname"));
            text_dep.DataBindings.Add(new Binding("Text", ds.Tables[0], "departname"));
            text_partname.DataBindings.Add(new Binding("Text", ds.Tables[0], "part_name"));
            dateTime_fault.DataBindings.Add(new Binding("Value", ds.Tables[0], "fault_date"));
            dateTime_begin.DataBindings.Add(new Binding("Value", ds.Tables[0], "repair_date"));
            dateTime_end.DataBindings.Add(new Binding("Value", ds.Tables[0], "repairover_date"));
            richText_fault_process.DataBindings.Add(new Binding("Text", ds.Tables[0], "fault_process"));
            richText_fault_reason.DataBindings.Add(new Binding("Text", ds.Tables[0], "fault_reason"));
            richText_countermeasure.DataBindings.Add(new Binding("Text", ds.Tables[0], "countermeasure"));
            InitComboBox(combo_level, ds_level, "id", "level_name", ds, "fault_level");
            img = (byte[])(ds.Tables[0]).Rows[0][12];
        }
예제 #12
0
        private void ok_Click(object sender, EventArgs e)
        {
            bool flag = false;
            AccountAdd aa = new AccountAdd();
            float value,power;
            byte[] img = new byte[] { 0 };
            byte[] threeD = new byte[] { 0 };
            int count,electromotor;
            /*
            if (Util.Tools.IsFloat(maskedText_value.Text))
            {
                log.Debug(maskedText_value.Text);
                value = float.Parse(maskedText_value.Text);
            }
            else
            {
                MessageBox.Show("“设备单价”格式错误!");
                maskedText_value.Focus();
                maskedText_value.Text = "0.00";
                return ;
            }
            if (Util.Tools.IsFloat(maskedText_power.Text))
            {
               power= float.Parse(maskedText_power.Text);
            }
            else
            {
                MessageBox.Show("“总功率”格式错误!");
                maskedText_power.Focus();
                maskedText_power.Text = "0.00";
                return;
            }
             * */
            if (!maskedText_value.Value.ToString().Equals(""))
            {
                value = (float)maskedText_value.Value;
            }
            else
            {
                value = 0.00F;
            }
            if (!maskedText_power.Value.ToString().Equals(""))
            {
                power = (float)maskedText_power.Value;
            }
            else
            {
                power = 0.00F;
            }

            if (!numeric_count.Value.ToString().Equals(""))
            {
                count = Convert.ToInt32(numeric_count.Value.ToString());
            }
            else
            {
                count = 1;
            }
            if (!numeric_electromotor.Value.ToString().Equals(""))
            {
                electromotor = Convert.ToInt32(numeric_electromotor.Value.ToString());
            }
            else
            {
                electromotor = 0;
            }
            try
            {
                if (!fileDialog_img.FileName.Equals(""))
                {
                    img = aa.getFileBytes(fileDialog_img.FileName);
                }
                else
                {
                    img = aa.getFileBytes("pic\\no_photo.jpg");
                }
                if (!fileDialog_3d.FileName.Equals(""))
                {
                    threeD = aa.getFileBytes(fileDialog_3d.FileName);
                }
            }
            catch (Exception mye)
            {
                MessageBox.Show("图像或三维文件读取失败,请取消文件的只读属性!", "文件读取错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                log.Error(mye.Message);
                return;
            }
            //flag = aa.addAccount(false, text_asset.Text, text_eqname.Text, text_model.Text, text_specification.Text, Convert.ToInt32(combo_depart.SelectedValue.ToString()), text_weight.Text, text_brand.Text, text_manufacturer.Text, text_supplier.Text, dateTime_manu_date.Text, dateTime_produ_date.Text, dateTime_filing_date.Text, float.Parse(maskedText_value.Text), Convert.ToInt32(numeric_count.Value.ToString()), Convert.ToInt32(numeric_electromotor.Value.ToString()), float.Parse(maskedText_power.Text), Convert.ToInt32(combo_status.SelectedValue.ToString()), Convert.ToInt32(combo_eqType.SelectedValue.ToString()), text_address.Text, aa.getFileBytes(fileDialog_img.FileName), aa.getFileBytes(fileDialog_3d.FileName));
            flag = aa.addAccount(false, text_asset.Text, text_eqname.Text, text_model.Text, text_specification.Text, Convert.ToInt32(combo_depart.SelectedValue.ToString()), text_weight.Text, text_brand.Text, text_manufacturer.Text, text_supplier.Text, dateTime_manu_date.Text, dateTime_produ_date.Text, dateTime_filing_date.Text, value, count, electromotor, power, Convert.ToInt32(combo_status.SelectedValue.ToString()), Convert.ToInt32(combo_eqType.SelectedValue.ToString()), text_address.Text, img, threeD);
            if (flag)
            {
                MessageBox.Show("数据添加成功!");
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            else
            {
                MessageBox.Show("数据添加失败,请检查网络连接!");
            }
        }
예제 #13
0
 private void ok_Click(object sender, EventArgs e)
 {
     bool flag = false;
     AccountAdd aa = new AccountAdd();
     try
     {
         if (!fileDialog_img.FileName.Equals(""))
         {
             img = aa.getFileBytes(fileDialog_img.FileName);
         }
         if (!fileDialog_3d.FileName.Equals(""))
         {
             threeD = aa.getFileBytes(fileDialog_3d.FileName);
         }
     }
     catch (Exception mye)
     {
         MessageBox.Show("图像或三维文件读取失败,请取消文件的只读属性!", "文件读取错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
         log.Error(mye.Message);
         return;
     }
     flag = aa.updatePart(text_partasset.Text, text_partname.Text, text_partmaterial.Text, text_partweight.Text, globleStandard, img, threeD, globleId);
     //flag = aa.addPart(globleId, text_partasset.Text, text_partname.Text, text_partmaterial.Text, text_partweight.Text, globleStandard, img, threeD);
     //flag = aa.addAccount(false, text_asset.Text, text_eqname.Text, text_model.Text, text_specification.Text, Convert.ToInt32(combo_depart.SelectedValue.ToString()), text_weight.Text, text_brand.Text, text_manufacturer.Text, text_supplier.Text, dateTime_manu_date.Text, dateTime_produ_date.Text, dateTime_filing_date.Text, float.Parse(maskedText_value.Text), Convert.ToInt32(numeric_count.Value.ToString()), Convert.ToInt32(numeric_electromotor.Value.ToString()), float.Parse(maskedText_power.Text), Convert.ToInt32(combo_status.SelectedValue.ToString()), Convert.ToInt32(combo_eqType.SelectedValue.ToString()), text_address.Text, aa.getFileBytes(fileDialog_img.FileName), aa.getFileBytes(fileDialog_3d.FileName));
     //flag = aa.addAccount(false, text_asset.Text, text_eqname.Text, text_model.Text, text_specification.Text, Convert.ToInt32(combo_depart.SelectedValue.ToString()), text_weight.Text, text_brand.Text, text_manufacturer.Text, text_supplier.Text, dateTime_manu_date.Text, dateTime_produ_date.Text, dateTime_filing_date.Text, value, count, electromotor, power, Convert.ToInt32(combo_status.SelectedValue.ToString()), Convert.ToInt32(combo_eqType.SelectedValue.ToString()), text_address.Text, img, threeD);
     if (flag)
     {
         MessageBox.Show("数据保存成功!");
         this.DialogResult = DialogResult.OK;
         this.Close();
     }
     else
     {
         MessageBox.Show("数据保存失败,请检查网络连接!");
     }
 }