예제 #1
0
        public async System.Threading.Tasks.Task <ActionResult> CreateColorMaster(ColorMaster _master)
        {
            List <string> res         = new List <string>();
            var           currentuser = Commonhelper.GetCurrentUserDetails();

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

            return(Json(res));
        }