public ActionResult AddBankDetails(string payee_first_name, string payee_last_name, string payee_bank_name, string payee_bank_account, string payee_bank_ifsc, string payee_bank_branch) { logics = new GeneralLogics(); businessLogics = new BusinessLogics(); string email = Session["LoginEmail"].ToString(); //string email = "*****@*****.**"; var result = businessLogics.FindAccountByEmail(email); if (result != null) { List <string> inputDetails = new List <string> { payee_first_name, payee_last_name, payee_bank_name, email, payee_bank_account, payee_bank_ifsc, payee_bank_branch }; if (logics.ContainsAnyNullorWhiteSpace(inputDetails)) { ViewBag.ErrorMsg = "No Field Should be left blank"; } if (!logics.ContainsOnlyDigits(payee_bank_account)) { ViewBag.ErrorMsg = "Invalid bank account number"; } if (payee_bank_ifsc.Length != 11 && !logics.ContainsOnlyAlphabets(payee_bank_ifsc.Substring(0, 4))) { ViewBag.ErrorMsg = "Invalid bank IFSC number"; } if (!logics.ContainsOnlyAlphabets(payee_first_name) && !logics.ContainsOnlyAlphabets(payee_last_name)) { ViewBag.ErrorMsg = "Invalid Payee name invalid"; } var bankaccountCreationResult = businessLogics.AddBankDetails(result.Id, payee_first_name, payee_last_name, payee_bank_name, payee_bank_account, payee_bank_ifsc, payee_bank_branch); if (bankaccountCreationResult == 1) { //Bank details created successfully return(RedirectToAction("Index", "UserProfile")); } //else if (bankaccountCreationResult == 2) //{ // ViewBag.ErrorMsg = "Internal server error occured while inserting data to the database"; //} else { ViewBag.ErrorMsg = "Internal server error occured while inserting data to the database"; } } else { ViewBag.ErrorMsg = "Account information retreval failed"; } return(View()); }
public ActionResult CreateOnlyAlbum(string albumName, string totalTrack) { logics = new GeneralLogics(); businessLogics = new BusinessLogics(); List <string> inputStrings = new List <string> { albumName, totalTrack }; string userEmail = Session["LoginEmail"].ToString(); //string userEmail = "*****@*****.**"; if (userEmail != null) { if (!logics.ContainsAnyNullorWhiteSpace(inputStrings)) { if (logics.ContainsOnlyDigits(totalTrack)) { var result = businessLogics.CreateNewAlbum(userEmail, albumName, Convert.ToInt32(totalTrack)); if (result == 0) { ViewBag.ErrorMsg = "No Account is associated with the email address from which user is trying to create the album."; } if (result == 1) { return(RedirectToAction("Index", "UserProfile")); } if (result == 2) { ViewBag.ErrorMsg = "No purchase left to create an music album"; } if (result == 3 || result == 4) { ViewBag.ErrorMsg = "Internal error occured while creating the album"; } } else { ViewBag.ErrorMsg = "Track number field must contains only number. Invalid input given"; } } else { ViewBag.ErrorMsg = "No fields should be left empty"; } } else { return(RedirectToAction("Logout", "Authentication")); } return(View("AddorEditAlbum")); }
public ActionResult EditOnlyAlbum(string albumId, string albumName, string totalTrack) { logics = new GeneralLogics(); businessLogics = new BusinessLogics(); List <string> inputStrings = new List <string> { albumName, totalTrack }; string userEmail = Session["LoginEmail"].ToString(); //string userEmail = "*****@*****.**"; if (userEmail != null) { if (!logics.ContainsAnyNullorWhiteSpace(inputStrings)) { if (logics.ContainsOnlyDigits(totalTrack)) { var result = businessLogics.EditAlbum(Guid.Parse(albumId), albumName, Convert.ToInt32(totalTrack)); if (result == 0) { ViewBag.ErrorMsg = "No album found with the Id provided"; } if (result == 1) { return(RedirectToAction("Index", "UserProfile")); } if (result == 2) { ViewBag.ErrorMsg = "Can't edit album as one song alredy registered under the album"; } if (result == 3) { ViewBag.ErrorMsg = "Internal error occured while creating the album"; } } else { ViewBag.ErrorMsg = "Track number field must contains only number. Invalid input given"; } } else { ViewBag.ErrorMsg = "No fields should be left empty"; } } else { return(RedirectToAction("Logout", "Authentication")); } return(View("AddorEditAlbum")); }
public ActionResult EditTrackDetails(Guid trackId, string TrackTitle, string ArtistName, string ArtistAlreadyInSpotify, string ArtistSpotifyUrl, DateTime ReleaseDate, string Genre, string CopyrightClaimerName, string AuthorName, string ComposerName, string ArrangerName, string ProducerName, string AlreadyHaveAnISRC, string ISRC_Number, string PriceTier, string ExplicitContent, string IsTrackInstrumental, string LyricsLanguage, string TrackZipFileLink, string ArtWork_Link) { ViewBag.TrackId = trackId; List <string> mandetoryFieldsInput = new List <string> { TrackTitle, ArtistName, Genre, CopyrightClaimerName, AuthorName, ComposerName, ArrangerName, ProducerName, PriceTier, TrackZipFileLink, ArtWork_Link }; List <string> mandetoryBoolFields = new List <string> { ArtistAlreadyInSpotify, AlreadyHaveAnISRC, ExplicitContent, IsTrackInstrumental }; logic = new GeneralLogics(); if (!logic.ContainsAnyNullorWhiteSpace(mandetoryFieldsInput)) { if (!logic.ContainsAnyNullorWhiteSpace(mandetoryBoolFields)) { bool isArtistOnSpotify = false, isTrackHasISRC = false, isTrackHasExplicitContent = false, isTrackInstrumental = false; if (ArtistAlreadyInSpotify == "yes") { isArtistOnSpotify = true; } if (AlreadyHaveAnISRC == "yes") { isTrackHasISRC = true; } if (ExplicitContent == "yes") { isTrackHasExplicitContent = true; } if (IsTrackInstrumental == "yes") { isTrackInstrumental = true; } if ((isArtistOnSpotify && !String.IsNullOrWhiteSpace(ArtistSpotifyUrl.Trim())) || (isArtistOnSpotify == false && String.IsNullOrWhiteSpace(ArtistSpotifyUrl.Trim()))) { if ((isTrackHasISRC && !String.IsNullOrWhiteSpace(ISRC_Number.Trim())) || (isTrackHasISRC == false && String.IsNullOrWhiteSpace(ISRC_Number.Trim()))) { if ((isTrackInstrumental && String.IsNullOrWhiteSpace(LyricsLanguage.Trim())) || (isTrackInstrumental == false && !String.IsNullOrWhiteSpace(LyricsLanguage.Trim()))) { if (ReleaseDate != null && ReleaseDate > logic.CurrentIndianTime()) { //Code to add the song to the album businessLogics = new BusinessLogics(); var result = businessLogics.EditTrack(trackId, TrackTitle, ArtistName, isArtistOnSpotify, ArtistSpotifyUrl, ReleaseDate, Genre, CopyrightClaimerName, AuthorName, ComposerName, ArrangerName, ProducerName, isTrackHasISRC, ISRC_Number, Convert.ToInt32(PriceTier), isTrackHasExplicitContent, isTrackInstrumental, LyricsLanguage, TrackZipFileLink, ArtWork_Link); if (result == 1) { return(RedirectToAction("Index", "UserProfile")); } else if (result == 7) { ViewBag.ErrorMsg = "Your purchase has expired. you can't add the track to the album."; } else if (result == 8) { ViewBag.ErrorMsg = "You can't add the track as the album is full."; } else { ViewBag.ErrorMsg = "Internal Error occured"; } } else { ViewBag.ErrorMsg = "Provide a valid Date to release your track"; } } else { ViewBag.ErrorMsg = "If it's an instrumental track then leave the Lyrics Language field empty"; } } else { ViewBag.ErrorMsg = "If you have ISRC number for the track then select yes and provide the number. Otherwise select no and leave the field empty."; } } else { ViewBag.ErrorMsg = "If artist is already on spotify then select yes and provide the link of the artist. Otherwise select no and leave the field empty."; } } else { ViewBag.ErrorMsg = "Select proper options from dropdowns"; } } else { ViewBag.ErrorMsg = "Mandetory Fields can't be left empty"; } return(View("EditTrack")); }
public ActionResult SignUp(string first_name, string last_name, string mobile, string email, string address1, string address2, string pincode, string password, string con_password) { logics = new GeneralLogics(); businessLogics = new BusinessLogics(); List <string> inputValues = new List <string> { first_name, last_name, mobile, email, address1, address2, pincode, password, con_password }; if (logics.ContainsAnyNullorWhiteSpace(inputValues)) { ViewBag.ErrorMsg = "No Field Should be left blank"; } else { if (!logics.ContainsOnlyDigits(mobile) && mobile.Length != 10 && pincode.Length != 6 && !logics.ContainsOnlyDigits(pincode)) { ViewBag.ErrorMsg = "Mobile or Pincode invalid "; } else if (!logics.ValidEmail(email)) { ViewBag.ErrorMsg = "Invalid Email provided"; } else { if (!logics.ContainsOnlyAlphabets(first_name) && !logics.ContainsOnlyAlphabets(last_name)) { ViewBag.ErrorMsg = "First name and Last name is invalid"; } else { if (password.Length < 6) { ViewBag.ErrorMsg = "Password length must be of minimum 6"; } else { if (password != con_password) { ViewBag.ErrorMsg = "Password and Confirm paswword field must contain same value"; } else { //Formatting Address string Address = "AddressLine1: " + address1 + ", AddressLine2: " + address2 + ", Pin: " + pincode; var account = businessLogics.SignUp(first_name, last_name, email, mobile, Address, password); /* 0 = duplicate record found * 1 = Operation done successfully * 2 = Account creation failed * 3 = Account removal failed and user details could not be created * 4 = Account deleted parmanantly */ if (account == 1) { return(RedirectToAction("Login", "Authentication")); } else if (account == 2 || account == 3 || account == 4) { ViewBag.ErrorMsg = "Internal server error occured. Couldn't create your account"; } else if (account == 0) { ViewBag.ErrorMsg = "An account already exists with same email."; } } } } } } return(View()); }
public ActionResult EditOnlyEp(Guid epId, string epName, string totalTrack) { ViewBag.Title = "Edit Ep"; logics = new GeneralLogics(); businessLogics = new BusinessLogics(); List <string> inputStrings = new List <string> { epName, totalTrack }; //string userEmail = Session["LoginEmail"].ToString(); string userEmail = "*****@*****.**"; if (userEmail != null) { if (!logics.ContainsAnyNullorWhiteSpace(inputStrings)) { if (logics.ContainsOnlyDigits(totalTrack)) { if (Convert.ToInt32(totalTrack) > 7) { TempData["ErrorMsg"] = "An Ep can be created with 7 or less amount of tracks"; //ViewBag.ErrorMsg = "An Ep can be created with 7 or less amount of tracks"; } else { var result = businessLogics.EditEp(epId, epName, Convert.ToInt32(totalTrack)); if (result == 0) { ViewBag.ErrorMsg = "No Account is associated with the email address from which user is trying to modify the Ep."; } if (result == 1) { return(RedirectToAction("Index", "UserProfile")); } if (result == 2) { ViewBag.ErrorMsg = "No purchase left to create an music Ep"; } if (result == 3 || result == 4) { ViewBag.ErrorMsg = "Internal error occured while creating the Ep"; } } } else { TempData["ErrorMsg"] = "Track number field must contains only number. Invalid input given"; //ViewBag.ErrorMsg = "Track number field must contains only number. Invalid input given"; } } else { TempData["ErrorMsg"] = "No fields should be left empty"; //ViewBag.ErrorMsg = "No fields should be left empty"; } } else { return(RedirectToAction("Logout", "Authentication")); } return(RedirectToAction("EditOnlyEp", new { epID = epId })); }