Exemplo n.º 1
0
        //Add Property English
        public ActionResult Add(string TypeOfProperty, string Ownership, string Pacelnumber, string TitleNumber, string Location, string TotalSize)
        {
            CreateCompanyContractEng contract = new CreateCompanyContractEng();

            if (Session["Property"] != null)
            {
                contract.HypothecatedProperty = (List <PropertyView>)Session["Property"];
            }

            //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 PropertyView
                        {
                            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 PropertyView
                    {
                        TypeOfProperty = TypeOfProperty,
                        Ownership      = Ownership,
                        Pacelnumber    = Pacelnumber,
                        TitleNumber    = TitleNumber,
                        Location       = Location,
                        TotalSize      = TotalSize,
                        isSaved        = false
                    });
                }
            }
            else
            {
                ViewBag.Error = "Please input information is required.";
            }

            Session["Property"] = contract.HypothecatedProperty;

            return(PartialView("_CreatePropertyEng", contract.HypothecatedProperty));
        }
        public ActionResult Delete(string owner, string idNumber, bool isSaved)
        {
            CreateCompanyContractEng contract = new CreateCompanyContractEng();

            if (Session["FixDeposit"] != null)
            {
                contract.FixDeposit = (List <FixDepositViewEng>)Session["FixDeposit"];
            }
            FixDepositViewEng _fixDeposit = contract.FixDeposit.Where(c => c.Owner.Equals(owner) && c.IDNumber.Equals(idNumber)).FirstOrDefault();

            contract.FixDeposit.Remove(_fixDeposit);
            Session["FixDeposit"] = contract.FixDeposit;
            return(PartialView("_CreateFixDepositEng", contract.FixDeposit));
        }
Exemplo n.º 3
0
        public ActionResult Add(string GuarantorName, string GuarantorPassportNo, DateTime GuarantorPassportDate)
        {
            CreateCompanyContractEng contract = new CreateCompanyContractEng();

            if (Session["Guarantor"] != null)
            {
                contract.Guarantor = (List <GuarantorViewEng>)Session["Guarantor"];
            }


            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 GuarantorViewEng
                        {
                            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 GuarantorViewEng
                    {
                        GuarantorName = GuarantorName,
                        Passport      = GuarantorPassportNo,
                        PassportDate  = GuarantorPassportDate,
                        isSaved       = false
                    });
                }
            }
            else
            {
                ViewBag.Error = "Please input information is required.";
            }
            Session["Guarantor"] = contract.Guarantor;
            return(PartialView("_CreateGuarantorEng", contract.Guarantor));
        }
        public ActionResult Add(string Owner, string IDNumber, DateTime OpeningDate, string TypeOfDeposit)
        {
            CreateCompanyContractEng contract = new CreateCompanyContractEng();

            if (Session["FixDeposit"] != null)
            {
                contract.FixDeposit = (List <FixDepositViewEng>)Session["FixDeposit"];
            }
            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 FixDepositViewEng
                        {
                            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 FixDepositViewEng
                    {
                        Owner         = Owner,
                        IDNumber      = IDNumber,
                        OpeningDate   = OpeningDate,
                        TypeOfDeposit = TypeOfDeposit,
                        isSaved       = false
                    });
                }
            }
            else
            {
                ViewBag.Error = "Please input information is required.";
            }
            Session["FixDeposit"] = contract.FixDeposit;
            return(PartialView("_CreateFixDepositEng", contract.FixDeposit));
        }
Exemplo n.º 5
0
        public ActionResult Delete(string GuarantorName, string GuarantorPassportNo, bool isSaved)
        {
            CreateCompanyContractEng contract = new CreateCompanyContractEng();

            if (Session["Guarantor"] != null)
            {
                contract.Guarantor = (List <GuarantorViewEng>)Session["Guarantor"];
            }
            GuarantorViewEng _guarantorViewEng = contract.Guarantor.Where(c => c.GuarantorName.Equals(GuarantorName) &&
                                                                          c.Passport.Equals(GuarantorPassportNo)).SingleOrDefault();

            contract.Guarantor.Remove(_guarantorViewEng);

            Session["Guarantor"] = contract.Guarantor;
            return(PartialView("_CreateGuarantorEng", contract.Guarantor));
        }
Exemplo n.º 6
0
        //Delete Property English
        public ActionResult Delete(string pacelNumber, string titleNumber, bool isSaved)
        {
            CreateCompanyContractEng contract = new CreateCompanyContractEng();

            if (Session["Property"] != null)
            {
                contract.HypothecatedProperty = (List <PropertyView>)Session["Property"];
            }

            PropertyView _propertyView = contract.HypothecatedProperty.Where(c => c.Pacelnumber.Equals(pacelNumber) && c.TitleNumber.Equals(titleNumber))
                                         .FirstOrDefault();

            contract.HypothecatedProperty.Remove(_propertyView);

            Session["Property"] = contract.HypothecatedProperty;
            return(PartialView("_CreatePropertyEng", contract.HypothecatedProperty));
        }
        public ActionResult Delete(string plateNumberName, string issuedByName, bool isSaved)
        {
            CreateCompanyContractEng contract = new CreateCompanyContractEng();

            if (Session["MortgageProperty"] != null)
            {
                contract.MortgageProperty = (List <MortgagePropertyView>)Session["MortgageProperty"];
            }

            MortgagePropertyView _propertyView = contract.MortgageProperty.Where(c => c.PlateNumberName.Equals(plateNumberName) && c.IssuedByName.Equals(issuedByName))
                                                 .SingleOrDefault();

            contract.MortgageProperty.Remove(_propertyView);

            Session["MortgageProperty"] = contract.MortgageProperty;
            return(PartialView("_CreateMortgagePropertyEng", contract.MortgageProperty));
        }
        public ActionResult Add(string PlateNumberName, string IssuedByName, string PlateNumberYear, string IssuedByYear, string PlateChassis,
                                string IssuedByChassis, string PlateEngine, string IssuedByEngine, string PlateVignette, string IssuedByVignette)
        {
            CreateCompanyContractEng contract = new CreateCompanyContractEng();

            if (Session["MortgageProperty"] != null)
            {
                contract.MortgageProperty = (List <MortgagePropertyView>)Session["MortgageProperty"];
            }
            //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 MortgagePropertyView
                        {
                            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 MortgagePropertyView
                    {
                        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["MortgageProperty"] = contract.MortgageProperty;

            return(PartialView("_CreateMortgagePropertyEng", contract.MortgageProperty));
        }