示例#1
0
 public CustomerEntity Create(CustomerForm form)
 {
     return new CustomerEntity(form.LastName, form.FirstName)
     {
         Email = form.EmailAddress,
         PhoneNumber = form.PhoneNumer
     };
 }
        private void customrFormButton_Click(object sender, EventArgs e)
        {
            CustomerForm aCustomerForm = new CustomerForm();

            aCustomerForm.Show();
        }
示例#3
0
 /// <summary>
 /// Aktualizacja klienta z view modelu
 /// </summary>
 /// <param name="customer">Encja</param>
 /// <param name="customerForm">Formularz</param>
 public void UpdateCustomerEntity(Customer customer, CustomerForm customerForm)
 {
     customer.Firstname = customerForm.Firstname;
 }
        private void cUSTOMERSToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CustomerForm customerForm = new CustomerForm();

            frmgecis.MainFormPass(customerForm, this);
        }
示例#5
0
        public ActionResult InitDB()
        {
            var coupons = new List <Coupon>()
            {
                new Coupon()
                {
                    Barcode        = "BC10000",
                    Type           = DataModel.Enums.CouponTypeEnum.Discount,
                    Value          = 50,
                    ActiveFromDate = DateTime.Today.AddDays(-1),
                    ActiveToDate   = DateTime.Today.AddDays(1)
                },
                new Coupon()
                {
                    Barcode        = "BC10001",
                    Type           = DataModel.Enums.CouponTypeEnum.Discount,
                    Value          = 25,
                    ActiveFromDate = DateTime.Today.AddDays(-1),
                    ActiveToDate   = DateTime.Today.AddDays(1)
                }
            };

            eShopDbContext.Coupons.AddRange(coupons);
            eShopDbContext.SaveChanges();

            var customer = new CustomerForm()
            {
                Name        = "Testas",
                Surname     = "Testaitis",
                Email       = "*****@*****.**",
                Mobile      = "+37060000000",
                Country     = "Lietuva",
                City        = "Vilnius",
                AddressLine = "Gatve g. 11",
                ZipCode     = "00000"
            };

            var items = new List <Item>()
            {
                new Item()
                {
                    Name     = "Testas1",
                    Code     = "C000001",
                    Price    = 8,
                    Quantity = 20,
                    Coupons  = new List <Coupon>()
                    {
                        coupons[0]
                    }
                },
                new Item()
                {
                    Name     = "Testas2",
                    Code     = "C000002",
                    Price    = 6,
                    Quantity = 20,
                    Coupons  = new List <Coupon>()
                    {
                        coupons[0]
                    }
                },
                new Item()
                {
                    Name     = "Testas3",
                    Code     = "C000003",
                    Price    = 4,
                    Quantity = 20,
                    Coupons  = new List <Coupon>()
                    {
                        coupons[1]
                    }
                },
            };

            eShopDbContext.Items.AddRange(items);
            eShopDbContext.SaveChanges();

            eShopDbContext.CustomerForms.AddRange(customer);
            eShopDbContext.SaveChanges();

            return(Ok());
        }
示例#6
0
        public ActionResult EditingPopup_Update([DataSourceRequest] DataSourceRequest request, CustomerForm theCustomer)
        {
            if (theCustomer != null && ModelState.IsValid)
            {
                var newCustomer = Mapper.Map <DataAccess.Models.Customer.Customer>(theCustomer);
                newCustomer.DateUpdated = DateTime.UtcNow;
                newCustomer.UpdatedBy   = "SYSTEM";
                newCustomer.Address     = "123 Test";
                newCustomer.City        = "Test";
                newCustomer.PhoneNumber = "23423424";
                newCustomer.PostalCode  = "92344";
                newCustomer.State       = "CA";

                _customerRepo.Update(newCustomer);
                _customerRepo.SaveAll();
                return(Json(new[] { newCustomer }.ToDataSourceResult(request, ModelState)));
            }

            return(BadRequest());
        }
示例#7
0
        public ActionResult EditingPopup_Destroy([DataSourceRequest] DataSourceRequest request, CustomerForm theCustomer)
        {
            if (theCustomer != null)
            {
                var newCustomer = Mapper.Map <DataAccess.Models.Customer.Customer>(theCustomer);
                _customerRepo.Remove(newCustomer);
                _customerRepo.SaveAll();
                return(Json(new[] { newCustomer }.ToDataSourceResult(request, ModelState)));
            }

            return(BadRequest());
        }
示例#8
0
 public ActionResult SaveCustomer(CustomerForm customerForm)
 {
     ExecuteCommand(new UpdateCustomerCommand(customerForm));
     return(RedirectToAction("EditCustomer", new { customer = customerForm.CustomerId }));
 }
