Beispiel #1
0
        public customerContactController()
        {
            repo     = RepositoryHelper.Get客戶聯絡人Repository();
            occuRepo = RepositoryHelper.Get客戶聯絡人Repository(repo.UnitOfWork);

            repo客戶資料 = RepositoryHelper.Get客戶資料Repository();
        }
        public static 客戶資料Repository Get客戶資料Repository()
        {
            var repository = new 客戶資料Repository();

            repository.UnitOfWork = GetUnitOfWork();
            return(repository);
        }
        public static 客戶資料Repository Get客戶資料Repository(IUnitOfWork unitOfWork)
        {
            var repository = new 客戶資料Repository();

            repository.UnitOfWork = unitOfWork;
            return(repository);
        }
        public customerbankController()
        {
            repo     = RepositoryHelper.Get客戶銀行資訊Repository();
            occuRepo = RepositoryHelper.Get客戶銀行資訊Repository(repo.UnitOfWork);

            repo客戶資料 = RepositoryHelper.Get客戶資料Repository();
        }
 // GET: Contact/Create
 public ActionResult Create()
 {
     客戶資料Repository repoC = new 客戶資料Repository();
     //ViewBag.客戶Id = new SelectList(db.客戶資料.Where(c => c.是否已刪除 == false), "Id", "客戶名稱");
     ViewBag.客戶Id = new SelectList(repoC.All(), "Id", "客戶名稱");
     return View();
 }
Beispiel #6
0
        // GET: CustomerContact/Create
        public ActionResult Create()
        {
            客戶資料Repository custRepo = RepositoryHelper.Get客戶資料Repository();

            ViewBag.客戶Id = new SelectList(custRepo.All(), "Id", "客戶名稱");
            return(View());
        }
Beispiel #7
0
        public ActionResult Create([Bind(Include = "Id,客戶Id,職稱,姓名,Email,手機,電話,isDeleted")] 客戶聯絡人 客戶聯絡人)
        {
            if (ModelState.IsValid)
            {
                //db.客戶聯絡人.Add(客戶聯絡人);
                //db.SaveChanges();

                //客戶聯絡人 custContact = new 客戶聯絡人();
                //if (!custContact.checkEmailAddress(客戶聯絡人.客戶Id, 客戶聯絡人.Email))
                //{
                //    ModelState.AddModelError("Email", "email address重複!");

                //    ViewBag.客戶Id = new SelectList(custRepo.All(), "Id", "客戶名稱", 客戶聯絡人.客戶Id);
                //    return View(客戶聯絡人);
                //}

                customerRepo.Add(客戶聯絡人);
                customerRepo.UnitOfWork.Commit();

                return(RedirectToAction("Index"));
            }

            客戶資料Repository custRepo = RepositoryHelper.Get客戶資料Repository();

            ViewBag.客戶Id = new SelectList(custRepo.All(), "Id", "客戶名稱", 客戶聯絡人.客戶Id);
            return(View(客戶聯絡人));
        }
Beispiel #8
0
        public 客戶聯絡人Controller()
        {
            var unitOfWork = new EFUnitOfWork();

            customerContactRepo = RepositoryHelper.Get客戶聯絡人Repository(unitOfWork);
            customerRepo        = RepositoryHelper.Get客戶資料Repository(unitOfWork);
        }
        public 客戶銀行資訊Controller()
        {
            var unitOfWork = new EFUnitOfWork();

            customerBankInfoRepo = RepositoryHelper.Get客戶銀行資訊Repository(unitOfWork);
            customerRepo         = RepositoryHelper.Get客戶資料Repository(unitOfWork);
        }
        public 客戶資料Controller()
        {
            this.repo        = RepositoryHelper.Get客戶資料Repository();
            this.contactRepo = RepositoryHelper.Get客戶聯絡人Repository(repo.UnitOfWork);

            CreateCategoryDic();
        }
        public HomeController()
        {
            var unitOfWork = new EFUnitOfWork();

            customerManagementListRepo = RepositoryHelper.Get客戶管理清單Repository(unitOfWork);
            customerContactRepo        = RepositoryHelper.Get客戶聯絡人Repository(unitOfWork);
            customerRepo = RepositoryHelper.Get客戶資料Repository(unitOfWork);
        }
        // GET: Contact/Create
        public ActionResult Create()
        {
            客戶資料Repository repoC = new 客戶資料Repository();

            //ViewBag.客戶Id = new SelectList(db.客戶資料.Where(c => c.是否已刪除 == false), "Id", "客戶名稱");
            ViewBag.客戶Id = new SelectList(repoC.All(), "Id", "客戶名稱");
            return(View());
        }
