Exemplo n.º 1
0
        public ActionResult UpdateCategory(CategoryMaster category)
        {
            List <string> res         = new List <string>();
            var           currentuser = Commonhelper.GetCurrentUserDetails();

            try
            {
                CategoryMaster master = new CategoryMaster();
                master.Id            = category.Id;
                master.ModifiedBy    = currentuser.Id;
                master.ModifiedDate  = DateTime.Now;
                master.Name          = category.Name;
                master.Discount      = category.Discount;
                master.Description   = category.Description;
                master.StoreId       = currentuser.StoreId;
                master.workstation   = Commonhelper.GetStation();
                master.FinancialYear = DateTime.Now.Year;
                master.CompanyId     = currentuser.CompanyId;
                try
                {
                    Commonhelper.UpdateCategory(master);
                    return(Content("<script language='javascript' type='text/javascript'>alert('Category Created successfully!');</script>"));
                }
                catch (Exception ex)
                {
                    return(Content("<script language='javascript' type='text/javascript'>alert('Error in category creation!');</script>"));
                }
            }
            catch (Exception ex)
            {
                return(Content("<script language='javascript' type='text/javascript'>alert('Error in category creation!');</script>"));
            }



            return(Json(res));
        }