Beispiel #1
0
        public ActionResult Create()
        {
            //int Empid = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString());
            List <EmpInsuranceItem> lstInsu = new List <EmpInsuranceItem>();
            EmpInsuranceService     objInsu = new EmpInsuranceService();
            //ViewBag.Empid = Empid;
            int    cid = 0;
            string uid = null;

            if (Session["UserId"] != null)
            {
                uid = Session["UserId"].ToString();
            }
            if (Session["CompID"] != null)
            {
                cid = Convert.ToInt32(Session["CompID"].ToString());
            }
            lstInsu = objInsu.VehicleInsuranceList(cid);
            EmpInsuranceItem objEmpItem = new EmpInsuranceItem();

            objEmpItem.ListInsurance = new List <EmpInsuranceItem>();
            objEmpItem.ListInsurance.AddRange(lstInsu);
            VehicleRepairingService objVrepairing = new VehicleRepairingService();

            #region Bind DropDown Vehicle
            List <VehicleItem> lstVehicle1 = new List <VehicleItem>();
            lstVehicle1            = objVrepairing.GetVehicle(cid);
            objEmpItem.ListVehicle = new List <VehicleItem>();
            objEmpItem.ListVehicle.AddRange(lstVehicle1);

            #endregion

            #region Bind DropDown Icomp
            List <clsMasterData> lstMasters = new List <clsMasterData>();
            lstMasters = objInsu.GetALLIComp();
            objEmpItem.ListMasterTable = new List <clsMasterData>();
            objEmpItem.ListMasterTable.AddRange(lstMasters);

            #endregion
            #region Bind DropDown Ptype
            List <clsMasterData> lstMasters1 = new List <clsMasterData>();
            lstMasters1 = objInsu.GetALLPType();
            objEmpItem.ListPolicyType = new List <clsMasterData>();
            objEmpItem.ListPolicyType.AddRange(lstMasters1);

            #endregion
            #region Bind DropDown Branch
            List <BranchItem> lstBranch = new List <BranchItem>();
            lstBranch             = objInsu.GetBranch();
            objEmpItem.ListBranch = new List <BranchItem>();
            objEmpItem.ListBranch.AddRange(lstBranch);

            #endregion

            #region Bind DropDown Comp
            List <CompanyItem> lstComp = new List <CompanyItem>();
            lstComp             = objInsu.GetComp();
            objEmpItem.ListComp = new List <CompanyItem>();
            objEmpItem.ListComp.AddRange(lstComp);

            #endregion

            #region Bind DropDown Emp
            List <EmployeeItem> lstEmp = new List <EmployeeItem>();
            lstEmp             = objInsu.GetEmp();
            objEmpItem.ListEmp = new List <EmployeeItem>();
            objEmpItem.ListEmp.AddRange(lstEmp);

            #endregion
            ViewBag.Menuid = Request.QueryString["menuId"];
            return(View(objEmpItem));
        }