private void button1_Click(object sender, EventArgs e) { if (UserHelper.Inspecter == "") { new check_login(this).ShowDialog(); agree.Text = UserHelper.Inspecter; } if (UserHelper.Inspecter != "") { model.Id = textBox1.Text; model.Old_tenant = textBox2.Text; model.Old_start_time = textBox3.Text; model.Old_end_time = textBox4.Text; model.Tenant = textBox6.Text; model.scrap_date = textBox7.Text; model.End_time = textBox8.Text; model.Recorder = Recorder.Text; model.Inspecter = agree.Text; model.Reason = textBox11.Text; BLL.Contact bll = new BLL.Contact(); string msg = ""; if (bll.Modify(model, out msg)) { MessageBox.Show("修改成功!"); this.Hide(); } else { MessageBox.Show(msg); } UserHelper.Inspecter = ""; } }
private void btnSave_Click(object sender, EventArgs e) { Model.Contact model = new Model.Contact(); model.Id = id; model.Name = txtName.Text.Trim(); model.Phone = txtPhone.Text.Trim(); model.Email = txtEmail.Text.Trim(); model.QQ = txtQQ.Text.Trim(); model.WorkUnit = txtWorkUnit.Text.Trim(); model.OfficePhone = txtOfficePhone.Text.Trim(); model.HomeAddress = txtHomeAddress.Text.Trim(); model.HomePhone = txtHomePhone.Text.Trim(); model.Memo = txtMemo.Text.Trim(); model.GroupId = Convert.ToInt32(cboGroup.SelectedValue); BLL.Contact dll = new BLL.Contact(); string msg = ""; if (dll.Update(model, out msg)) { MessageBox.Show("更新成功!"); } else { MessageBox.Show(msg); } }
private void button1_Click(object sender, EventArgs e) { if (UserHelper.Inspecter == "") { new check_login(this).ShowDialog(); agree.Text = UserHelper.Inspecter; } if (UserHelper.Inspecter != "") { model.Id = textBox1.Text; model.Old_money = textBox2.Text; model.Old_date = textBox3.Text; model.Now = textBox6.Text; model.Date = textBox7.Text; model.Recorder = Recorder.Text; model.Inspecter = agree.Text; model.Reason = textBox10.Text; BLL.Contact bll = new BLL.Contact(); BLL.Change ch = new BLL.Change(); string msg = ""; if (bll.Modify(model, out msg)) { MessageBox.Show("修改成功!"); this.Hide(); } else { MessageBox.Show(msg); } ch.change_ad_state_change(model); ch.change_remain_state_change(model); UserHelper.Inspecter = ""; } }
private void FormContactDetail_Load(object sender, EventArgs e) { FillGroup(); txtId.Text = id.ToString(); BLL.Contact bll = new BLL.Contact(); Model.Contact model = bll.GetModel(id); if (model == null) { MessageBox.Show("数据查询出错"); return; } else { txtName.Text = model.Name; txtPhone.Text = model.Phone; txtEmail.Text = model.Email; txtQQ.Text = model.QQ; txtWorkUnit.Text = model.WorkUnit; txtOfficePhone.Text = model.OfficePhone; txtHomeAddress.Text = model.HomeAddress; txtHomePhone.Text = model.HomePhone; txtMemo.Text = model.Memo; cboGroup.SelectedValue = model.GroupId; } }
private void button2_Click(object sender, EventArgs e) { DialogResult dr = MessageBox.Show("请确认添加!", "添加提示", MessageBoxButtons.OKCancel); if (dr == DialogResult.OK) { model.Id = textBox3.Text; model.Now = textBox4.Text; model.Date = textBox5.Text; model.Recorder = Recorder.Text; model.Inspecter = agree.Text; BLL.Contact bll = new BLL.Contact(); BLL.Change ch = new BLL.Change(); string msg = ""; if (bll.Update(model, out msg)) { MessageBox.Show("添加成功!"); } else { MessageBox.Show(msg); } dataGridView1.DataSource = bll.GetList("1=1", model); dataGridView1.AutoResizeColumns(); ch.change_ad_state(model); ch.change_remain_state(model); UserHelper.Inspecter = ""; } else { MessageBox.Show("添加取消!"); } }
private void FormContactDetail_Load(object sender, EventArgs e) { FillGroup(); txtId.Text = id.ToString(); BLL.Contact bll = new BLL.Contact(); Model.Contact model = bll.GetModel(id); if (model == null) { MessageBox.Show("数据查询出错"); return; } else { txtName.Text=model.Name; txtPhone.Text=model.Phone; txtEmail.Text=model.Email; txtQQ.Text=model.QQ; txtWorkUnit.Text=model.WorkUnit; txtOfficePhone.Text= model.OfficePhone; txtHomeAddress.Text=model.HomeAddress; txtHomePhone.Text=model.HomePhone; txtMemo.Text=model.Memo; cboGroup.SelectedValue= model.GroupId; } }
private void btnSave_Click(object sender, EventArgs e) { Model.Contact model = new Model.Contact(); model.Id = id; model.Name = txtName.Text.Trim(); model.Phone = txtPhone.Text.Trim(); model.Email = txtEmail.Text.Trim(); model.QQ = txtQQ.Text.Trim(); model.WorkUnit = txtWorkUnit.Text.Trim(); model.OfficePhone = txtOfficePhone.Text.Trim(); model.HomeAddress = txtHomeAddress.Text.Trim(); model.HomePhone = txtHomePhone.Text.Trim(); model.Memo = txtMemo.Text.Trim(); model.GroupId = Convert.ToInt32(cboGroup.SelectedValue); BLL.Contact bll = new BLL.Contact(); string msg; if (bll.Update(model, out msg)) { MessageBox.Show("修改成功!"); } else { MessageBox.Show(msg); } }
// PUT: api/Contact/5 public void Put([FromBody] ContactModel model) { var contact = new BLL.Contact() { Id = model.Id, Nom = model.Nom, Prenom = model.Prenom, CodePostal = model.CodePostal, Pays = BLL.PaysDAL.GetPays(model.Pays), Sexe = model.Sexe, Telephone = model.Telephone, }; BLL.ContactDAL.UpdateContact(contact); }
private void button9_Click(object sender, EventArgs e) { model.Id = textBox5.Text.Trim(); model.Name = textBox6.Text.Trim(); model.Buy_time = textBox7.Text.Trim(); model.Price = textBox8.Text.Trim(); model.Discard_time = textBox9.Text.Trim(); model.Initial_recorder = Recorder.Text.Trim(); DialogResult dr = MessageBox.Show("请确认添加!", "添加提示", MessageBoxButtons.OKCancel); if (dr == DialogResult.OK) { BLL.Contact bll = new BLL.Contact(); string msg = ""; if (bll.Update(model, out msg)) { MessageBox.Show("添加成功!"); textBox5.Text = ""; textBox6.Text = ""; textBox7.Text = ""; textBox8.Text = ""; textBox9.Text = ""; } else { MessageBox.Show(msg); } dataGridView1.DataSource = bll.GetList("1=1", model); dataGridView1.AutoResizeColumns(); } else { MessageBox.Show("添加取消!"); } }