示例#1
0
        public ActionResult Create()
        {
            List <OtherExpItem> lstOExp = new List <OtherExpItem>();
            int cid = 0;

            if (Session["CompID"] != null)
            {
                cid = Convert.ToInt32(Session["CompID"].ToString());
            }

            OtherExpService objOExp = new OtherExpService();

            lstOExp = objOExp.OtherExpData(cid);
            OtherExpItem objOExpItem = new OtherExpItem();

            objOExpItem.ListOExp = new List <OtherExpItem>();
            objOExpItem.ListOExp.AddRange(lstOExp);

            #region Bind DropDown Comp
            List <CompanyItem> lstComp = new List <CompanyItem>();
            lstComp = objOExp.GetAllComp();
            objOExpItem.ListComp = new List <CompanyItem>();
            objOExpItem.ListComp.AddRange(lstComp);
            #endregion

            #region Bind DropDown Emp
            List <EmployeeItem> lstEmp = new List <EmployeeItem>();
            lstEmp = objOExp.GetEmp();
            objOExpItem.ListEmp = new List <EmployeeItem>();
            objOExpItem.ListEmp.AddRange(lstEmp);
            #endregion

            #region Bind DropDown Branch
            List <BranchItem> lstBranch = new List <BranchItem>();
            lstBranch = objOExp.GetBranch();
            objOExpItem.ListBranch = new List <BranchItem>();
            objOExpItem.ListBranch.AddRange(lstBranch);

            #endregion

            #region Bind DropDown Exp
            List <clsMasterData> lstMasters1 = new List <clsMasterData>();
            lstMasters1            = objOExp.GetExp();
            objOExpItem.ListMaster = new List <clsMasterData>();
            objOExpItem.ListMaster.AddRange(lstMasters1);

            #endregion

            ViewBag.Menuid = Request.QueryString["menuId"];
            return(View(objOExpItem));
        }
示例#2
0
        public ActionResult View(int id)
        {
            OtherExpService objOExpService = new OtherExpService();
            OtherExpItem    objOExpItem    = new OtherExpItem();

            objOExpItem = objOExpService.GetById(id);
            List <OtherExpItem> lstVehicle = new List <OtherExpItem>();

            objOExpItem.ListOExp = new List <OtherExpItem>();
            objOExpItem.ListOExp.AddRange(lstVehicle);

            #region Bind DropDown Comp
            List <CompanyItem> lstComp = new List <CompanyItem>();
            lstComp = objOExpService.GetAllComp();
            objOExpItem.ListComp = new List <CompanyItem>();
            objOExpItem.ListComp.AddRange(lstComp);
            #endregion

            #region Bind DropDown Emp
            List <EmployeeItem> lstEmp = new List <EmployeeItem>();
            lstEmp = objOExpService.GetEmp();
            objOExpItem.ListEmp = new List <EmployeeItem>();
            objOExpItem.ListEmp.AddRange(lstEmp);
            #endregion
            #region Bind DropDown Branch
            List <BranchItem> lstBranch = new List <BranchItem>();
            lstBranch = objOExpService.GetBranch();
            objOExpItem.ListBranch = new List <BranchItem>();
            objOExpItem.ListBranch.AddRange(lstBranch);

            #endregion
            #region Bind DropDown Exp
            List <clsMasterData> lstMasters1 = new List <clsMasterData>();
            lstMasters1            = objOExpService.GetExp();
            objOExpItem.ListMaster = new List <clsMasterData>();
            objOExpItem.ListMaster.AddRange(lstMasters1);
            #endregion
            ViewBag.Menuid = Request.QueryString["menuId"];
            return(View(objOExpItem));
        }