コード例 #1
0
        public ActionResult Save()
        {
            List <GeneralCatagory> generalCatagories = manager.GetAll();

            ViewBag.GeneralCategoryList = generalCatagories;
            return(View());
        }
コード例 #2
0
        public ActionResult Save()
        {
            List <GeneralCatagory> generalCatagories = generalCategoryManager.GetAll();

            ViewBag.GeneralcategoryList = generalCatagories;
            List <CategorySetup> categorySetups = categorySetupManager.GetAll();

            ViewBag.CategorySetupList = categorySetups;
            List <SubCategory> subCategories = subCategoryManager.GetAll();

            ViewBag.SubCategoryList = subCategories;
            return(View());
        }
コード例 #3
0
        // GET: /Product/Create
        public ActionResult Create()
        {
            var generalCategoryList = _generalCategoryManager.GetAll();

            ViewBag.generalCategoryID = new SelectList(generalCategoryList, "GeneralCategoryID", "GeneralCategoryName");

            var categoryList = _categoryManager.GetAll();

            ViewBag.CategoryID = new SelectList(categoryList, "CategoryID", "CategoryName");

            var subCategoryList = _subCategoryManager.GetAll();

            ViewBag.SubCategoryID = new SelectList(subCategoryList, "SubCategoryID", "SubCategoryName");
            return(View());
        }
コード例 #4
0
        // GET: Category
        public ActionResult Entry()
        {
            var generalCategory = _generalCategoryManager.GetAll();

            var category = GetAll();

            // for showing the general category name in table
            //GetAll().Join(generalCategory,
            //    c => c.GeneralCategoryId,
            //    g => g.Id,
            //    (c,g) =>
            //    new
            //    {
            //        Id = c.Id,
            //        Name = c.Name,
            //        Code = c.Code,
            //        Description = c.Description,
            //        GeneralCategoryName = g.Name
            //    }
            //);


            ViewBag.allCategory = category;

            var viewModel = new CategoryViewModel
            {
                GeneralCategories = generalCategory,
                Category          = new Category()
            };

            return(View(viewModel));
        }
コード例 #5
0
        // GET: GeneralCategory

        public ActionResult Entry()
        {
            var generalCategory = _manager.GetAll();

            ViewBag.ModelGeneralCategory = generalCategory;
            return(View());
        }
コード例 #6
0
        // GET: /Category/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Category category = _categoryManager.GetById((int)id);

            if (category == null)
            {
                return(HttpNotFound());
            }
            var generalCategoryList = _generalCategoryManager.GetAll();

            ViewBag.GeneralCategoryID = new SelectList(generalCategoryList, "GeneralCategoryID", "GeneralCategoryName");
            return(View(category));
        }
