Exemplo n.º 1
0
        public ActionResult BatchEditingUpdateModel(MVCxGridViewBatchUpdateValues <InventoryItem, object> updateValues)
        {
            DataViewsSearch search = new DataViewsSearch();

            string serverId = Session["server"].ToString();
            string moduleId = "Inventory";
            string formId   = "gbz_boxes";
            string fieldId  = "inventoryNumber";

            string box = Session["box"].ToString();

            ViewData["server"]   = serverId;
            ViewData["moduleId"] = moduleId;
            ViewData["formId"]   = formId;
            ViewData["viewName"] = fieldId;

            /*
             * foreach (var inventoryItem in updateValues.Insert)
             * {
             *  if (updateValues.IsValid(product))
             *      InsertProduct(inventoryItem, updateValues);
             * }
             * foreach (var product in updateValues.Update)
             * {
             *  if (updateValues.IsValid(product))
             *      UpdateProduct(product, updateValues);
             * }
             * foreach (var productID in updateValues.DeleteKeys)
             * {
             *  DeleteProduct(productID, updateValues);
             * }*/
            search.NewBox(serverId, moduleId, formId, fieldId, updateValues.Insert, box);
            //return PartialView("_GridViewPartial", search.NewBox(serverId, moduleId, formId, fieldId, updateValues.Insert, box));//GridViewPartial();
            return(RedirectToAction("Index2", "Search", new { serverId, moduleId, formId = "gbz_get_inventory", fieldId = "storageLocation", value = box })); // This is going back to another page after the info is updated
        }
Exemplo n.º 2
0
        public ActionResult GetGermplasmDetails(string serverId, string germplasmDbId)
        {
            DataViewsSearch search = new DataViewsSearch();

            ViewData["server"]        = serverId;
            ViewData["germplasmDbId"] = germplasmDbId;

            return(PartialView("_LoadOnDemand", search.GetGermplasmDetails(serverId, Int32.Parse(germplasmDbId))));
        }
Exemplo n.º 3
0
        public ActionResult Index2(string serverId, string moduleId, string formId, string fieldId, string value)
        {
            DataViewsSearch search = new DataViewsSearch();

            ViewData["server"]   = serverId;
            ViewData["moduleId"] = moduleId;
            ViewData["formId"]   = formId;
            ViewData["viewName"] = fieldId;
            ViewData["value"]    = value;

            return(View("Index", search.GetData(serverId, moduleId, formId, fieldId, value)));
        }
Exemplo n.º 4
0
        public ActionResult GridView(string serverId, string moduleId, string formId, string fieldId, string value, string viewName)
        {
            DataViewsSearch search = new DataViewsSearch();

            ViewData["server"]   = serverId;
            ViewData["moduleId"] = moduleId;
            ViewData["formId"]   = formId;
            ViewData["viewName"] = fieldId;
            ViewData["value"]    = value;

            ViewData["germplasmDbId"] = 0;

            return(PartialView(viewName, search.GetData(serverId, moduleId, formId, fieldId, value)));
        }
Exemplo n.º 5
0
        public ActionResult Index(FormCollection formdata)
        {
            DataViewsSearch search = new DataViewsSearch();

            string serverId = Session["server"].ToString();
            string moduleId = formdata["moduleId"];
            string formId   = formdata["formId"];
            string fieldId  = formdata["radios"];
            string value    = formdata[String.Format("text {0}", fieldId)];

            ViewData["server"]   = serverId;
            ViewData["moduleId"] = moduleId;
            ViewData["formId"]   = formId;
            ViewData["viewName"] = fieldId;
            ViewData["value"]    = value;

            return(View(search.GetData(serverId, moduleId, formId, fieldId, value)));
        }
Exemplo n.º 6
0
        public ActionResult GridViewPartialUpdate(string serverId, string moduleId, string formId, string fieldId, string value, string viewName)
        {
            DataViewsSearch search = new DataViewsSearch();

            ViewData["server"]   = serverId;
            ViewData["moduleId"] = moduleId;
            ViewData["formId"]   = formId;
            ViewData["viewName"] = fieldId;
            ViewData["value"]    = value;

            try
            {
                search.SaveData(serverId, moduleId, formId, fieldId, value);
            }
            catch (Exception e)
            {
                Guid d = Guid.NewGuid();
                log.Fatal(Guid.NewGuid(), e);

                ViewData["EditError"] = String.Format(e.Message);
            }

            return(PartialView(viewName, search.GetData(serverId, moduleId, formId, fieldId, value)));
        }