Exemple #1
0
        public async System.Threading.Tasks.Task <ActionResult> CreateBrandMaster(BrandMaster _brand)
        {
            List <string> res         = new List <string>();
            var           currentuser = Commonhelper.GetCurrentUserDetails();

            if (ModelState.IsValid)
            {
                try
                {
                    BrandMaster master = new BrandMaster();
                    master.Id            = Guid.NewGuid().ToString();
                    master.CreatedBy     = currentuser.Id;
                    master.CreatedDate   = DateTime.Now;
                    master.Name          = _brand.Name;
                    master.Description   = _brand.Description;
                    master.StoreId       = currentuser.StoreId;
                    master.workstation   = Commonhelper.GetStation();
                    master.FinancialYear = DateTime.Now.Year;
                    master.CompanyId     = currentuser.CompanyId;
                    master.Isactive      = true;
                    try
                    {
                        Commonhelper.SaveBrand(master);
                        return(RedirectToAction("BrandMaster"));
                    }
                    catch (Exception ex)
                    {
                        return(RedirectToAction("BrandMaster"));
                    }
                }
                catch (Exception ex)
                {
                    return(RedirectToAction("BrandMaster"));
                }
            }
            else
            {
            }

            return(Json(res));

            return(View());
        }