コード例 #7
0
        public JsonResult GetByAjax()
        {
            var var = _Manager.GetAll();

            return(new JsonResult {
                Data = var, JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
コード例 #8
0
        // GET: SubCategory
        public ActionResult Entry()
        {
            ViewBag._category = GetAll();
            var category        = _categoryManager.GetAll();
            var generalCategory = _generalCategoryManager.GetAll();

            ViewBag.GeneralCategory = generalCategory;

            return(View());
        }
コード例 #9
0
        public List <SelectListItem> GetGeneralCategorySelectListItems()
        {
            var generalcategory = generalCategoryManager.GetAll();
            var items           = GetDefaultSelectListItem();

            items.AddRange(generalcategory.Select(gc => new SelectListItem()
            {
                Value = gc.Id.ToString(),
                Text  = gc.Name,
            }));
            return(items);
        }
コード例 #10
0
        // GET: /AssetPurchase/Create
        public ActionResult Create()
        {
            var generalCategoryList = _generalCategoryManager.GetAll();

            ViewBag.generalCategoryID = new SelectList(generalCategoryList, "GeneralCategoryID", "GeneralCategoryName");

            var categoryList = _categoryManager.GetAll();

            ViewBag.CategoryID = new SelectList(categoryList, "CategoryID", "CategoryName");

            var subCategoryList = _subCategoryManager.GetAll();

            ViewBag.SubCategoryID = new SelectList(subCategoryList, "SubCategoryID", "SubCategoryName");

            var organizationBranchesList = _organizationBranchManager.GetAll();

            ViewBag.OrganizationBranchID = new SelectList(organizationBranchesList, "OrganizationBranchID", "OrganizationBranchName");

            var vendorList = _vendorManager.GetAll();

            ViewBag.VendorID = new SelectList(vendorList, "VendorID", "VendorName");
            return(View());
        }
コード例 #11
0
        public JsonResult GetAssetDetailsWithAllNameById(int?assetId)
        {
            var result = from asset in assetManager.GetAll().Where(c => c.Id == assetId)
                         join brand in brandManager.GetAll()
                         on asset.BrandId equals brand.Id
                         join category in categoryManager.GetAll()
                         on brand.CategoryId equals category.Id
                         join generalc in generalCategoryManager.GetAll()
                         on category.GeneralCategoryId equals generalc.Id
                         select new
            {
                assetid             = asset.Id,
                assetname           = asset.Name,
                assetcode           = asset.Code,
                assetserialno       = asset.SerialNo,
                assetprice          = asset.Price,
                assetdescription    = asset.Description,
                brandid             = brand.Id,
                brandname           = brand.Name,
                categoryid          = category.Id,
                categoryname        = category.Name,
                generalcategoryid   = generalc.Id,
                generalcategoryname = generalc.Name,
            };

            var result2 = from assetdetails in assetRegistrationDetailsManager.GetAll().Where(c => c.AssetId == assetId)
                          join organization in organizationManager.GetAll()
                          on assetdetails.OrganizationId equals organization.Id
                          join branch in branchManager.GetAll()
                          on assetdetails.BranchId equals branch.Id
                          select new
            {
                organizationid   = organization.Id,
                organizationname = organization.Name,
                branchid         = branch.Id,
                branchname       = branch.Name
            };

            MovementEntryVM move = new MovementEntryVM();

            foreach (var t in result)
            {
                move.AssetId             = t.assetid;
                move.Code                = t.assetcode;
                move.Price               = t.assetprice;
                move.SerialNo            = t.assetserialno;
                move.Description         = t.assetdescription;
                move.BrandName           = t.brandname;
                move.CategoryId          = t.categoryid;
                move.CategoryNme         = t.categoryname;
                move.GeneralCategoryId   = t.generalcategoryid;
                move.GeneralCategoryName = t.generalcategoryname;
            }
            foreach (var t in result2)
            {
                move.OrganizationId   = t.organizationid;
                move.OrganizationName = t.organizationname;
                move.BranchId         = t.branchid;
                move.BranchName       = t.branchname;
            }
            var jsonItem = new
            {
                Id                  = move.AssetId,
                Code                = move.Code,
                Price               = move.Price,
                SerialNo            = move.SerialNo,
                Description         = move.Description,
                BrandName           = move.BrandName,
                CategoryName        = move.CategoryNme,
                GeneralCategoryName = move.GeneralCategoryName,
                OrganizationId      = move.OrganizationId,
                OrganizationName    = move.OrganizationName,
                BranchId            = move.BranchId,
                BranchName          = move.BranchName
            };

            return(Json(jsonItem, JsonRequestBehavior.AllowGet));
        }
コード例 #12
0
 // GET: Product
 public ActionResult Index()
 {
     ViewBag.Product         = GetAll();
     ViewBag.GeneralCategory = _GeneralCategoryManager.GetAll();
     return(View());
 }
コード例 #13
0
        // GET: /GeneralCategory/
        public ActionResult Index()
        {
            var GeneralCategories = _generalCategoryManager.GetAll();

            return(View(GeneralCategories.ToList()));
        }