public ActionResult ViewMessageSentPateint() { int memid = Convert.ToInt32(Session["MemberId"]); using (ProjectEntities1 im = new ProjectEntities1()) { var gdata2 = im.MemberLogins.FirstOrDefault(a => a.MemberId == memid); var gdata = im.Inboxes.ToList().Where(a => a.FromEmailId == gdata2.EmailId); //var gdata3 = im.Inboxes.ToList().Where(a => a.ToEmailId == gdata2.EmailId); //int //var getPateint=im.Patients.FirstOrDefault List <InboxModel> lst = new List <InboxModel>(); foreach (var item in gdata) { string docmail = item.ToEmailId; var getdoc = im.MemberLogins.FirstOrDefault(a => a.EmailId == docmail); var doc_get = im.Doctors.FirstOrDefault(a => a.MemberId == getdoc.MemberId); string docname = doc_get.FirstName + " " + doc_get.LastName; lst.Add(new InboxModel { DoctorName = docname, MessageId = item.MessageId, Subject = item.Subject, MessageDetail = item.MessageDetail, MessageDate = item.MessageDate }); } InboxModel inboxViewModel = new InboxModel(); inboxViewModel.doctorlist = lst; return(View(inboxViewModel)); } }
private void InboxList_ItemTapped(object sender, ItemTappedEventArgs e) { modeler = e.Item as InboxModel; Messaging chatForm = new Messaging(modeler.user_id, modeler.session_id, modeler.username, modeler.image, modeler.emoji); Navigation.PushModalAsync(chatForm); }
public async Task <ActionResult <InboxModel> > PostInboxModel(InboxModel InboxModel) { _context.InboxModel.Add(InboxModel); await _context.SaveChangesAsync(); return(CreatedAtAction("GetInboxModel", new { id = InboxModel.IdInbox }, InboxModel)); }
public ActionResult PostSendMsgPateint(InboxModel inboxModel) { CommonData model = new CommonData(); if (!ModelState.IsValid) { inboxModel.doclst2 = model.DoctorApp(); return(View("SendMsgPateint", model)); } int memid = Convert.ToInt32(Session["MemberId"]); MemberModel memberModel = new MemberModel(); inboxModel.doclst2 = model.DoctorApp(); using (ProjectEntities1 db = new ProjectEntities1()) { var getdata = db.Doctors.FirstOrDefault(a => a.DoctorId == inboxModel.DoctorId); int mem = getdata.MemberId; var getdata2 = db.MemberLogins.FirstOrDefault(a => a.MemberId == mem); string ToEmail = getdata2.EmailId; /*var getdata3 = db.Patients.FirstOrDefault(a => a.MemberId == memid); * int mem2 = getdata3.MemberId;*/ var getdata4 = db.MemberLogins.FirstOrDefault(a => a.MemberId == memid); inboxModel.MessageDate = DateTime.Now; inboxModel.FromEmailId = getdata4.EmailId; int replyid = 0; string isRead = "false"; db.InsertMessagePat(inboxModel.FromEmailId, ToEmail, inboxModel.Subject, inboxModel.MessageDetail, inboxModel.MessageDate, replyid, isRead); } ViewBag.message = "Message Sent !"; return(View("SendMsgPateint", inboxModel)); }
public async Task <IActionResult> PutInboxModel(int id, InboxModel InboxModel) { if (id != InboxModel.IdInbox) { return(BadRequest()); } _context.Entry(InboxModel).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!InboxModelExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public ActionResult ViewMessageDoc() { int memid = Convert.ToInt32(Session["MemberId"]); using (ProjectEntities1 im = new ProjectEntities1()) { var gdata2 = im.MemberLogins.FirstOrDefault(a => a.MemberId == memid); var gdata = im.Inboxes.ToList().Where(a => a.ToEmailId == gdata2.EmailId); // var member = im.MemberLogins.ToList(); var inb = im.Inboxes.ToList(); List <InboxModel> lst = new List <InboxModel>(); foreach (var item in gdata) { string fromEmail = item.FromEmailId; var getemail = im.MemberLogins.FirstOrDefault(a => a.EmailId == fromEmail); var getpateint = im.Patients.FirstOrDefault(a => a.MemberId == getemail.MemberId); string Pateint_Name = getpateint.FirstName + getpateint.LastName; lst.Add(new InboxModel { MessageId = item.MessageId, PateintName = Pateint_Name, Subject = item.Subject, MessageDetail = item.MessageDetail, MessageDate = item.MessageDate }); } InboxModel inboxViewModel = new InboxModel(); inboxViewModel.doctorlist = lst; return(View(inboxViewModel)); } }
public ActionResult SendMsgPateint() { CommonData model = new CommonData(); InboxModel m = new InboxModel(); m.doclst2 = model.DoctorApp(); return(View(m)); }
public PartialViewResult ArchiMessageDetail(int RequestId) { var model = new InboxModel().GetMessageDetailByDetailId(RequestId, User.Identity.GetUserId()); ViewBag.alllisting = new ProviderListingModel().GetAllListing(); ViewBag.msgType = "ProviderArchive"; return(PartialView("_MessageDetailPartial", model.OrderByDescending(d => d.Id).ToList())); }
public void BindDetailGridview() { if (!IsPostBack) { dtbl = InboxModel.GetInboxDetailList(new Guid(Session["CurrentWarehouse"].ToString()), StepID, TypeID); } grvDetail.DataSource = dtbl; grvDetail.DataBind(); }
public async Task <InboxModel> GetInboxAsync(string token) { var uri = new Uri(string.Format(Constants.RestUrl + "/api/inbox", string.Empty)); string authToken = Preferences.Get("api_key", "null");; InboxModel response = await _requestService.GetAsync <InboxModel>(uri.ToString(), authToken); return(response); }
public void BindDetailGridview() { if (((bool)ViewState["firsTime"])) { DataTable dt = InboxModel.GetInboxDetailList(new Guid(Session["CurrentWarehouse"].ToString()), StepID, TypeID); ViewState.Add("dtbl", dt); } grvDetail.DataSource = dtbl; grvDetail.DataBind(); }
public bool SaveCustomeMessage(InboxModel message) { message.IsActive = true; message.IsArchive = false; message.IsProviderArchive = false; message.IsRead = false; message.IsStarred = false; message.SentDate = DateTime.Now; new InboxModel().SaveCustomeMessage(message); return(true); }
public InboxPage() { InitializeComponent(); BindingContext = model = new InboxModel(); ListaStack.IsVisible = true; // Set(); goBack.Source = ImageSource.FromResource("exploreMostar.Mobile.Resources.Left-Arrow-84.png"); goBack.WidthRequest = 20; goBack.HeightRequest = 20; }
private void saveToLocalDb(InboxModel model) { string applicationFolderPath = System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData), "databaseFolder"); System.IO.Directory.CreateDirectory(applicationFolderPath); string databaseFileName = System.IO.Path.Combine(applicationFolderPath, "amera.db"); using (SQLiteConnection conn = new SQLiteConnection(databaseFileName)) { conn.CreateTable <InboxModel>(); conn.InsertOrReplace(model); } }
/// <summary> /// This action returns list of user messages as per status /// </summary> /// <param name="status">status</param> /// <returns></returns> public ActionResult GetUserMessages(string status) { try { if (SessionManagement.UserInfo != null) { var lstMessages = new List <InboxModel>(); LoginInformation loginInfo = SessionManagement.UserInfo; var sortColName = System.Web.HttpContext.Current.Request["sidx"]; var sortOrder = System.Web.HttpContext.Current.Request["sord"]; //Get all messages of user as per status var userMsgs = intUsrMsgBO.GetUserMessages(loginInfo.UserID, status, sortColName, sortOrder); foreach (var msg in userMsgs) { var userMsg = new InboxModel(); userMsg.PK_MessageID = msg.PK_MessageID; userMsg.MessageSubject = msg.MessageSubject; userMsg.MessageBody = msg.MessageContent; userMsg.Timestamp = Convert.ToDateTime(msg.Timestamp).ToString("dd/MM/yyyy HH:mm:ss tt"); userMsg.FromUserName = msg.FromUserName; userMsg.IsRead = (bool)msg.IsRead; userMsg.LongDateString = Convert.ToDateTime(msg.Timestamp).ToLongDateString() + " " + Convert.ToDateTime(msg.Timestamp).ToLongTimeString(); userMsg.MessageTime = (DateTime)msg.Timestamp; lstMessages.Add(userMsg); } return(Json(new { total = 1, page = 1, records = lstMessages.Count, rows = lstMessages }, JsonRequestBehavior.AllowGet)); } else { return(RedirectToAction("Login", "Account")); } } catch (Exception ex) { CurrentDeskLog.Error(ex.Message, ex); return(View("ErrorMessage")); } }
public static InboxModel Map(Dto <iAFWebHost.Entities.Email> dto) { InboxModel model = new InboxModel(); model.Emails = dto.Entities; model.Pager.Page = dto.Page; model.Pager.PageSize = dto.PageSize; model.Pager.TotalRows = dto.TotalRows; model.Pager.PreviousKey = dto.SKey; model.Pager.PreviousKeyId = dto.SId; model.Pager.NextKey = dto.EKey; model.Pager.NextKeyId = dto.EId; model.TotalEmails = dto.TotalRows; return(model); }
public void BindDetailGridview() { if (((bool)ViewState["firsTime"])) { DataTable dt = InboxModel.GetInboxDetailList(new Guid(Session["CurrentWarehouse"].ToString()), StepID, TypeID); ViewState.Add("dtbl", dt); } grvDetail.DataSource = dtbl; grvDetail.DataBind(); ////// Make Close Button Available for Arrival Only ////if (StepID == 1) //// grvDetail.Columns[4].Visible = true; ////else //// grvDetail.Columns[4].Visible = false; }
public ActionResult PostViewMessageDoc(InboxModel model) { using (ProjectEntities1 im = new ProjectEntities1()) { int memid = Convert.ToInt32(Session["MemberId"]); var gdata = im.MemberLogins.FirstOrDefault(a => a.MemberId == memid); string FromEmail = gdata.EmailId; var gdata2 = im.Inboxes.FirstOrDefault(a => a.MessageId == model.MessageId); string ToEmail = gdata2.FromEmailId; string IsRead = "True"; im.UpdateIsRead(gdata2.MessageId, IsRead); im.InsertMessagePat(FromEmail, ToEmail, model.Subject, model.MessageDetail, DateTime.Now, model.MessageId, IsRead); return(Json("Inserted")); } }
public async Task <IActionResult> GetInboxData(InboxModel Inbox) { try { var ib = await postRepository.GetInboxData(Inbox); if (ib == null) { return(NotFound()); } return(Ok(ib)); } catch (Exception) { return(BadRequest()); } }
public ActionResult CatchAll() { InboxModel model = new InboxModel(); var mailbox = emailService.GetAll(0, 100, 0); if (mailbox != null) { model.RecepientEmail = mailbox.RecepientEmail; model.MailboxId = mailbox.Id; model.Emails = mailbox.Emails; model.TotalEmails = mailbox.TotalEmails; return(View("Inbox", model)); } else { return(View("MailboxNotFound", model)); } }
public bool Contactus(ContactUsModel _ContactUsModel) { _ContactUsModel.AppointmentDate = Convert.ToDateTime(_ContactUsModel.AppointmentDate); var userid = User.Identity.GetUserId(); var message = new InboxModel() { IsActive = true, IsArchive = false, IsProviderArchive = false, IsRead = false, IsStarred = false, MessageBody = _ContactUsModel.CustomeMessageBody, RecipientId = _ContactUsModel.ProviderUserId, SenderId = userid, SentDate = DateTime.Now, Subject = "Consumer wants your Services", }; if (_ContactUsModel.IsCall == true) { message.MessageBody = " Please call me with more information <br/>" + message.MessageBody; } var ContactUsid = _ContactUsModel.addContactUsForm(_ContactUsModel); message.ContactUsId = ContactUsid; new InboxModel().SaveCustomeMessage(message); if (_ContactUsModel.AppointmentSchedule == true) { var ProviderEmail = new ProviderListingModel().GetListingByListingId(_ContactUsModel.ProviderListingId).PrimaryEmail; SerdEmail(ProviderEmail, _ContactUsModel); //create appointment var model = new AppointmentModel(); model.BestTime = _ContactUsModel.AppointmentTime; model.ConsumerId = userid; model.CreatedBy = userid; model.CreatedDate = DateTime.Now; model.ProviderId = _ContactUsModel.ProviderUserId; model.ServiceDate = _ContactUsModel.AppointmentDate; model.ContactUsId = ContactUsid; model.SubmitAppointment(model, "Consumer"); } return(true); }
protected void btnClose_Click(object sender, EventArgs e) { try { if (StepID > 1) { ViewState["ArrivalID"] = Id; } InboxModel.Close_WorkflowModified(WorkFlowID, UserBLL.CurrentUser.UserId, DateTime.Now, ArrivalID, txtReason.Text, StepID); Messages1.SetMessage("Closed successfully.", Messages.MessageType.Success); // btnClose.Visible = false; } catch (Exception ex) { Messages1.SetMessage(ex.Message, Messages.MessageType.Error); } btnNext.Visible = true; }
async public void GetInbox() { IsLoading = true; try { InboxModel inbox = await _service.GetInboxAsync("test"); Conversations = new ObservableCollection <ConversationModel>(inbox.Converations); } catch (System.OperationCanceledException ex) { Console.WriteLine($"Text load cancelled: {ex.Message}"); } catch (Exception ex) { Console.WriteLine(ex.Message); } IsLoading = false; }
public PartialViewResult GetCustomMessageDetail(int ConversationId) { var model = new InboxModel().GetMessageDetailByConversationId(ConversationId, User.Identity.GetUserId()); if (User.IsInRole("Provider")) { model = model.Where(s => s.IsProviderArchive != true).ToList(); } if (User.IsInRole("Admin")) { model = model.Where(s => s.isAdminArchive != true).ToList(); } if (User.IsInRole("Consumer")) { model = model.Where(s => s.IsArchive != true).ToList(); } ViewBag.alllisting = new ProviderListingModel().GetAllListing(); ViewBag.msgType = "all"; return(PartialView("_CustomeMessageDetail", model.OrderByDescending(d => d.Id).ToList())); }
private string getDistance(InboxModel model) { var userModel = sqliteManager.getUserModel(); string[] currentLocArr = userModel.location.Split(','); string[] otherUserLocArr = model.location.Split(','); Location myLocation = new Location(Convert.ToDouble(currentLocArr[0]), Convert.ToDouble(currentLocArr[1])); Location otherLocation = new Location(Convert.ToDouble(otherUserLocArr[0]), Convert.ToDouble(otherUserLocArr[1])); double kmDistance; if (userSearchReference.distance_metric == 0) { kmDistance = Location.CalculateDistance(myLocation, otherLocation, DistanceUnits.Kilometers); } else { kmDistance = Location.CalculateDistance(myLocation, otherLocation, DistanceUnits.Miles); } return(Math.Round(kmDistance, 2).ToString()); }
public bool UpdateAchieveStatus(int RequestId) { var userIdentity = (ClaimsIdentity)User.Identity; var claims = userIdentity.Claims; var roleClaimType = userIdentity.RoleClaimType; var roles = claims.Where(c => c.Type == ClaimTypes.Role).ToList(); var model = false; if (roles[0].Value == "Consumer") { model = new InboxModel().UpdateAchieveStatus(RequestId); model = true; } if (roles[0].Value == "Provider") { model = new InboxModel().UpdateAchieveStatusByProvider(RequestId); model = false; } return(model); }
public InboxModel GetInboxModel(string id) { PageHelper pageHelper = ParsePageHelper(); Dto <Email> dto = emailService.GetInboxEmails(id, pageHelper.Page, pageHelper.PageSize, pageHelper.Skip, pageHelper.NextKey, null, pageHelper.NextKeyId, null, pageHelper.Sort); InboxModel model = Mapper.Map(dto); var mailbox = emailService.GetInfo(id); if (mailbox != null) { model.RecepientEmail = mailbox.RecepientEmail; model.MailboxId = mailbox.Id; } else { if (!String.IsNullOrEmpty(Request["email"])) { model.RecepientEmail = Request["email"]; } } return(model); }
public void InboxData() { List <InboxModel> reservationList = new List <InboxModel>(); HttpClient client = new HttpClient(); string url = "https://localhost:44334/api/LogReceives/GetInboxData"; var inbox = new InboxModel(); inbox.User_ID = Convert.ToInt64(Session["User_ID"]); var json = JsonConvert.SerializeObject(inbox); var data = new StringContent(json, Encoding.UTF8, "application/json"); var response = client.PostAsync(url, data).Result; string result = response.Content.ReadAsStringAsync().Result; reservationList = JsonConvert.DeserializeObject <List <InboxModel> >(result); GridView1.DataSource = reservationList; GridView1.DataBind(); }
public ActionResult Inbox(string id) { if (!String.IsNullOrEmpty(id)) { InboxModel model = GetInboxModel(id); if (!String.IsNullOrEmpty(model.MailboxId)) { return(View(model)); } else { if (!String.IsNullOrEmpty(Request["email"])) { model.RecepientEmail = Request["email"]; } return(View("MailboxNotFound", model)); } } else { return(RedirectToAction("Index")); } }
public ActionResult ReadMail(int MailID) { if ((Session["userID"]) == null) { return(RedirectToAction("Index", "Login")); } InboxModel model = new InboxModel(); var i = db.Messages.Where(m => m.Message_ID == MailID).FirstOrDefault(); var me = db.Mails.Where(m => m.Mail_ID == i.Mail_ID).FirstOrDefault(); me.Status = 0; db.SaveChanges(); model.MailID = i.Message_ID.ToString(); model.MailName = i.Name; model.MailDetail = i.Detail; model.Image = i.AttachFile; model.AttachShow1 = i.AttachShow1; var u = db.Users.Where(m => m.User_ID == i.SendTo).FirstOrDefault(); model.SendTo = u.User_Name; model.CreateBy = i.CreateBy; return(View(model)); }