Пример #1
0
        public ActionResult attention(Attention atten, int ToUID)
        {
            int UID = Convert.ToInt32(Session["UID"].ToString());

            if (UID == ToUID)
            {
                return(Content("<script>;alert('不能关注自己哦!');history.go(-1)</script>"));
            }
            var chk_member = db.Attention.Where(o => o.UID == UID).Where(o => o.ToUID == ToUID).FirstOrDefault();

            ViewBag.attentionde = chk_member;

            if (chk_member != null)
            {
                Attention attention = db.Attention.Remove(chk_member);
                db.SaveChanges();
                return(Content("<script>;alert('取消关注成功!');history.go(-1)</script>"));
            }
            atten.ToUID = Convert.ToInt32(ToUID);
            atten.UID   = Convert.ToInt32(Session["UID"].ToString());

            atten.Att_Time = DateTime.Now;
            db.Attention.Add(atten);
            db.SaveChanges();

            return(Content("<script>;alert('关注成功!');history.go(-1)</script>"));
        }
Пример #2
0
 private void LoadExtensions()
 {
     this.version                = this.im.LoadExtension <SoftwareVersion>();
     this.sdisco                 = this.im.LoadExtension <ServiceDiscovery>();
     this.ecapa                  = this.im.LoadExtension <EntityCapabilities>();
     this.ping                   = this.im.LoadExtension <S22.Xmpp.Extensions.Ping>();
     this.attention              = this.im.LoadExtension <Attention>();
     this.time                   = this.im.LoadExtension <EntityTime>();
     this.block                  = this.im.LoadExtension <BlockingCommand>();
     this.pep                    = this.im.LoadExtension <Pep>();
     this.userTune               = this.im.LoadExtension <UserTune>();
     this.userAvatar             = this.im.LoadExtension <UserAvatar>();
     this.userMood               = this.im.LoadExtension <UserMood>();
     this.dataForms              = this.im.LoadExtension <DataForms>();
     this.featureNegotiation     = this.im.LoadExtension <FeatureNegotiation>();
     this.streamInitiation       = this.im.LoadExtension <StreamInitiation>();
     this.siFileTransfer         = this.im.LoadExtension <SIFileTransfer>();
     this.inBandBytestreams      = this.im.LoadExtension <InBandBytestreams>();
     this.userActivity           = this.im.LoadExtension <UserActivity>();
     this.socks5Bytestreams      = this.im.LoadExtension <Socks5Bytestreams>();
     this.FileTransferSettings   = new S22.Xmpp.Client.FileTransferSettings(this.socks5Bytestreams, this.siFileTransfer);
     this.serverIpCheck          = this.im.LoadExtension <ServerIpCheck>();
     this.inBandRegistration     = this.im.LoadExtension <InBandRegistration>();
     this.chatStateNotifications = this.im.LoadExtension <ChatStateNotifications>();
     this.bitsOfBinary           = this.im.LoadExtension <BitsOfBinary>();
 }
Пример #3
0
        public async Task <IHttpActionResult> PostAttention(Attention attention)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Attentions.Add(attention);

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (AttentionExists(attention.StudentId))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = attention.StudentId }, attention));
        }
Пример #4
0
        public async Task <IHttpActionResult> PutAttention(int id, Attention attention)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != attention.StudentId)
            {
                return(BadRequest());
            }

            db.Entry(attention).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!AttentionExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Пример #5
0
        public int DelCol(int homeId, int userId)
        {
            Attention attention = attBll.Show().Where(c => c.Attention_Infoids == homeId && c.Attention_Uid == userId).FirstOrDefault();
            int       id        = attention.Attention_Id;

            return(attBll.Delete(id));
        }
Пример #6
0
        public ActionResult Delete_Att(int?id)
        {
            Attention atten = db.Attention.Find(id);

            db.Attention.Remove(atten);
            db.SaveChanges();
            return(RedirectToAction("focus"));
        }
