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));
        }
Пример #3
0
        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));
        }
Пример #5
0
 public static void Update(Entity.Customer obj)
 {
     using (var model = new Entity.SeguroEntities1())
     {
         model.Entry <Entity.Customer>(obj).State = EntityState.Modified;
         model.SaveChanges();
     }
 }
Пример #6
0
        public ActionResult CustomerDetails(Entity.Customer obj)
        {
            if (!ModelState.IsValid)
            {
                RedirectToAction("Index");
            }

            BusinessLogic.CustomerManager.Update(obj);

            return(View("Results"));
        }
Пример #7
0
        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));
        }
Пример #9
0
 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("更新失败");
     }
 }
Пример #10
0
        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));
        }
Пример #12
0
 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);
     }
 }
Пример #13
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 + "";
     }
 }
Пример #14
0
 /// <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));
 }
Пример #15
0
 public ActionResult Customer(Entity.Customer obj)
 {
     obj.ID = Guid.NewGuid();
     BusinessLogic.CustomerManager.Insert(obj);
     return(RedirectToAction("Address", new { id = obj.ID.ToString() }));//querystring
 }
Пример #16
0
 public static void Insert(Entity.Customer obj)
 {
     DataLayer.CustomerData.Insert(obj);
 }
Пример #17
0
 public static void Update(Entity.Customer obj)
 {
     DataLayer.CustomerData.Update(obj);
 }