Beispiel #13
0
        public CustController()
        {
            repo = RepositoryHelper.Get客戶資料Repository();

            ViewBag.CategoryList = from item in repo.Get客戶分類List()
                                   select new SelectListItem {
                Text = item, Value = item
            };
        }
Beispiel #14
0
        public ActionResult Edit([Bind(Include = "Id,客戶Id,銀行名稱,銀行代碼,分行代碼,帳戶名稱,帳戶號碼")] 客戶銀行資訊 客戶銀行資訊)
        {
            if (ModelState.IsValid)
            {
                var db = repo.UnitOfWork.Context;
                db.Entry(客戶銀行資訊).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            客戶資料Repository 客戶資料repo = RepositoryHelper.Get客戶資料Repository();

            ViewBag.客戶Id = new SelectList(客戶資料repo.All(), "Id", "客戶名稱", 客戶銀行資訊.客戶Id);
            return(View(客戶銀行資訊));
        }
        public ActionResult 客戶資料Excel()

        {
            客戶資料repo = RepositoryHelper.Get客戶資料Repository();
            List <客戶資料> items = 客戶資料repo.All().ToList();
            var         dt    = ConvertToDataTable(items);

            //var wb = new XLWorkbook();
            //var ws = wb.Worksheets.Add("客戶資料");
            //ws.Cell(1, 1).Value = dataTable.AsEnumerable();
            //wb.SaveAs("Content/Excel/客戶資料.xlsx");
            //return File(Server.MapPath(@"~/Content/Excel/\客戶資料.xlsx"), "application / vnd.openxmlformats - officedocument.spreadsheetml.sheet","test");

            ExportExcel(dt, "客戶資料");
            return(RedirectToAction("客戶資料Excel", "File"));
        }
Beispiel #16
0
        public ActionResult Edit([Bind(Include = "Id,客戶Id,職稱,姓名,Email,手機,電話,isDeleted")] 客戶聯絡人 客戶聯絡人)
        {
            if (ModelState.IsValid)
            {
                var db = customerRepo.UnitOfWork.Context;

                db.Entry(客戶聯絡人).State = EntityState.Modified;
                customerRepo.UnitOfWork.Commit();

                return(RedirectToAction("Index"));
            }

            客戶資料Repository custRepo = RepositoryHelper.Get客戶資料Repository();

            ViewBag.客戶Id = new SelectList(custRepo.All(), "Id", "客戶名稱", 客戶聯絡人.客戶Id);
            return(View(客戶聯絡人));
        }
Beispiel #17
0
        public ActionResult Login(LoginViewModel login, string ReturnUrl)
        {
            if (ModelState.IsValid)
            {
                客戶資料Repository 客戶資料repo = RepositoryHelper.Get客戶資料Repository();
                var            customer = 客戶資料repo.All().Where(客 => 客.帳號 == login.Email).ToList();

                if (customer.Count == 1)
                {
                    if (customer.First().密碼 == Hash.Encode(login.Password))
                    {
                        FormsAuthentication.RedirectFromLoginPage(login.Email, false);
                        //return Redirect(ReturnUrl ?? "/");
                        return(Redirect("/客戶資料/Edit2"));
                    }
                }
            }
            return(View());
        }
Beispiel #18
0
        // GET: CustomerContact/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
//            客戶聯絡人 客戶聯絡人 = db.客戶聯絡人.Find(id);
            客戶聯絡人 客戶聯絡人 = customerRepo.Find(id.Value);

            if (客戶聯絡人 == null)
            {
                return(HttpNotFound());
            }

            客戶資料Repository custRepo = RepositoryHelper.Get客戶資料Repository();

            ViewBag.客戶Id = new SelectList(custRepo.All(), "Id", "客戶名稱", 客戶聯絡人.客戶Id);
            return(View(客戶聯絡人));
        }
 public 客戶銀行資訊Controller()
 {
     repo         = RepositoryHelper.Get客戶銀行資訊Repository();
     repoCustomer = RepositoryHelper.Get客戶資料Repository();
 }