Пример #7
0
        public ActionResult DeleteConfirmed(int id)
        {
            Attention attention = db.Attentions.Find(id);

            db.Attentions.Remove(attention);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #8
0
        public Attention GetAttention(long Id)
        {
            Attention AttentionInfo = context.Attention.FindBy((Attention item) => item.Id == Id).FirstOrDefault();
            ShopInfo  shopInfo      = context.ShopInfo.FirstOrDefault((ShopInfo m) => m.Id.Equals(AttentionInfo.ShopId));

            if (shopInfo != null)
            {
                AttentionInfo.CompanyName = shopInfo.ShopName;
            }
            UserMemberInfo UserInfo = context.UserMemberInfo.FirstOrDefault((UserMemberInfo m) => m.Id.Equals(AttentionInfo.UserId) && m.UserType == 3);

            if (UserInfo != null)
            {
                AttentionInfo.UserName = UserInfo.UserName;
            }
            ProductInfo productInfo = context.ProductInfo.FirstOrDefault((ProductInfo m) => m.Id.Equals(AttentionInfo.ProductId));

            if (productInfo != null)
            {
                AttentionInfo.ProductName         = (productInfo == null ? "" : productInfo.ProductName);
                AttentionInfo.ImagePath           = (productInfo == null ? "" : productInfo.ImagePath);
                AttentionInfo.MarketPrice         = productInfo.MarketPrice;
                AttentionInfo.MinSalePrice        = productInfo.MinSalePrice;
                AttentionInfo.MeasureUnit         = productInfo.MeasureUnit;
                AttentionInfo.EProductName        = productInfo.EProductName;
                AttentionInfo.Purity              = productInfo.Purity;
                AttentionInfo.CASNo               = productInfo.CASNo;
                AttentionInfo.HSCODE              = productInfo.HSCODE;
                AttentionInfo.DangerLevel         = productInfo.DangerLevel;
                AttentionInfo.MolecularFormula    = productInfo.MolecularFormula;
                AttentionInfo.MolecularWeight     = productInfo.MolecularWeight;
                AttentionInfo.PASNo               = productInfo.PASNo;
                AttentionInfo.LogP                = productInfo.LogP;
                AttentionInfo.Shape               = productInfo.Shape;
                AttentionInfo.Density             = productInfo.Density;
                AttentionInfo.FusingPoint         = productInfo.FusingPoint;
                AttentionInfo.BoilingPoint        = productInfo.BoilingPoint;
                AttentionInfo.RefractiveIndex     = productInfo.RefractiveIndex;
                AttentionInfo.StorageConditions   = productInfo.StorageConditions;
                AttentionInfo.VapourPressure      = productInfo.VapourPressure;
                AttentionInfo.PackagingLevel      = productInfo.PackagingLevel;
                AttentionInfo.SafetyInstructions  = productInfo.SafetyInstructions;
                AttentionInfo.DangerousMark       = productInfo.DangerousMark;
                AttentionInfo.RiskCategoryCode    = productInfo.RiskCategoryCode;
                AttentionInfo.TransportationNmber = productInfo.TransportationNmber;
                AttentionInfo.RETCS               = productInfo.RETCS;
                AttentionInfo.WGKGermany          = productInfo.WGKGermany;
                AttentionInfo.SyntheticRoute      = productInfo.SyntheticRoute;
                AttentionInfo.RelatedProducts     = productInfo.RelatedProducts;
                AttentionInfo.MSDS                = productInfo.MSDS;
                AttentionInfo.NMRSpectrum         = productInfo.NMRSpectrum;
                AttentionInfo.RefuseReason        = productInfo.RefuseReason;
                AttentionInfo.STRUCTURE_2D        = productInfo.STRUCTURE_2D;
            }
            return(AttentionInfo);
        }
Пример #9
0
        static void Main()
        {
            Student   student   = new Student("Yuchen", 90, State.inschool);
            Attention attention = new Attention(student.AttentionFunc);
            Operation operation = new Operation();

            operation.Reminder += attention;
            operation.Reminder += student.AddScore;
            operation.Show(90);
        }
Пример #10
0
        public int InsCol(int userId, int homeId)
        {
            Attention attention = new Attention()
            {
                Attention_Uid     = userId,
                Attention_Infoids = homeId
            };

            return(attBll.Create(attention));
        }
        static void Main()
        {
            Student   student   = new Student("Yuchen", 90, State.inschool);
            Attention attention = new Attention(student.AddScore);

            attention += student.AttentionFunc;
            attention(100);
            attention(80);
            student.ShowScores();
        }
Пример #12
0
 /// <summary>
 ///   Serves as the default hash function.
 /// </summary>
 /// <returns>A hash code for the current object.</returns>
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = StringComparer.OrdinalIgnoreCase.GetHashCode(FileColumn);
         hashCode = (hashCode * 397) ^ StringComparer.OrdinalIgnoreCase.GetHashCode(TemplateField);
         hashCode = (hashCode * 397) ^ Update.GetHashCode();
         hashCode = (hashCode * 397) ^ Attention.GetHashCode();
         return(hashCode);
     }
 }
