public ActionResult Edit(string cid) { cid = Session["CustomerID"].ToString(); if (cid == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Entity.Customer cu = Business.BussLogic.RetriveCustomer(cid); if (cu == null) { return(HttpNotFound()); } VMECustomer acu = new VMECustomer(); acu.id = cu.id; acu.name = cu.name; acu.Dob = cu.Dob; acu.c_contact = cu.c_contact; acu.city = cu.PinCode1.city; acu.state = cu.PinCode1.state; acu.pincode = cu.pincode; return(View(acu)); }
public int Add(CustomerCreateDto newCustomer) { var mapper = Mapper.GetMapperConfiguration(); Entity.Customer cust = mapper.Map <CustomerCreateDto, Entity.Customer>(newCustomer); return(_customerRepository.Add(cust)); }
private void btnSaveCustomer_Click(object sender, EventArgs e) { Entity.Customer customer = new Entity.Customer(); try { customer.CustomerId = Convert.ToInt32(lblCustomerId.Text.ToString()); customer.Name = txtEditCustomerName.Text.ToString(); customer.EmailId = txtEditCustomerEmailId.Text.ToString(); customer.PhoneNo = txtEditCustomerMobileNo.Text.ToString(); customer.GSTN = txtEditCustomerGSTN.Text.ToString(); customer.AddressLine1 = txtEditAddressLine1.Text.ToString(); customer.AddressLine2 = txtEditAddressLine2.Text.ToString(); customer.City = txtEditCity.Text.ToString(); customer.State = txtEditState.Text.ToString(); customer.ZipCode = Convert.ToInt32(txtEditPinCode.Text.ToString()); customer.ModifiedBy = "Admin"; if (customerBAL.updateCustomer(customer)) { MessageBox.Show("Customer updated Successfully."); this.Close(); } else { MessageBox.Show("Something Went Wrong."); } } catch (Exception ex) { } }
public bool Update(CustomerDto customer) { var mapper = Mapper.GetMapperConfiguration(); Entity.Customer cust = mapper.Map <CustomerDto, Entity.Customer>(customer); return(_customerRepository.Update(cust)); }
public static void Update(Entity.Customer obj) { using (var model = new Entity.SeguroEntities1()) { model.Entry <Entity.Customer>(obj).State = EntityState.Modified; model.SaveChanges(); } }
public ActionResult CustomerDetails(Entity.Customer obj) { if (!ModelState.IsValid) { RedirectToAction("Index"); } BusinessLogic.CustomerManager.Update(obj); return(View("Results")); }
public int Add(Entity.Customer customer) { if (customer.Id == 0) { // to support In memory database primary key constraint customer.Id = _context.Customers.Select(x => x.Id).Max() + 1; _context.Customers.Add(customer); _context.SaveChanges(); } return(customer.Id); }
public ActionResult Edit(VMECustomer acu) { if (ModelState.IsValid) { Entity.Customer cu = Business.BussLogic.RetriveCustomer(acu.id); Business.BussLogic.UpdateCustomer(acu.id, acu.name, acu.c_contact, cu.c_email, acu.Dob, acu.pincode, acu.state, acu.city, cu.password); return(RedirectToAction("Index", "Booking", new { area = "Customers" })); } return(View(acu)); }
private void button2_Click(object sender, EventArgs e) { Entity.Customer ec = new Entity.Customer(); ec.Address = textBox1.Text; ec.Phoneno = textBox2.Text; BLL.BLL bb = new BLL.BLL(); try { bb.Update(ec); MessageBox.Show("更新成功"); } catch { MessageBox.Show("更新失败"); } }
public bool Update(Entity.Customer customer) { var cust = _context.Customers.FirstOrDefault(x => x.Id == customer.Id); if (cust != null) { cust.FirstName = customer.FirstName; cust.LastName = customer.LastName; cust.DateOfBirth = customer.DateOfBirth; _context.Customers.Update(cust); _context.SaveChanges(); return(true); } return(false); }
public ActionResult Details(string cid) { cid = Session["CustomerID"].ToString(); Entity.Customer cdetails = Business.BussLogic.RetriveCustomer(cid); VMECustomer cd = new VMECustomer(); cd.id = cdetails.id; cd.name = cdetails.name; cd.pincode = cdetails.pincode; cd.state = cdetails.PinCode1.state; cd.city = cdetails.PinCode1.city; cd.Dob = cdetails.Dob; cd.c_contact = cdetails.c_contact; return(PartialView("_CDetails", cd)); }
public int Create(CustomerView item) { try { Models.Entity.Customer c = new Entity.Customer() { first_name = item.first_name, last_name = item.last_name, phone = item.phone, email = item.email, address = item.address, username = item.username, password = item.password, status = item.status }; db.Customers.Add(c); db.SaveChanges(); return(1); } catch (EntityException ex) { Debug.WriteLine(ex.Message); return(0); } }
private void button1_Click(object sender, EventArgs e) { if (listBox1.SelectedItems.Count == 0) { MessageBox.Show("没有船只被选中请选择"); } else { label2.Text = ""; BLL.BLL bl = new BLL.BLL(); Entity.Customer cs = new Entity.Customer(); cs.Phoneno = Convert.ToString(listBox1.SelectedValue); Entity.Customer cs1 = bl.FindCustomer(cs); textBox1.Text = cs1.Address; textBox2.Text = cs1.phoneno; label2.Text = "注册编号:" + cs1.Boat1.Stateregistrationno + " 制造商:" + cs1.Boat1.Manufacturer + " 船长:" + cs1.Boat1.length + "\r\n" + " 年份:" + cs1.Boat1.Validity + ""; } }
/// <summary> /// 支票购票 /// </summary> /// <param name="customer"></param> /// <param name="debt"></param> /// <returns></returns> public static bool AddCheque(Entity.Customer customer, Entity.Debt debt, out string debtid) { return(DAL.Ticket.AddCheque(customer, debt, out debtid)); }
public ActionResult Customer(Entity.Customer obj) { obj.ID = Guid.NewGuid(); BusinessLogic.CustomerManager.Insert(obj); return(RedirectToAction("Address", new { id = obj.ID.ToString() }));//querystring }
public static void Insert(Entity.Customer obj) { DataLayer.CustomerData.Insert(obj); }
public static void Update(Entity.Customer obj) { DataLayer.CustomerData.Update(obj); }