示例#9
0
        public JsonResult Create(CreateFromInsuranceViewModel form)
        {
            DhiphayaContext dhiphaya     = new DhiphayaContext();
            var             customerForm = new CustomerForm();

            customerForm.date             = form.date;
            customerForm.incidentDate     = form.incidentDate;
            customerForm.timeIncidentDate = form.timeIncidentDate;
            customerForm.nameClaim        = form.nameClaim;
            customerForm.phoneClaim       = form.phoneClaim;
            customerForm.emailClaim       = form.emailClaim;
            customerForm.nameContact      = form.nameContact;
            customerForm.phoneContact     = form.phoneContact;
            customerForm.emailContact     = form.emailContact;
            customerForm.insuranceNo      = form.insuranceNo;
            customerForm.place            = form.place;
            customerForm.soi       = form.soi;
            customerForm.road      = form.emailClaim;
            customerForm.province  = form.province;
            customerForm.typeHouse = form.typeHouse;
            customerForm.floor     = form.floor;
            customerForm.wall      = form.wall;
            customerForm.ceiling   = form.ceiling;
            customerForm.roof      = form.roof;
            customerForm.glass     = form.glass;
            customerForm.etc       = form.etc;

            customerForm.meterialFloorSelect = form.meterialFloorSelect;
            customerForm.piecesFloor         = form.piecesFloor;
            customerForm.unitFloor           = form.unitFloor;

            customerForm.meterialWallSelect = form.meterialWallSelect;
            customerForm.piecesWall         = form.piecesWall;
            customerForm.unitWall           = form.unitWall;

            customerForm.meterialCeilingSelect = form.meterialCeilingSelect;
            customerForm.piecesCeiling         = form.piecesCeiling;
            customerForm.unitCeiling           = form.unitCeiling;

            customerForm.meterialRoofSelect = form.meterialRoofSelect;
            customerForm.piecesRoof         = form.piecesRoof;
            customerForm.unitRoof           = form.unitRoof;

            customerForm.meterialGlassSelect = form.meterialGlassSelect;
            customerForm.piecesGlass         = form.piecesGlass;
            customerForm.unitGlass           = form.unitGlass;

            customerForm.meterialEtcSelect = form.meterialEtcSelect;
            customerForm.piecesEtc         = form.piecesEtc;
            customerForm.unitEtc           = form.unitEtc;

            customerForm.incidentPrice       = form.incidentPrice;
            customerForm.causeIncident       = form.causeIncident;
            customerForm.causeIncidentDetail = form.causeIncidentDetail;

            dhiphaya.CustomerForm.Add(customerForm);
            dhiphaya.SaveChanges();
            //var test2 = dhiphaya.Customer.FirstOrDefault(x => x.selfServiceFormId == model.selfServiceFormId && x.registrationGuid == item);
            //CreateFromInsuranceViewModel test
            //var a = test;
            //try
            //{
            //    // TODO: Add insert logic here

            //    return RedirectToAction(nameof(Index));
            //}
            //catch
            //{
            //    return View();
            //}
            return(Json(new { status = true, message = "true!" }));
        }
 public UpdateCustomerCommand(CustomerForm customerForm)
 {
     this.customerForm = customerForm;
 }
示例#11
0
        /// <summary>
        /// Customer
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CustomerMenuItem_Click(object sender, EventArgs e)
        {
            CustomerForm form = new CustomerForm();

            form.ShowDialog();
        }
示例#12
0
 public IActionResult DeleteCustomer([FromBody] CustomerForm theCustomer)
 {
     return(DeleteCustomer(theCustomer.CustomerId));
 }
示例#13
0
 private void loginButton_MouseClick(object sender, MouseEventArgs e)
 {
     try
     {
         using (DataBaseIM db = new DataBaseIM())
         {
             UsersLogin user = db.UsersLogins.FirstOrDefault(u => (u.Login == loginName.Text || u.Mail == loginName.Text) && u.Password == loginPassword.Text);
             if (user != null)
             {
                 CustomerInformation cInfo = db.CustomersInformations.FirstOrDefault(cI => cI.UserLoginId == user.Id);
                 if (cInfo != null)
                 {
                     if (checkBoxUserSave.Checked)
                     {
                         try
                         {
                             SaveSettings();
                         }
                         catch (Exception exd)
                         {
                             MessageBox.Show("Error Server: " + exd);
                         }
                     }
                     this.Hide();
                     CustomerForm cF = new CustomerForm(cInfo);
                     cF.Show();
                 }
                 else
                 {
                     MenedjerInformation mInfo = db.MenedjersInformations.FirstOrDefault(mI => mI.UserLoginId == user.Id);
                     if (mInfo != null)
                     {
                         if (checkBoxUserSave.Checked)
                         {
                             try
                             {
                                 SaveSettings();
                             }
                             catch (Exception exd)
                             {
                                 MessageBox.Show("Error Server: " + exd);
                             }
                         }
                         this.Hide();
                         AdminForm aF = new AdminForm();
                         aF.Show();
                     }
                     else
                     {
                         MessageBox.Show("NOT found");
                     }
                 }
             }
             else
             {
                 MessageBox.Show("No such user found");
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error Server: " + ex);
     }
 }
        private void customer_button_Click(object sender, System.EventArgs e)
        {
            Form selectedForm = new CustomerForm();

            selectedForm.ShowDialog(this);
        }
示例#15
0
        private void TsbCustomer_Click(object sender, System.EventArgs e)
        {
            CustomerForm customerForm = new CustomerForm();

            customerForm.ShowDialog();
        }
示例#16
0
        private void btnNewCustomer_ItemClick(object sender, ItemClickEventArgs e)
        {
            CustomerForm cf = new CustomerForm(null);

            AddTab(cf, "Novo Cliente", false);
        }