Пример #13
0
        public async Task <IHttpActionResult> GetAttention(int id)
        {
            Attention attention = await db.Attentions.FindAsync(id);

            if (attention == null)
            {
                return(NotFound());
            }

            return(Ok(attention));
        }
Пример #14
0
        public int ExistsCol(int homeId, int userId)
        {
            Attention attention = attBll.Show().Where(c => c.Attention_Uid == userId && c.Attention_Infoids == homeId).FirstOrDefault();

            if (attention is null)
            {
                return(0);
            }
            else
            {
                return(1);
            }
        }
        protected override void Execute(CodeActivityContext context)
        {
            // TODO: VALIDATE ENTITY OR THROW EXCEPTION


            Workflows.UserInteractions.Request.SendCorrespondenceRequest request = new UserInteractions.Request.SendCorrespondenceRequest(

                Entity.Get(context),

                RelatedEntity.Get(context),

                WorkflowManager.Get(context).Application.CorrespondenceGetIdByName(CorrespondenceName.Get(context)),


                AllowUserSelection.Get(context),

                AllowAlternateAddress.Get(context)

                );



            request.AllowCancel = AllowCancel.Get(context);

            request.Attention = Attention.Get(context);

            request.AllowEditRelatedEntity = AllowEditRelatedEntity.Get(context);

            request.AllowHistoricalSendDate = AllowHistoricalSendDate.Get(context);

            request.AllowFutureSendDate = AllowFutureSendDate.Get(context);

            request.AllowSendByFacsimile = AllowSendByFacsimile.Get(context);

            request.AllowSendByEmail = AllowSendByEmail.Get(context);

            request.AllowSendByInPerson = AllowSendByInPerson.Get(context);

            request.SendDate = SendDate.Get(context);

            request.AlternateAddress = AlternateAddress.Get(context);

            request.AlternateFaxNumber = AlternateFaxNumber.Get(context);

            request.AlternateEmail = AlternateEmail.Get(context);


            UserInteractionRequest.Set(context, request);

            return;
        }
Пример #16
0
        public async Task <IHttpActionResult> DeleteAttention(int id)
        {
            Attention attention = await db.Attentions.FindAsync(id);

            if (attention == null)
            {
                return(NotFound());
            }

            db.Attentions.Remove(attention);
            await db.SaveChangesAsync();

            return(Ok(attention));
        }
Пример #17
0
 public bool Create(Attention attention)
 {
     try
     {
         _context.Add(attention);
         _context.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         Console.Write(e.StackTrace);
         return(false);
     }
 }
Пример #18
0
        // GET: Attentions/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Attention attention = db.Attentions.Find(id);

            if (attention == null)
            {
                return(HttpNotFound());
            }
            return(View(attention));
        }
Пример #19
0
    public void Initialize(ActorStack stack, HashSet <Topic> newTopics, HashSet <Thought> newThoughts)
    {
        myStack = stack;
        myStack.conversation.OnSpeech      += Route;
        myStack.conversation.OnInteraction += Route;

        attention = Instantiate(attentionObject, transform).GetComponent <Attention>();
        attention.Initialize(this);
        thoughts = Instantiate(thoughtsObject, transform).GetComponent <Thoughts>();
        thoughts.Initialize(this);
        observer = Instantiate(observerObject, transform).GetComponent <Observer>();
        observer.Initialize(this);

        attention.Load(newTopics);
        thoughts.Load(newThoughts);
    }
