public ActionResult Manage()
        {
            var user = StaticData.GetUser();

            if (user == "")
            {
                Uri action = Request.Url;
                Session["Action"] = action;
                return(RedirectToAction("SignIn", "User"));
            }
            var id   = StaticData.GetIdFromQuery();
            var data = buss.GetList(StaticData.GetUser(), id);

            if (data.Count == 0)
            {
                GroceriesCommon model = new GroceriesCommon();

                model.BreadCum = ApplicationGrid.GetBreadCum("Groceries |Groceries Regestration |Manage ");
                return(View(model));
            }

            foreach (var item in data[0].Doc)
            {
                item.DocName = StaticData.GetDocumentPath() + (item.DocName);
            }
            data[0].BreadCum = ApplicationGrid.GetBreadCum("Groceries |Groceries Regestration |Manage");
            return(View(data[0]));
        }
        public ActionResult Manage(string code, string id)
        {
            //StaticData.CheckFunctionId(AddEditId);
            id = StaticData.GetIdFromQuery();
            var data = buss.GetList(StaticData.GetUser(), id, "", 0);

            if (data.Count == 0)
            {
                StaticDataCommon model = new StaticDataCommon();
                model.BreadCum = ApplicationGrid.GetBreadCum("SetUp |Static Data |Manage ");
                return(View(model));
            }
            data[0].BreadCum = ApplicationGrid.GetBreadCum("SetUp |Static Data |Manage");
            return(View(data[0]));
        }
        public ActionResult Manage(GroceriesCommon model)
        {
            if (model != null)
            {
                model.User = StaticData.GetUser();

                var response = buss.Manage(model);
                var imgref   = response.Id.Split(';');
                model.ProductReferenceId = imgref[0];
                model.ProductDestintId   = imgref[1];

                StaticData.SetMessageInSession(response);
                if (response.ErrorCode == 1)
                {
                    ModelState.AddModelError("", response.Message);
                    model.BreadCum = ApplicationGrid.GetBreadCum("Groceries |Groceries Regestration |Manage ");

                    return(View(model));
                }
                else if (model.Doc != null)
                {
                    foreach (var item in model.Doc)
                    {
                        if (item.Img != null)
                        {
                            var uploaded = UploadDoc(model.ProductReferenceId, model.ProductDestintId, item.View, item.Color, item.Img, "");
                            if (uploaded.ErrorCode == 1)
                            {
                                StaticData.SetMessageInSession(0, "Data Saved but " + uploaded.Message);
                            }
                        }
                    }
                }
            }

            return(RedirectToAction("Index"));
        }