Beispiel #20
0
 public 客戶聯絡人Controller()
 {
     ClientData    = RepositoryHelper.Get客戶資料Repository();
     ClientContact = RepositoryHelper.Get客戶聯絡人Repository(ClientData.UnitOfWork);
     ClientBank    = RepositoryHelper.Get客戶銀行資訊Repository(ClientContact.UnitOfWork);
 }
Beispiel #21
0
 public ContactController()
 {
     repo     = RepositoryHelper.Get客戶聯絡人Repository();
     repoCust = RepositoryHelper.Get客戶資料Repository(repo.UnitOfWork);
 }
 public 客戶聯絡人Controller()
 {
     repo   = RepositoryHelper.Get客戶聯絡人Repository();
     custpo = RepositoryHelper.Get客戶資料Repository(repo.UnitOfWork);
     //  occuRepo = RepositoryHelper.Get客戶資料Repository(repo.UnitOfWork);
 }
Beispiel #23
0
 public 客戶資料Controller()
 {
     客戶資料repo     = RepositoryHelper.Get客戶資料Repository();
     listItems    = 客戶資料repo.GetListItem();
     ViewBag.分類名稱 = listItems;
 }
 public 客戶銀行資訊Controller()
 {
     客戶資料repo   = RepositoryHelper.Get客戶資料Repository();
     客戶銀行資訊repo = RepositoryHelper.Get客戶銀行資訊Repository(客戶資料repo.UnitOfWork);
 }
 public 客戶聯絡人Controller()
 {
     repo聯絡 = RepositoryHelper.Get客戶聯絡人Repository();
     repo客戶 = RepositoryHelper.Get客戶資料Repository(repo聯絡.UnitOfWork);
 }
 public CustomerController()
 {
     this._CustomerRepo = RepositoryHelper.Get客戶資料Repository();
     this._CountInfoRepo = RepositoryHelper.GetVW_客戶聯絡人跟銀行資訊統計Repository();
     this._CustomerTypeRepo = RepositoryHelper.Get客戶分類Repository();
 }
Beispiel #27
0
 public VWLISTCOUNTController()
 {
     repo = RepositoryHelper.Get客戶資料Repository(qry.UnitOfWork);
 }
 public 客戶聯絡人Controller()
 {
     repo客戶資料 = RepositoryHelper.Get客戶資料Repository(repo.UnitOfWork);
 }
 public 客戶資料Controller()
 {
     this.customerData = RepositoryHelper.Get客戶資料Repository();
 }
 public static 客戶資料Repository Get客戶資料Repository(IUnitOfWork unitOfWork)
 {
     var repository = new 客戶資料Repository();
     repository.UnitOfWork = unitOfWork;
     return repository;
 }
Beispiel #31
0
 public CustomerDataVM()
 {
     customerDataRepo = RepositoryHelper.Get客戶資料Repository();
 }
Beispiel #32
0
 public 客戶資料Controller()
 {
     repo = RepositoryHelper.Get客戶資料Repository();
 }
Beispiel #33
0
 public AccountController()
 {
     repo = RepositoryHelper.Get客戶資料Repository();
 }
 public static 客戶資料Repository Get客戶資料Repository()
 {
     var repository = new 客戶資料Repository();
     repository.UnitOfWork = GetUnitOfWork();
     return repository;
 }
 public ContactController()
 {
     this._ContactRepo = RepositoryHelper.Get客戶聯絡人Repository();
     this._CustomerInfoRepo = RepositoryHelper.Get客戶資料Repository();
 }
 public 客戶銀行資訊Controller()
 {
     repo     = RepositoryHelper.Get客戶銀行資訊Repository();
     repoInfo = RepositoryHelper.Get客戶資料Repository(repo.UnitOfWork);
 }
Beispiel #37
0
 public BankController()
 {
     this._BankInfoRepo = RepositoryHelper.Get客戶銀行資訊Repository();
     this._CustomerInfoRepo = RepositoryHelper.Get客戶資料Repository();
 }