Пример #20
0
        /// <summary>
        /// 取消关注
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public bool DeleteAttention(long Id)
        {
            Attention AttentionInfo = context.Attention.FindBy((Attention item) => item.Id == Id).FirstOrDefault();

            context.Attention.Remove(AttentionInfo);
            int i = context.SaveChanges();

            if (i > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #21
0
        public string AddAttention(Attention attention, int buserid)
        {
            var userid = Convert.ToInt32(Session["User_id"]);
            var sdesdw = AttentionManage.selecatten(userid, buserid);

            if (sdesdw == null)
            {
                attention.User_id  = userid;
                attention.BUser_id = buserid;
                AttentionManage.Addatten(attention);
                return("success");
            }
            else
            {
                return("fail");
            }
        }
Пример #22
0
 public AttentionModel(Attention m)
     : this()
 {
     Id                  = m.Id;
     UserId              = m.UserId;
     ShopId              = m.ShopId;
     ProductId           = m.ProductId;
     CreatDate           = m.CreatDate;
     ProductName         = m.ProductName;
     ImagePath           = m.ImagePath;
     MarketPrice         = m.MarketPrice;
     MinSalePrice        = m.MinSalePrice;
     MeasureUnit         = m.MeasureUnit;
     EProductName        = m.EProductName;
     Purity              = m.Purity;
     CASNo               = m.CASNo;
     HSCODE              = m.HSCODE;
     DangerLevel         = m.DangerLevel;
     MolecularFormula    = m.MolecularFormula;
     MolecularWeight     = m.MolecularWeight;
     PASNo               = m.PASNo;
     LogP                = m.LogP;
     Shape               = m.Shape;
     Density             = m.Density;
     FusingPoint         = m.FusingPoint;
     BoilingPoint        = m.BoilingPoint;
     RefractiveIndex     = m.RefractiveIndex;
     StorageConditions   = m.StorageConditions;
     VapourPressure      = m.VapourPressure;
     PackagingLevel      = m.PackagingLevel;
     SafetyInstructions  = m.SafetyInstructions;
     DangerousMark       = m.DangerousMark;
     RiskCategoryCode    = m.RiskCategoryCode;
     TransportationNmber = m.TransportationNmber;
     RETCS               = m.RETCS;
     WGKGermany          = m.WGKGermany;
     SyntheticRoute      = m.SyntheticRoute;
     RelatedProducts     = m.RelatedProducts;
     MSDS                = m.MSDS;
     NMRSpectrum         = m.NMRSpectrum;
     RefuseReason        = m.RefuseReason;
     STRUCTURE_2D        = m.STRUCTURE_2D;
     UserName            = m.UserName;
     CompanyName         = m.CompanyName;
     ProductCode         = m.ProductCode;
 }
        public int AttentionSubmit(int goalid, string attentionuser)
        {
            List <Attention> list = new List <Attention>();
            var str = attentionuser.Remove(attentionuser.Length - 1).Split(',');

            for (int i = 0; i < str.Length; i++)
            {
                Attention attention = new Attention();
                attention.UserId              = Convert.ToInt32(str[i]);
                attention.GoalId              = goalid;
                attention.AttentionIsUse      = 1;
                attention.AttentionCreateTime = Convert.ToDateTime(DateTime.Now.ToString("yyyy MM dd"));
                list.Add(attention);
            }
            var j = HelperHttpClient.GetAll("post", "GoalManage/AddAttentionUser", list);  //添加成功返回自增长id

            return(Convert.ToInt32(j));
        }
Пример #24
0
        /// <inheritdoc/>
        public string ToDelimitedString()
        {
            CultureInfo culture = CultureInfo.CurrentCulture;

            return(string.Format(
                       culture,
                       StringHelper.StringFormatSequence(0, 31, Configuration.FieldSeparator),
                       Id,
                       ProviderInvoiceNumber?.ToDelimitedString(),
                       PayerInvoiceNumber?.ToDelimitedString(),
                       ContractAgreementNumber?.ToDelimitedString(),
                       InvoiceControl?.ToDelimitedString(),
                       InvoiceReason?.ToDelimitedString(),
                       InvoiceType?.ToDelimitedString(),
                       InvoiceDateTime.HasValue ? InvoiceDateTime.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null,
                       InvoiceAmount?.ToDelimitedString(),
                       PaymentTerms,
                       ProviderOrganization?.ToDelimitedString(),
                       PayerOrganization?.ToDelimitedString(),
                       Attention?.ToDelimitedString(),
                       LastInvoiceIndicator,
                       InvoiceBookingPeriod.HasValue ? InvoiceBookingPeriod.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null,
                       Origin,
                       InvoiceFixedAmount?.ToDelimitedString(),
                       SpecialCosts?.ToDelimitedString(),
                       AmountForDoctorsTreatment?.ToDelimitedString(),
                       ResponsiblePhysician?.ToDelimitedString(),
                       CostCenter?.ToDelimitedString(),
                       InvoicePrepaidAmount?.ToDelimitedString(),
                       TotalInvoiceAmountWithoutPrepaidAmount?.ToDelimitedString(),
                       TotalAmountOfVat?.ToDelimitedString(),
                       VatRatesApplied != null ? string.Join(Configuration.FieldRepeatSeparator, VatRatesApplied.Select(x => x.ToString(Consts.NumericFormat, culture))) : null,
                       BenefitGroup?.ToDelimitedString(),
                       ProviderTaxId,
                       PayerTaxId,
                       ProviderTaxStatus?.ToDelimitedString(),
                       PayerTaxStatus?.ToDelimitedString(),
                       SalesTaxId
                       ).TrimEnd(Configuration.FieldSeparator.ToCharArray()));
        }
Пример #25
0
 public bool Delete(int?id)
 {
     try
     {
         Attention attention = _context.Attentions.Find(id);
         if (attention != null)
         {
             _context.Attentions.Remove(attention);
             _context.SaveChanges();
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception e)
     {
         Console.Write(e.StackTrace);
         return(false);
     }
 }
Пример #26
0
 public ActionResult UAttentionU(Attention attenion, int user2id)
 {
     try
     {
         if (ModelState.IsValid)
         {
             attenion.Attention_Time = DateTime.Now;
             //attenion.UserID = Convert.ToInt32(Session["User_id"]);
             attenion.UserID           = 1;
             attenion.Attention_UserID = user2id;
             attenion.Condition        = true;
             ikongjian.addattention(attenion);
             db.SaveChanges();
             //return PartialView(kongjianban);
         }
     }
     catch (Exception ex)
     {
         return(Content(ex.Message));
     }
     return(Content("<script>alert('关注成功');history.go(-1);</script>"));
 }
Пример #27
0
 public static Address Create(int addressId, bool isActive, DateTime endDate, AddressLine address1,
                              AddressLine address2, AddressLine address3, AddressLine address4, bool isPrimary, AddressTypeLookup addressType,
                              Attention attention, City city, string comments, PostalCode postalCode, StateCodeLookup stateCode)
 {
     return(new Address
     {
         Id = addressId,
         IsActive = isActive,
         EndDate = endDate,
         Address1 = address1,
         Address2 = address2,
         Address3 = address3,
         Address4 = address4,
         IsPrimary = isPrimary,
         AddressTypeId = addressType.AddressTypeId,
         Attention = attention,
         City = city,
         Comments = comments,
         PostalCode = postalCode,
         StateCodeId = stateCode.StateCodeId
     });
 }
Пример #28
0
            public Decoder(int sequenceLength, int vocabularySize, int wordVectorSize, int hiddenSize) : base(sequenceLength, sequenceLength * vocabularySize)
            {
                this.embedding      = new Embedding(sequenceLength, vocabularySize, wordVectorSize, (fanIn, fanOut) => 0.01 * Initializers.LeCunNormal(fanIn));
                this.recurrent      = new LSTM(wordVectorSize, hiddenSize, sequenceLength, true, false, (fanIn, fanOut) => Initializers.LeCunNormal(fanIn));
                this.attention      = new Attention(hiddenSize, sequenceLength);
                this.fullyConnected = new FullyConnected(hiddenSize * 2, sequenceLength, sequenceLength * vocabularySize, (fanIn, fanOut) => Initializers.LeCunNormal(fanIn));
                this.weights        = new double[this.embedding.Weights.Length + this.recurrent.Weights.Length + this.fullyConnected.Weights.Length];

                for (int i = 0; i < this.embedding.Weights.Length; i++)
                {
                    this.weights[i] = this.embedding.Weights[i];
                }

                for (int i = 0, j = this.embedding.Weights.Length; i < this.recurrent.Weights.Length; i++, j++)
                {
                    this.weights[j] = this.recurrent.Weights[i];
                }

                for (int i = 0, j = this.embedding.Weights.Length + this.recurrent.Weights.Length; i < this.fullyConnected.Weights.Length; i++, j++)
                {
                    this.weights[j] = this.fullyConnected.Weights[i];
                }
            }
Пример #29
0
        /// <summary>
        /// 添加关注
        /// </summary>
        /// <param name="UserId"></param>
        /// <param name="ShopId"></param>
        /// <param name="ProductId"></param>
        /// <returns></returns>
        public bool AddAttention(long UserId, long ShopId, long ProductId)
        {
            Attention AttentionInfo = new Attention();
            //context.Attention.FirstOrDefault((Attention A) => A.ProductId.Equals(ProductId) && A.UserId.Equals(UserId) && A.ShopId.Equals(ShopId));
            int i = 0;

            if (context.Attention.FirstOrDefault((Attention m) => m.ProductId.Equals(ProductId) && m.UserId.Equals(UserId) && m.ShopId.Equals(ShopId)) == null)
            {
                AttentionInfo.CreatDate = DateTime.Now;
                AttentionInfo.ProductId = ProductId;
                AttentionInfo.UserId    = UserId;
                AttentionInfo.ShopId    = ShopId;
                context.Attention.Add(AttentionInfo);
                i = context.SaveChanges();
            }
            if (i > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #30
0
        public ActionResult Create([Bind(Include = "AttentionId,Detail,Id,DiagnosticId,HistoryId")] Attention attention)
        {
            if (ModelState.IsValid)
            {
                var histo = db.Histories.Where(x => x.Id == attention.Id).FirstOrDefault();
                if (histo != null)
                {
                    attention.HistoryId = histo.HistoryId;

                    var medic = db.Medics.Where(x => x.ContactEmail == this.User.Identity.Name).FirstOrDefault();
                    if (medic != null)
                    {
                        attention.Id = medic.Id;
                        db.Attentions.Add(attention);
                        db.SaveChanges();
                        var Di = db.Diagnostics.Where(x => x.DiagnosticId == attention.DiagnosticId).FirstOrDefault();
                        //mensajeria
                        if (Di.RedDiagnostic)
                        {
                            var patient = db.Patients.Where(x => x.Id == histo.Id).FirstOrDefault();
                            if (patient != null)
                            {
                                var          mail = patient.ContactEmail;
                                Notification msg  = new Notification();
                                MailMessage  mnsj = new MailMessage();
                                mnsj.Subject = "Mensaje Urgente [Medired]";
                                mnsj.To.Add(new MailAddress(mail));
                                mnsj.From = new MailAddress("*****@*****.**", "Equipo Medired");
                                mnsj.Body = "Estimado Paciente \n\n Necesitamos que se comunique con su medico \n a la brevedad\n\n " +
                                            "Su diagnostico requiere de atencion especial. \n\n\n\n Medired - Nos preocupamos por ti";
                                /* Enviar */
                                msg.MandarCorreo(mnsj);
                            }
                            else
                            {
                                // Sin Paciente encontrado
                                ViewBag["MsgError"] = "Error al generar la creación de la atención";
                            }
                        }
                    }
                    else
                    {
                        // Sin Médico encontrado
                        ViewBag["MsgError"] = "Error al generar la creación de la atención";
                    }
                }
                else
                {
                    // Sin historial encontrado
                    ViewBag["MsgError"] = "Error al generar la creación de la atención";
                }



                return(RedirectToAction("Index"));
            }

            ViewBag.DiagnosticId = new SelectList(db.Diagnostics, "DiagnosticId", "Description", attention.DiagnosticId);
            ViewBag.HistoryId    = new SelectList(db.Histories, "HistoryId", "PatientName", attention.HistoryId);
            ViewBag.Id           = new SelectList(db.People, "Id", "FirstName", attention.Id);
            return(View(attention));
        }