private void btnSave_Click(object sender, RoutedEventArgs e) { ForceValidation(); if (Validation.GetHasError(txtShowRName) || Validation.GetHasError(txtCNumber) || Validation.GetHasError(txtCity)) { MessageBox.Show("Error Some Data is Missing", "ERROR"); return; } ShowRFactory obj = new ShowRFactory(); ShowRoom SRobj = new ShowRoom(); City Cobj = new City(); SRobj.ShowRName = txtShowRName.Text; SRobj.SRContectNumber = int.Parse(txtCNumber.Text.ToString()); Cobj.CityName = txtCity.Text; if (obj.insert(Cobj, SRobj)) { MessageBox.Show("Car Showroom is Saved Successfully", "Saved"); } else { MessageBox.Show("Car Showroom is Not Saved ", "Error!"); } txtCity.Text = null; txtCNumber.Text = null; txtShowRName.Text = null; }
public static void Main() { ShowRoom suzuki = new ShowRoom("alto", 56000, 1902, "grey"); ShowRoom hyndai = new ShowRoom("Santro", 50000, 5000, "light grey"); ShowRoom gm = new ShowRoom("prizm", 81000, 4200, "white"); ShowRoom honda = new ShowRoom("Accord", 47000, 8300, "green"); List <ShowRoom> MyCarsList = new List <ShowRoom> { suzuki, hyndai, gm, honda }; Console.WriteLine("what is your budget?"); string Answer = Console.ReadLine(); int Budget = int.Parse(Answer); List <ShowRoom> UnderBudgetCars = new List <ShowRoom>(0); foreach (ShowRoom auto in MyCarsList) { if (auto.WithinBudget(Budget)) { UnderBudgetCars.Add(auto); } } foreach (ShowRoom auto in UnderBudgetCars) { Console.WriteLine(auto.Price); } }
public RedirectToRouteResult modifyProc(ShowRoom showroom) { showroom.uptId = System.Web.HttpContext.Current.User.Identity.Name; this.showroomService.updateShowRoom(showroom); return(RedirectToAction("list", (RouteValueDictionary)Session["searchMap"])); }
public bool insert(City Cobj, ShowRoom SRobj) { obj.Cities.Add(Cobj); obj.SaveChanges(); SRobj.City_ID = Cobj.Ci_ID; obj.ShowRooms.Add(SRobj); return(obj.SaveChanges() > 0); }
public ActionResult modify(ShowRoom showroom) { ShowRoom item = this.showroomService.findShowRoom(showroom); ViewBag.item = item; return(View()); }
public ActionResult list(ShowRoom showroom) { this.searchService.setSearchSession(Request, Session); this.searchService.setPagination(showroom, 20, this.showroomService.findAllCount(showroom)); ViewBag.list = this.showroomService.findAll(showroom); ViewBag.pagination = showroom; return(View()); }
public ShowRoom findShowRoom(ShowRoom showroom) { ShowRoom findShowRoomOne = this.showroomDao.findShowroom(showroom); if (findShowRoomOne == null) { throw new CustomException("데이터가 존재하지 않습니다."); } return(findShowRoomOne); }
public void deleteShowRoom(ShowRoom showroom) { findShowRoom(showroom); try { Mapper.Instance().BeginTransaction(); this.showroomDao.deleteShowroom(showroom); Mapper.Instance().CommitTransaction(); } catch (Exception e) { Mapper.Instance().RollBackTransaction(); } }
public void insertShowRoom(ShowRoom showroom) { validation(showroom); try { Mapper.Instance().BeginTransaction(); this.showroomDao.insertShowroom(showroom); Mapper.Instance().CommitTransaction(); } catch (Exception e) { Mapper.Instance().RollBackTransaction(); } }
public bool DeleteS(int id) { ShowRoom sr = obj.ShowRooms.Where(x => x.S_ID == id).FirstOrDefault(); if (sr != null) { obj.ShowRooms.Remove(sr); return(obj.SaveChanges() > 0); } else { return(false); } }
public void WelcomeMessageForAdmin() { int choice = 0; do { Console.WriteLine("1- Add a car"); Console.WriteLine("2- Search a car"); Console.WriteLine("3- Delete a car"); Console.WriteLine("4- Update a car"); Console.WriteLine("5- Exit"); Console.Write("Enter Choice :"); choice = Convert.ToInt32(Console.ReadLine()); Console.Clear(); switch (choice) { case 1: User.AddCar(); break; case 2: User.SearchCar(); break; case 3: User.DeleteCar(); break; case 4: User.UpdateCar(); //User.ShowCars(); break; case 5: ShowRoom r = new ShowRoom(); r.WelcomeMessege(); break; default: Console.WriteLine("Invalid Choice !"); break; } } while (choice != 7); }
///////////////////////////////////////////////////////////////////////// private void validation(ShowRoom showroom) { if (String.IsNullOrWhiteSpace(showroom.brand)) { throw new CustomException("필수 값이 없습니다.(브랜드)"); } if (String.IsNullOrWhiteSpace(showroom.showroomName)) { throw new CustomException("필수 값이 없습니다.(전시장명)"); } if (String.IsNullOrWhiteSpace(showroom.location)) { throw new CustomException("필수 값이 없습니다.(지역)"); } if (String.IsNullOrWhiteSpace(showroom.address)) { throw new CustomException("필수 값이 없습니다.(주소)"); } if (String.IsNullOrWhiteSpace(showroom.lat)) { throw new CustomException("필수 값이 없습니다.(위치좌표1)"); } if (String.IsNullOrWhiteSpace(showroom.lng)) { throw new CustomException("필수 값이 없습니다.(위치좌표2)"); } if (string.IsNullOrWhiteSpace(showroom.tel1) && string.IsNullOrWhiteSpace(showroom.tel2) && string.IsNullOrWhiteSpace(showroom.tel3)) { showroom.tel1 = ""; showroom.tel2 = ""; showroom.tel3 = ""; } if (String.IsNullOrWhiteSpace(showroom.businessTime)) { throw new CustomException("필수 값이 없습니다.(영업시간)"); } }
static void Main(string[] args) { Console.WriteLine("\t*********************************************************************************************************"); Console.WriteLine("\t*********************************************************************************************************"); Console.WriteLine("\t| | || | | _______ _________ ___________ ______ ______ _______ "); Console.WriteLine("\t| | || || | | | ______| | | | _______| | _______ | | ||||| |||| | | ______|"); Console.WriteLine("\t| | || || | | ||______ | | | | | | | | | | || || | | ||______ "); Console.WriteLine("\t| | || || | | | ______| | | | | | | | | | | || || | | | ______|"); Console.WriteLine("\t||||| ||||| ||______ | |____ | |_____ | |_______| | | | |||| | | ||______ "); Console.WriteLine("\t|___| |___| | ______| |______| |_________| |___________| | | || | | |_______|"); Console.WriteLine("\t*********************************************************************************************************"); Console.WriteLine(); Console.WriteLine("\t********************************** TO SHOW ROOM *************************************************"); Console.WriteLine(); Console.WriteLine("\t*********************************************************************************************************"); Console.WriteLine(); Console.WriteLine(); Console.WriteLine("\t\t\tGROUP MEMBERS:"); Console.WriteLine(); Console.WriteLine("\t\t\t\t**************************************"); Console.WriteLine("\t\t\t\tAbubaker Ijaz ADPCS-S02-F19-031"); Console.WriteLine("\t\t\t\tFida Alvi Maryam ADPCS-S02-F19-019"); Console.WriteLine("\t\t\t\tFariha ADPCS-S02-F19-012"); Console.WriteLine("\t\t\t\tMuhammad Adil ADPCS-S02-F19-035"); Console.WriteLine("\t\t\t\t**************************************"); Console.WriteLine(); Console.WriteLine(); Console.WriteLine("\t\t\t\t\t\t\t\t\tTo:"); Console.WriteLine("\t\t\t\t\t\t\t\t\t\tProf. Ishtiaq Rai"); Console.ReadLine(); Console.Clear(); ShowRoom showRoom = new ShowRoom(); showRoom.WelcomeMessege(); }
public int findAllCount(ShowRoom showroom) { return(this.showroomDao.findAllCount(showroom)); }
public RedirectToRouteResult delete(ShowRoom showroom) { this.showroomService.deleteShowRoom(showroom); return(RedirectToAction("list")); }
public IList <ShowRoom> findAll(ShowRoom showroom) { return(Mapper.Instance().QueryForList <ShowRoom>("showroom.findAll", showroom)); }
public int findAllCount(ShowRoom showroom) { return(Mapper.Instance().QueryForObject <int>("showroom.findAllCount", showroom)); }
private void Awake() { instance = this; }
public int Compute(ShowRoom s) { return(s.AreaInSquareFeet * 4); }
public void insertShowroom(ShowRoom showroom) { Mapper.Instance().Insert("showroom.insertShowroom", showroom); }
public ShowRoom findShowroom(ShowRoom showroom) { return(Mapper.Instance().QueryForObject <ShowRoom>("showroom.findShowroom", showroom)); }
public void updateShowroom(ShowRoom showroom) { Mapper.Instance().Update("showroom.updateShowroom", showroom); }
public ActionResult register(ShowRoom showroom) { return(View()); }
public IList <ShowRoom> findAll(ShowRoom showroom) { return(this.showroomDao.findAll(showroom)); }
public void deleteShowroom(ShowRoom showroom) { Mapper.Instance().Delete("showroom.deleteShowroom", showroom); }