Exemplo n.º 1
0
 public TimePointEditFrm(Model.time_point EditModel)
 {
     InitializeComponent();
     this.EditModel    = EditModel;
     txtName.Text      = EditModel.tpoint_value;
     rchTxtRemark.Text = EditModel.tpoint_remark;
 }
Exemplo n.º 2
0
 private void btnEdit_Click(object sender, EventArgs e)
 {
     if (listView1.SelectedItems.Count == 0)
     {
         MessageBox.Show("请选择要修改的项!");
     }
     else
     {
         Model.time_point editModel = new Model.time_point();
         editModel = modelList[listView1.SelectedIndices[0]];
         TimePointEditFrm EditFrm = new TimePointEditFrm(editModel);
         EditFrm.ShowDialog();
         getAllList();
     }
 }
Exemplo n.º 3
0
        private void initTimePoint()
        {
            progressBar1.Value = 60;
            DataSet ds = LoadDataFromExcel(fileName, "发生时机");

            BLL.time_point   bll   = new BLL.time_point();
            Model.time_point model = new Model.time_point();
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                if (dr["发生时机"].ToString() == "")
                {
                    return;
                }
                model.tpoint_value = dr["发生时机"].ToString();
                bll.Add(model);
            }
        }
Exemplo n.º 4
0
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     if (txtName.Text.Trim() == "")
     {
         MessageBox.Show("故障时机不能为空!");
         return;
     }
     BLL.time_point Bll = new BLL.time_point();
     if (Bll.GetModel(txtName.Text.Trim()) != null)
     {
         MessageBox.Show("故障时机已存在!");
         return;
     }
     Model.time_point addModel = new Model.time_point();
     addModel.tpoint_value  = txtName.Text.Trim();
     addModel.tpoint_remark = rchTxtRemark.Text;
     Bll.Add(addModel);
     this.Close();
 }
Exemplo n.º 5
0
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     if (txtName.Text.Trim() == "")
     {
         MessageBox.Show("故障时机不能为空!");
         return;
     }
     BLL.time_point   Bll   = new BLL.time_point();
     Model.time_point Model = Bll.GetModel(txtName.Text.Trim());
     if (Model != null && Model.tpoint_id != this.EditModel.tpoint_id)
     {
         MessageBox.Show("型号已存在!");
         return;
     }
     EditModel.tpoint_value  = txtName.Text.Trim();
     EditModel.tpoint_remark = rchTxtRemark.Text;
     Bll.Update(EditModel);
     MessageBox.Show("修改成功!");
     this.Close();
 }
Exemplo n.º 6
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(fds.Model.time_point model)
 {
     return(dal.Update(model));
 }
Exemplo n.º 7
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(fds.Model.time_point model)
 {
     return(dal.Add(model));
 }