//Add Property Khmer public ActionResult AddKhmer(string TypeOfProperty, string Ownership, string Pacelnumber, string TitleNumber, string Location, string TotalSize) { CreateCompanyContractKhmer contract = new CreateCompanyContractKhmer(); if (Session["PropertyKhmer"] != null) { contract.HypothecatedProperty = (List <PropertyViewKhmer>)Session["PropertyKhmer"]; } //chua kiem tra co trung ko roi moi add vao list if (!String.IsNullOrWhiteSpace(Pacelnumber) && !String.IsNullOrWhiteSpace(TitleNumber)) { if (contract.HypothecatedProperty.Count > 0) { int count = contract.HypothecatedProperty.Where(c => c.Pacelnumber.Equals(Pacelnumber) && c.TitleNumber.Equals(TitleNumber)).Count(); if (count <= 0) { contract.HypothecatedProperty.Add(new PropertyViewKhmer { TypeOfProperty = TypeOfProperty, Ownership = Ownership, Pacelnumber = Pacelnumber, TitleNumber = TitleNumber, Location = Location, TotalSize = TotalSize, isSaved = false }); } else { ViewBag.Error = "Property already have in list. Please input another property"; } } else { contract.HypothecatedProperty.Add(new PropertyViewKhmer { TypeOfProperty = TypeOfProperty, Ownership = Ownership, Pacelnumber = Pacelnumber, TitleNumber = TitleNumber, Location = Location, TotalSize = TotalSize, isSaved = false }); } } else { ViewBag.Error = "Please input information is required."; } Session["PropertyKhmer"] = contract.HypothecatedProperty; return(PartialView("_CreatePropertyKhmer", contract.HypothecatedProperty)); }
public ActionResult DeleteKhmer(string owner, string idNumber, bool isSaved) { CreateCompanyContractKhmer contract = new CreateCompanyContractKhmer(); if (Session["FixDepositKhmer"] != null) { contract.FixDeposit = (List <FixDepositViewKhmer>)Session["FixDepositKhmer"]; } FixDepositViewKhmer _fixDeposit = contract.FixDeposit.Where(c => c.Owner.Equals(owner) && c.IDNumber.Equals(idNumber)).FirstOrDefault(); contract.FixDeposit.Remove(_fixDeposit); Session["FixDepositKhmer"] = contract.FixDeposit; return(PartialView("_CreateFixDepositKhmer", contract.FixDeposit)); }
public ActionResult AddKhmer(string Owner, string IDNumber, DateTime OpeningDate, string TypeOfDeposit) { CreateCompanyContractKhmer contract = new CreateCompanyContractKhmer(); if (Session["FixDepositKhmer"] != null) { contract.FixDeposit = (List <FixDepositViewKhmer>)Session["FixDepositKhmer"]; } if (!string.IsNullOrWhiteSpace(Owner) && !string.IsNullOrWhiteSpace(IDNumber)) { if (contract.FixDeposit.Count > 0) { int count = contract.FixDeposit.Where(c => c.Owner.Equals(Owner) && c.IDNumber.Equals(IDNumber)).Count(); if (count <= 0) { contract.FixDeposit.Add(new FixDepositViewKhmer { Owner = Owner, IDNumber = IDNumber, OpeningDate = OpeningDate, TypeOfDeposit = TypeOfDeposit, isSaved = false }); } else { ViewBag.Error = "FixDeposit already have in list. Please input another fixDeposit"; } } else { contract.FixDeposit.Add(new FixDepositViewKhmer { Owner = Owner, IDNumber = IDNumber, OpeningDate = OpeningDate, TypeOfDeposit = TypeOfDeposit, isSaved = false }); } } else { ViewBag.Error = "Please input information is required."; } Session["FixDepositKhmer"] = contract.FixDeposit; return(PartialView("_CreateFixDepositKhmer", contract.FixDeposit)); }
public ActionResult AddKhmer(string GuarantorName, string GuarantorPassportNo, DateTime GuarantorPassportDate) { CreateCompanyContractKhmer contract = new CreateCompanyContractKhmer(); if (Session["GuarantorKhmer"] != null) { contract.Guarantor = (List <GuarantorViewKhmer>)Session["GuarantorKhmer"]; } if (!string.IsNullOrWhiteSpace(GuarantorName) && !string.IsNullOrWhiteSpace(GuarantorPassportNo)) { if (contract.Guarantor.Count > 0) { int count = contract.Guarantor.Where(c => c.GuarantorName.Equals(GuarantorName) && c.Passport.Equals(GuarantorPassportNo)).Count(); if (count <= 0) { contract.Guarantor.Add(new GuarantorViewKhmer { GuarantorName = GuarantorName, Passport = GuarantorPassportNo, PassportDate = GuarantorPassportDate, isSaved = false }); } else { ViewBag.Error = "Guarantor already have in list. Please input another Guarantor"; } } else { contract.Guarantor.Add(new GuarantorViewKhmer { GuarantorName = GuarantorName, Passport = GuarantorPassportNo, PassportDate = GuarantorPassportDate, isSaved = false }); } } else { ViewBag.Error = "Please input information is required."; } Session["GuarantorKhmer"] = contract.Guarantor; return(PartialView("_CreateGuarantorKhmer", contract.Guarantor)); }
public ActionResult DeleteKhmer(string GuarantorName, string GuarantorPassportNo, bool isSaved) { CreateCompanyContractKhmer contract = new CreateCompanyContractKhmer(); if (Session["GuarantorKhmer"] != null) { contract.Guarantor = (List <GuarantorViewKhmer>)Session["GuarantorKhmer"]; } GuarantorViewKhmer _guarantorViewEng = contract.Guarantor.Where(c => c.GuarantorName.Equals(GuarantorName) && c.Passport.Equals(GuarantorPassportNo)).SingleOrDefault(); contract.Guarantor.Remove(_guarantorViewEng); Session["GuarantorKhmer"] = contract.Guarantor; return(PartialView("_CreateGuarantorKhmer", contract.Guarantor)); }
//Delete Property Khmer public ActionResult DeleteKhmer(string pacelNumber, string titleNumber, bool isSaved) { CreateCompanyContractKhmer contract = new CreateCompanyContractKhmer(); if (Session["PropertyKhmer"] != null) { contract.HypothecatedProperty = (List <PropertyViewKhmer>)Session["PropertyKhmer"]; } PropertyViewKhmer _propertyView = contract.HypothecatedProperty.Where(c => c.Pacelnumber.Equals(pacelNumber) && c.TitleNumber.Equals(titleNumber)) .FirstOrDefault(); contract.HypothecatedProperty.Remove(_propertyView); Session["PropertyKhmer"] = contract.HypothecatedProperty; return(PartialView("_CreatePropertyKhmer", contract.HypothecatedProperty)); }
public ActionResult DeleteKhmer(string plateNumberName, string issuedByName, bool isSaved) { CreateCompanyContractKhmer contract = new CreateCompanyContractKhmer(); if (Session["MortgagePropertyKhmer"] != null) { contract.MortgageProperty = (List <MortgagePropertyViewKhmer>)Session["MortgagePropertyKhmer"]; } MortgagePropertyViewKhmer _propertyView = contract.MortgageProperty.Where(c => c.PlateNumberName.Equals(plateNumberName) && c.IssuedByName.Equals(issuedByName)) .SingleOrDefault(); contract.MortgageProperty.Remove(_propertyView); Session["MortgagePropertyKhmer"] = contract.MortgageProperty; return(PartialView("_CreateMortgagePropertyKhmer", contract.MortgageProperty)); }
public ActionResult AddKhmer(string PlateNumberName, string IssuedByName, string PlateNumberYear, string IssuedByYear, string PlateChassis, string IssuedByChassis, string PlateEngine, string IssuedByEngine, string PlateVignette, string IssuedByVignette) { CreateCompanyContractKhmer contract = new CreateCompanyContractKhmer(); if (Session["MortgagePropertyKhmer"] != null) { contract.MortgageProperty = (List <MortgagePropertyViewKhmer>)Session["MortgagePropertyKhmer"]; } //chua kiem tra co trung ko roi moi add vao list if (!String.IsNullOrWhiteSpace(PlateNumberName) && !String.IsNullOrWhiteSpace(IssuedByName)) { if (contract.MortgageProperty.Count > 0) { int count = contract.MortgageProperty.Where(c => c.PlateNumberName.Equals(PlateNumberName) && c.IssuedByName.Equals(IssuedByName)).Count(); if (count <= 0) { contract.MortgageProperty.Add(new MortgagePropertyViewKhmer { PlateNumberName = PlateNumberName, IssuedByName = IssuedByName, PlateNumberYear = PlateNumberYear, IssuedByYear = IssuedByYear, PlateChassis = PlateChassis, IssuedByChassis = IssuedByChassis, PlateEngine = PlateEngine, IssuedByEngine = IssuedByEngine, PlateVignette = PlateVignette, IssuedByVignette = IssuedByVignette, isSaved = false }); } else { ViewBag.Error = "MortgageProperty already have in list. Please input another MortgageProperty"; } } else { contract.MortgageProperty.Add(new MortgagePropertyViewKhmer { PlateNumberName = PlateNumberName, IssuedByName = IssuedByName, PlateNumberYear = PlateNumberYear, IssuedByYear = IssuedByYear, PlateChassis = PlateChassis, IssuedByChassis = IssuedByChassis, PlateEngine = PlateEngine, IssuedByEngine = IssuedByEngine, PlateVignette = PlateVignette, IssuedByVignette = IssuedByVignette, isSaved = false }); } } else { ViewBag.Error = "Please input information."; } Session["MortgagePropertyKhmer"] = contract.MortgageProperty; return(PartialView("_CreateMortgagePropertyKhmer", contract.MortgageProperty)); }