public bool DeleteCustomer(int custId) { ICustomersBL _customerBL = new CustomersBL(); return(_customerBL.DeleteCustomer(custId)); //return false; }
/// <summary> /// This is Customers. /// </summary> /// <param name="sender">sender obj.</param> /// <param name="e">envt argument.</param> protected void Page_Load(object sender, EventArgs e) { CustomersBL customerObject = new CustomersBL(); this.CustomersGv.DataSource = customerObject.GridViewBind(); this.CustomersGv.DataBind(); }
public void BornInAMonthBeforeThisMonth() { TestClock tstCl = new TestClock(01, 10, 2017); CustomersBL blayer = new CustomersBL(); DateTime dob = new DateTime(1969, 7, 9); Assert.AreEqual(blayer.calculateAge(dob, tstCl), 48); }
// GET: Customers public ActionResult Index() { // return View(db.Customer.ToList()); CustomersBL custBl = new CustomersBL(); var model = custBl.returnAll(); return(View(model)); }
public IEnumerable <CatagoryType> GetCustomerType() { ICustomersBL _customerBL = new CustomersBL(); var ctype = _customerBL.GetCustomerType(); return(ctype); }
/// <summary> /// Gets all customers. /// </summary> /// <returns>Get All Customers</returns> public IEnumerable <Customer> GetAllCustomers() { IList <Customer> CustomersList = new List <Customer>(); ICustomersBL _customerBL = new CustomersBL(); CustomersList = _customerBL.GetAllCustomer(); return(CustomersList); }
public IEnumerable <CatagoryType> GetCatagoryType(string cat_type) { ICustomersBL _customerBL = new CustomersBL(); var ctype = _customerBL.GetCategoryType(cat_type); return(ctype); }
public IEnumerable <CustomerEntity> GetCustomerList() { IList <CustomerEntity> CustomersList = new List <CustomerEntity>(); ICustomersBL _customerBL = new CustomersBL(); CustomersList = _customerBL.GetCustomerList(); return(CustomersList); }
public void ViewInfo(string userName, string Password) { while (true) { string row = ("=================================================================="); Customers cus = new Customers(); CustomersBL cuBL = new CustomersBL(); try { cus = cuBL.Login(userName, Password); } catch (System.Exception) { Console.WriteLine("Disconnect from datebase !"); break; } Console.WriteLine(row); Console.WriteLine("CUSTOMER INFOMATION"); Console.WriteLine(row); Console.WriteLine("Customer Id : {0}", cus.CusID); Console.WriteLine("Customer Username : {0}", cus.UserName); Console.WriteLine("Customer Name : {0}", cus.CusName); Console.WriteLine("Customer Address : {0}", cus.Address); Console.WriteLine("Customer Phone Number: {0}", cus.PhoneNumber); string choice = null; Console.WriteLine("\n" + row + "\n"); Console.WriteLine("1. Go to menu"); Console.WriteLine("2. Back"); Console.Write("Please enter your selection: "); choice = Console.ReadLine(); if (validateChoice(choice) == false) { Console.Write("You are only entered in the number existing!"); } switch (choice) { case "1": showItems(); break; case "2": break; default: Console.WriteLine("You are only entered in the number of existing ids !"); continue; } if (choice == "2") { break; } } }
// GET: Customer public ActionResult ListView() { using (var session = CustomersDAL.sessionFactory.OpenSession()) { ICriteria criteria = session.CreateCriteria(typeof(Customers)); var customersList = criteria.List <Customers>(); List <CustomerModel> cmList = CustomersBL.TransferModel(customersList.ToList()); ViewData["cusList"] = cmList; return(View()); } }
public List <TaxModel> GetTaxCodeAndRatesList() { ICustomersBL _customerBL = new CustomersBL(); var cTaxRateList = _customerBL.GetTaxCodeAndRate(); if (cTaxRateList != null) { cTaxRateList = cTaxRateList.FindAll(x => x.IsInActive != "Y"); } return(cTaxRateList); }
public ActionResult EditView() { string customerId = Request.QueryString["customerId"] == null ? string.Empty : Request.QueryString["customerId"].ToString(); if (!string.IsNullOrEmpty(customerId)) { using (var session = CustomersDAL.sessionFactory.OpenSession()) { //ICriteria criteria = session.CreateCriteria(typeof(Customers)); IList <Customers> list = session.QueryOver <Customers>().Where(o => o.CustomerID == customerId).List(); CustomerModel model = CustomersBL.TransferModel(list.ToList()).FirstOrDefault(); //ViewData["cusItem"] = model; return(View(model)); } } else { return(View(new CustomerModel())); } }
public void AddToCart(Items item) { Customers cust = new Customers(); CustomersBL cusBl = new CustomersBL(); items.Add(item); string sJSONResponse = JsonConvert.SerializeObject(items); // Console.WriteLine(sJSONResponse); BinaryWriter bw; string fileName = "shoppingcart" + cusAll.UserName + ".dat"; try { FileStream fs = new FileStream(fileName, FileMode.OpenOrCreate, FileAccess.ReadWrite); bw = new BinaryWriter(fs); bw.Write((string)(object)sJSONResponse); fs.Close(); } catch (System.Exception) { Console.WriteLine("Disconnect from database !"); } Console.WriteLine("Add to cart success !"); }
public List <PostalCode> AutoFillPostalCode() { ICustomersBL _customerBL = new CustomersBL(); return(_customerBL.AutoFillPostalCode()); }
public bool?IsCompanyRegisteredForGST() { ICustomersBL _customerBL = new CustomersBL(); return(_customerBL.IsCompanyRegisteredForGST()); }
public void showItemDetail() { while (true) { string row = ("=================================================================="); ItemsBL itBL = new ItemsBL(); Items it = new Items(); List <Items> li = new List <Items>(); Customers custom = new Customers(); CustomersBL cutomBL = new CustomersBL(); string choice; int itID; try { li = itBL.getItemsByItemID(1); Console.Write("Enter item id: "); itID = int.Parse(Console.ReadLine()); } catch (System.Exception) { Console.WriteLine("Item id must be integer and in the options !"); continue; } if (itID > li.Count || validateChoice(itID.ToString()) == false) { Console.Write("You are only entered in the number of existing ids !"); while (true) { Console.Write("Do you want re-enter ? (Y/N): "); choice = Console.ReadLine().ToUpper(); if (choice != "Y" && choice != "N") { Console.Write("You can only enter (Y/N): "); choice = Console.ReadLine().ToUpper(); continue; } break; } switch (choice) { case "Y": continue; case "N": showItems(); break; default: continue; } } try { it = itBL.GetItemByItemID(itID); } catch (System.Exception) { Console.WriteLine("Disconnect from database !"); } if (it == null) { Console.WriteLine("The item does not exist !"); } else { Console.WriteLine(row); Console.WriteLine("DETAIL OF ITEM"); Console.WriteLine(row); var table = new ConsoleTable("ID", "ITEM NAME", "ITEM PRICE", "SIZE"); table.AddRow(it.ItemID, it.ItemName, it.ItemPrice, it.Size); table.Write(); Console.WriteLine("DESCRIPTION : "); Console.WriteLine(it.ItemDescription); } string select; Console.WriteLine("\n" + row + "\n"); Console.WriteLine("1. Add to cart"); Console.WriteLine("2. Back to Menu"); Console.Write("Enter your selection: "); select = Console.ReadLine(); switch (select) { case "1": AddToCart(it); break; case "2": showItems(); break; default: Console.WriteLine("You are only entered in the number existing !"); continue; } string conti; Console.Write("Do you continue ? (Y/N): "); conti = checkYN(); if (conti == "Y") { showItems(); } else { break; } } }
public int CreateCustomer(Customer entity) { ICustomersBL _customerBL = new CustomersBL(); return(_customerBL.CreateCustomer(entity)); }
public void LoginMenu() { Console.Clear(); CustomersBL cuBL = new CustomersBL(); Customers cu = new Customers(); Items it = new Items(); string userName = null; string password = null; string choice; while (true) { string row = ("=================================================================="); Console.WriteLine(row); Console.WriteLine(); Console.WriteLine("LOGIN MENU \n"); Console.WriteLine(row); Console.Write("Enter user name: "); userName = Console.ReadLine().Trim(); // if (userName == null) // { // Console.WriteLine("The username cannot be empty !"); // continue; // } Console.Write("Enter password: "******"Disconnect from database!"); LoginMenu(); } if ((validate(userName) == false) || (validate(password) == false)) { Console.Write("User name / Password cannot contain special characters, do you want re-enter ? (Y/N)"); choice = checkYN(); switch (choice) { case "Y": continue; case "N": showItems(); break; default: continue; } } if (cu == null) { Console.WriteLine("Username or password is incorrect!"); } else { while (true) { Console.WriteLine(row); Console.WriteLine("WELCOME BACK ! {0}", cu.CusName.ToUpper()); string chose; Console.WriteLine(row); Console.WriteLine("1. View Infomation"); Console.WriteLine("2. Go to menu"); Console.WriteLine("3. Show Cart"); Console.WriteLine("4. log out"); Console.Write("Enter your selction: "); chose = Console.ReadLine(); switch (chose) { case "1": ViewInfo(userName, password); break; case "2": showItems(); break; case "3": ShowCart(); break; case "4": LoginMenu(); break; default: Console.WriteLine("Input invalid !"); continue; } } } } }
public IEnumerable <ShippingAddress> GetShippingAddress(int customerId) { ICustomersBL _customerBL = new CustomersBL(); return(_customerBL.GetShippingAddress(customerId)); }
public TaxModel GetDefaultTaxes() { ICustomersBL _customerBL = new CustomersBL(); return(_customerBL.GetDefaultTaxes()); }
public int GetCustomersCount(string isInActive) { ICustomersBL _customerBL = new CustomersBL(); return(_customerBL.GetCustomersCount(isInActive)); }
public bool RefreshCustomer(int custId) { ICustomersBL _customerBL = new CustomersBL(); return(_customerBL.RefreshCustomer(custId)); }
public bool?AllowedToChangeLimit() { ICustomersBL _customerBL = new CustomersBL(); return(_customerBL.IsAllowedToChangeLimit()); }
public List <State> AutoFillState() { ICustomersBL _customerBL = new CustomersBL(); return(_customerBL.AutoFillState()); }
public OptionsEntity GetOptionSettings() { ICustomersBL _customerBL = new CustomersBL(); return(_customerBL.GetOptionSettings()); }
public List <City> AutoFillCity() { ICustomersBL _customerBL = new CustomersBL(); return(_customerBL.AutoFillCity()); }