public ActionResult CreateNewEnterpriseSubscriber(string username2, string entname, string tax, string entphone, string entemail, string entpass, bool entisactive) { CreateDeleteSubscriberModel sub = new CreateDeleteSubscriberModel(); EnterpriseDataModel entdata = new EnterpriseDataModel(); entdata.GetEnterpriseData(); System.Threading.Thread.Sleep(200); var searchuser2 = entdata.EnterpriseData.Where(y => y.username == username2).SingleOrDefault(); if (searchuser2 != null) { TempData["Message"] = "<script>alert('Bu kayıt zaten mevcut!');</script>"; return(RedirectToAction("CreateNewSubscriber")); } else { sub.AddNewEnterprise(username2, entname, tax, entphone, entemail, entpass, entisactive); sub.AddNewEnterpriseInDeposit(tax); TempData["Message"] = "<script>alert('Başarılı bir şekilde sisteme eklendi');</script>"; return(RedirectToAction("CreateNewSubscriber")); } }
public ActionResult CreateNewConsumerSubscriber(string username1, string conname, string surname, string tc, string conphone, string conemail, string conpass, bool conisactive) { CreateDeleteSubscriberModel sub = new CreateDeleteSubscriberModel(); ConsumerDataModel consdata = new ConsumerDataModel(); consdata.GetConsumerData(); System.Threading.Thread.Sleep(200); var searchuser = consdata.ConsumerData.Where(x => x.username == username1).SingleOrDefault(); if (searchuser != null) { TempData["Message"] = "<script>alert('Bu kayıt zaten mevcut!');</script>"; return(RedirectToAction("CreateNewSubscriber")); } else { sub.AddNewConsumer(username1, conname, surname, tc, conphone, conemail, conpass, conisactive); sub.AddNewConsumerInDeposit(tc); TempData["Message"] = "<script>alert('Başarılı bir şekilde sisteme eklendi');</script>"; return(RedirectToAction("CreateNewSubscriber")); } }