public static void Run([TimerTrigger("0 * * * * *")] TimerInfo myTimer, ILogger log) { TableManager BManagerObj = new TableManager("ChiragInfo"); List <ChiragInfo> SutdentListObj = BManagerObj.employees(); ChiragInfo StudentObj = SutdentListObj.FirstOrDefault(); foreach (var singleData in SutdentListObj) { log.LogInformation(singleData.RowKey + " " + singleData.PartitionKey + " " + $"{ DateTime.Now}"); } string EmailID = "*****@*****.**"; Console.WriteLine("Email Sent To:" + EmailID + "at:" + DateTime.Now); //0 0 0 * * * }
public ChiragInfo InsertOrMergeEntity(ChiragInfo entity) { if (entity == null) { throw new ArgumentNullException("entity"); } try { TableOperation insertOrMergeOperation = TableOperation.InsertOrMerge(entity); TableResult result = EmployeeTable.Execute(insertOrMergeOperation); ChiragInfo insertedCustomer = result.Result as ChiragInfo; return(insertedCustomer); } catch (StorageException StorageExceptionObj) { throw StorageExceptionObj; } }
public ActionResult Index(FormCollection collection, HttpPostedFileBase file) { foreach (string files in Request.Files) { file = Request.Files[files]; } string Firstname = collection[Constants.FirstName]; string LastName = collection[Constants.LastName]; string Address = collection[Constants.Address]; if (!String.IsNullOrEmpty(Firstname) && !String.IsNullOrEmpty(LastName)) { BlobManager blobManager = new BlobManager(Constants.ContainerName); string FileAbsoluteUri = blobManager.UploadFile(file); ChiragInfo employee = new ChiragInfo(Firstname, LastName); employee.Email = collection[Constants.Email]; employee.Number = collection[Constants.PhoneNumber]; employee.Address = Address; employee.ResumeUrl = FileAbsoluteUri; TableManager tableManager = new TableManager(Constants.TableName); ChiragInfo emp = tableManager.InsertOrMergeEntity(employee); if (emp == null) { ViewBag.TableError = Constants.TableError; return(View()); } if (String.IsNullOrEmpty(FileAbsoluteUri)) { ViewBag.BlobError = Constants.BlobError; return(View()); } TempData["SuccessMsg"] = "Details of " + emp.PartitionKey + " " + emp.RowKey + " Uploaded Successfully"; return(RedirectToAction("GetMyData")); } ViewBag.RequiredError = Constants.RequiredError; return(View()); }