Ejemplo n.º 1
0
 public PlnTypEditFrm(Model.plane_type EditModel)
 {
     InitializeComponent();
     this.EditModel    = EditModel;
     txtName.Text      = EditModel.ptype_name;
     rchTxtRemark.Text = EditModel.plane_remark;
 }
Ejemplo n.º 2
0
 private void btnEdit_Click(object sender, EventArgs e)
 {
     if (listView1.SelectedItems.Count == 0)
     {
         MessageBox.Show("请选择要修改的项!");
     }
     else
     {
         Model.plane_type editModel = new Model.plane_type();
         editModel = modelList[listView1.SelectedIndices[0]];
         PlnTypEditFrm EditFrm = new PlnTypEditFrm(editModel);
         EditFrm.ShowDialog();
         getAllList();
     }
 }
Ejemplo n.º 3
0
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     if (txtName.Text.Trim() == "")
     {
         MessageBox.Show("飞机型号不能为空!");
         return;
     }
     BLL.plane_type Bll = new BLL.plane_type();
     if (Bll.GetModel(txtName.Text.Trim()) != null)
     {
         MessageBox.Show("飞机型号已存在!");
         return;
     }
     Model.plane_type addModel = new Model.plane_type();
     addModel.ptype_name   = txtName.Text.Trim();
     addModel.plane_remark = rchTxtRemark.Text;
     Bll.Add(addModel);
     this.Close();
 }
Ejemplo n.º 4
0
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     if (txtName.Text.Trim() == "")
     {
         MessageBox.Show("型号名称不能为空!");
         return;
     }
     BLL.plane_type   Bll   = new BLL.plane_type();
     Model.plane_type Model = Bll.GetModel(txtName.Text.Trim());
     if (Model != null && Model.ptype_id != this.EditModel.ptype_id)
     {
         MessageBox.Show("型号已存在!");
         return;
     }
     EditModel.ptype_name   = txtName.Text.Trim();
     EditModel.plane_remark = rchTxtRemark.Text;
     Bll.Update(EditModel);
     MessageBox.Show("修改成功!");
     this.Close();
 }
Ejemplo n.º 5
0
        private void initPlaneType()
        {
            progressBar1.Value = 40;
            try
            {
                DataSet          ds    = LoadDataFromExcel(fileName, "飞机型号");
                BLL.plane_type   bll   = new BLL.plane_type();
                Model.plane_type model = new Model.plane_type();
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    if (dr["型号"].ToString() == "")
                    {
                        return;
                    }
                    model.ptype_name = dr["型号"].ToString();;
                    bll.Add(model);
                }
            }

            catch
            {
            }
        }
Ejemplo n.º 6
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(fds.Model.plane_type model)
 {
     return(dal.Update(model));
 }
Ejemplo n.º 7
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(fds.Model.plane_type model)
 {
     return(dal.Add(model));
 }