コード例 #1
0
 public int Delete(PersonnelInformationList entityToInsert)
 {
     using (Conn)
     {
         return(Conn.Delete(entityToInsert));
     }
 }
コード例 #2
0
 public Guid Insert(PersonnelInformationList entityToInsert)
 {
     using (Conn)
     {
         return(Conn.Insert <Guid>(entityToInsert));
     }
 }
コード例 #3
0
 public void PersonnelInformationData(PersonnelInformationList _tmpData)
 {
     txtname.Text = _tmpData.Name;
     txtlon.Text  = _tmpData.NumberOfPersonnel.ToString();
     txtlat.Text  = _tmpData.EquipmentQuantity.ToString();
     if (_tmpData.StationID != null)
     {
         comboBox1.SelectedValue = _tmpData.StationID;
     }
     txtdescription.Text = _tmpData.Description;
 }
コード例 #4
0
        private void ToolStripMenuItem_add_Click(object sender, EventArgs e)
        {
            PersonnelInformationList        tmpData = null;
            Add_Modify_PersonnelInformation tmpAdd_Modify_PersonnelInformation = new Add_Modify_PersonnelInformation(tmpData);

            tmpAdd_Modify_PersonnelInformation.ShowDialog();
            if (tmpAdd_Modify_PersonnelInformation.result == DialogResult.OK)
            {
                GetPersonnelInformationList();
            }
        }
コード例 #5
0
 public Add_Modify_PersonnelInformation(PersonnelInformationList _tmpData)
 {
     InitializeComponent();
     if (_tmpData == null)
     {
         TypeNameDataBinding();
     }
     else if (_tmpData != null)
     {
         tmpStation = _tmpData;
         TypeNameDataBinding();
         PersonnelInformationData(tmpStation);
     }
 }
コード例 #6
0
        private void ToolStripMenuItem_edittype_Click(object sender, EventArgs e)
        {
            PersonnelInformationList tmpData = new PersonnelInformationList();

            for (int i = 0; i < tmpListPersonnelInformation.Count; i++)
            {
                if (tmpListPersonnelInformation[i].ID == _PersonnelInformationList.ID)
                {
                    tmpData = tmpListPersonnelInformation[i];
                    break;
                }
            }
            Add_Modify_PersonnelInformation tmpAdd_Modify_PersonnelInformation = new Add_Modify_PersonnelInformation(tmpData);

            tmpAdd_Modify_PersonnelInformation.ShowDialog();
            if (tmpAdd_Modify_PersonnelInformation.result == DialogResult.OK)
            {
                GetPersonnelInformationList();
            }
        }
コード例 #7
0
        private void btnsure_Click(object sender, EventArgs e)
        {
            List <PersonnelInformationList> tmpPersonnelInformationList     = new List <PersonnelInformationList>();
            PersonnelInformationList        _PersonnelInformationList       = new PersonnelInformationList();
            PersonnelInformation_Command    tmpPersonnelInformation_Command = new PersonnelInformation_Command();

            int lon = 0, lat = 0;

            if (txtname.Text.Trim() == "")
            {
                MessageBox.Show("请填写设备名字"); return;
            }

            if (txtlon.Text.Trim() == "")
            {
                MessageBox.Show("请填写人员数量");
            }
            else
            {
                if (!Int32.TryParse(txtlon.Text.Trim(), out lon))
                {
                    MessageBox.Show("人员数量为数值类型");
                    return;
                }
            }

            if (txtlat.Text.Trim() == "")
            {
                MessageBox.Show("请填装备数量"); return;
            }
            else
            {
                if (!Int32.TryParse(txtlat.Text.Trim(), out lat))
                {
                    MessageBox.Show("装备数量为数值类型");
                    return;
                }
            }

            if (tmpStation != null)
            {
                _PersonnelInformationList.ID = tmpStation.ID;
            }
            _PersonnelInformationList.Name = txtname.Text.Trim();
            _PersonnelInformationList.NumberOfPersonnel = Convert.ToInt32(txtlon.Text.Trim());
            _PersonnelInformationList.EquipmentQuantity = Convert.ToInt32(txtlat.Text.Trim());

            if (comboBox1.SelectedValue.ToString() != null)
            {
                _PersonnelInformationList.StationID = new Guid(comboBox1.SelectedValue.ToString());
            }
            else
            {
                _PersonnelInformationList.StationID = null;
            }

            _PersonnelInformationList.Description = txtdescription.Text.Trim();
            tmpPersonnelInformationList.Add(_PersonnelInformationList);

            if (tmpStation == null)
            {
                tmpPersonnelInformation_Command._AddData(tmpPersonnelInformationList);
                result = MessageBox.Show("添加成功", "提示", MessageBoxButtons.OK);
            }
            else if (tmpStation != null)
            {
                tmpPersonnelInformation_Command._ReviseData(tmpPersonnelInformationList);
                result = MessageBox.Show("修改成功", "提示", MessageBoxButtons.OK);
            }
            this.Close();
        }