예제 #1
0
        //[ValidateAntiForgeryToken]
        public ActionResult Create([Bind(Include = "Ref,Eng,Rus")] BodyText bodyText)
        {
            string base64Guid = Convert.ToBase64String(Guid.NewGuid().ToByteArray());

            bodyText.Ref = base64Guid.Replace("=", "");
            bodyText.Rus = bodyText.Eng;

            if (ModelState.IsValid)
            {
                db.BodyTexts.Add(bodyText);
                db.SaveChanges();
                //return RedirectToAction("Index");
                return(Json(
                           db.BodyTexts.Where(a => a.id == bodyText.id).ToList()
                           .Select(c => new BodyTextIndexModel
                {
                    Id = c.id,
                    Ref = c.Ref,
                    GenerateCodeASPX = "<%= BodyTexts.Ref(\"" + c.Ref + "\")%>",
                    GenerateCodeVB = "BodyTexts.Ref(\"" + c.Ref + "\")",
                    Eng = c.Eng,
                    Rus = c.Rus
                })
                           , JsonRequestBehavior.AllowGet));
            }

            return(View(bodyText));
        }
예제 #2
0
        // Auto generated when user submits a form
        public void CreateRegistrationEmail(string Subject, BusskortServiceReference.Anmälan anmälan)
        {
            try
            {
                string line;
                string filePath   = (AppDomain.CurrentDomain.BaseDirectory + "Custom/MailRegistrationTemplate.txt");
                var    fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read);

                StreamReader file = new StreamReader(filePath);
                while ((line = file.ReadLine()) != null)
                {
                    BodyText += line;
                }
                file.Close();

                BodyText = BodyText.Replace("ReplaceContentSkola", anmälan.Skola);
                BodyText = BodyText.Replace("ReplaceContentBarnNamn", anmälan.barnFörnamn + " " + anmälan.barnEfternamn);
                BodyText = BodyText.Replace("ReplaceContentCaretaker", anmälan.Förnamn + " " + anmälan.Efternamn);

                SendEmail(Subject, anmälan.E_post);
            }
            catch
            {
            }
        }
예제 #3
0
        //[ValidateAntiForgeryToken]
        public ActionResult DeleteConfirmed(int id)
        {
            BodyText bodyText = db.BodyTexts.Find(id);

            db.BodyTexts.Remove(bodyText);
            db.SaveChanges();
            return(Json(new { deleted = 1 }));
        }
예제 #4
0
        public bool Find(string find, int findType)
        {
            if (find == "" || find == String.Empty || find == null)
            {
                return(true);
            }
            switch (findType)
            {
            case 0:
                if (Subject.IndexOf(find) > -1)
                {
                    return(true);
                }
                break;

            case 1:
                if (BodyText.IndexOf(find) > -1)
                {
                    return(true);
                }
                break;

            case 2:
                if (CreateTime.ToString().IndexOf(find) > -1)
                {
                    return(true);
                }
                break;

            case 3:
                if (RunningTime.ToString().IndexOf(find) > -1)
                {
                    return(true);
                }
                break;

            case 4:
                if (Subject.IndexOf(find) > -1)
                {
                    return(true);
                }
                if (BodyText.IndexOf(find) > -1)
                {
                    return(true);
                }
                if (CreateTime.ToString().IndexOf(find) > -1)
                {
                    return(true);
                }
                if (RunningTime.ToString().IndexOf(find) > -1)
                {
                    return(true);
                }
                break;
            }
            return(false);
        }
예제 #5
0
 //[ValidateAntiForgeryToken]
 public ActionResult Edit([Bind(Include = "id,Ref,Eng,Rus")] BodyText bodyText)
 {
     if (ModelState.IsValid)
     {
         db.Entry(bodyText).State = EntityState.Modified;
         db.SaveChanges();
         return(Json(new { success = "1" }));
     }
     return(Json(new { success = "0" }));
 }
예제 #6
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = SentOnDate.GetHashCode();
         hashCode = (hashCode * 397) ^ (Subject != null ? Subject.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (BodyText != null ? BodyText.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Sender != null ? Sender.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Recipients != null ? Recipients.GetHashCode() : 0);
         return(hashCode);
     }
 }
예제 #7
0
        // GET: BodyTexts/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            BodyText bodyText = db.BodyTexts.Find(id);

            if (bodyText == null)
            {
                return(HttpNotFound());
            }
            return(View(bodyText));
        }
예제 #8
0
        public string ToString(bool includeBody)
        {
            StringBuilder sb = new StringBuilder(100);

            string accessorName = AccessorType == AccessorTypes.Get ? "get" : "set";

            sb.Append(Controller.Indent);

            if (!string.IsNullOrEmpty(Modifier))
            {
                sb.Append(Modifier + " ");
            }
            sb.Append(accessorName);

            if (includeBody)
            {
                if (string.IsNullOrEmpty(BodyText))
                {
                    BodyText = ";";
                }

                BodyText = Helper.RemoveTrailingLineBreaks(BodyText);
                BodyText = Helper.StandardizeLineBreaks(BodyText, Helper.LineBreaks.Unix);

                if (BodyText.IndexOf("\n") >= 0)
                {
                    //Controller.IndentLevel--;
                    BodyText = ArchAngel.Providers.CodeProvider.CSharp.Utility.ResetIndents(BodyText, Controller.Indent);
                    //Controller.IndentLevel++;
                }
                else
                {
                    int tabIndex = 0;

                    while (BodyText[tabIndex] == '\t')
                    {
                        tabIndex++;
                    }
                    BodyText = BodyText.Substring(tabIndex);
                }

                sb.AppendLine(BodyText);
            }
            return(sb.ToString());
        }
예제 #9
0
        void ReleaseDesignerOutlets()
        {
            if (BodyText != null)
            {
                BodyText.Dispose();
                BodyText = null;
            }

            if (OkBtn != null)
            {
                OkBtn.Dispose();
                OkBtn = null;
            }

            if (TitleLabel != null)
            {
                TitleLabel.Dispose();
                TitleLabel = null;
            }
        }
예제 #10
0
        public void Write(WorldPacket data)
        {
            data.WriteInt32(PetitionID);
            data.WritePackedGuid(Petitioner);

            data.WriteUInt32(MinSignatures);
            data.WriteUInt32(MaxSignatures);
            data.WriteInt32(DeadLine);
            data.WriteInt32(IssueDate);
            data.WriteInt32(AllowedGuildID);
            data.WriteInt32(AllowedClasses);
            data.WriteInt32(AllowedRaces);
            data.WriteInt16(AllowedGender);
            data.WriteInt32(AllowedMinLevel);
            data.WriteInt32(AllowedMaxLevel);
            data.WriteInt32(NumChoices);
            data.WriteInt32(StaticType);
            data.WriteUInt32(Muid);

            data.WriteBits(Title.GetByteCount(), 7);
            data.WriteBits(BodyText.GetByteCount(), 12);

            for (byte i = 0; i < Choicetext.Length; i++)
            {
                data.WriteBits(Choicetext[i].GetByteCount(), 6);
            }

            data.FlushBits();

            for (byte i = 0; i < Choicetext.Length; i++)
            {
                data.WriteString(Choicetext[i]);
            }

            data.WriteString(Title);
            data.WriteString(BodyText);
        }
예제 #11
0
        // Auto generated when decision has been made by admin
        public void CreateDecisionEmail(string Subject, BusskortServiceReference.Anmälan anmälan)
        {
            try
            {
                string line;
                string filePath   = (AppDomain.CurrentDomain.BaseDirectory + "Custom/MailDecisionTemplate.txt");
                var    fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read);

                StreamReader file = new StreamReader(filePath);
                while ((line = file.ReadLine()) != null)
                {
                    BodyText += line;
                }
                file.Close();

                BodyText = BodyText.Replace("ReplaceContentSkola", anmälan.Skola);
                BodyText = BodyText.Replace("ReplaceContentBarnNamn", anmälan.barnFörnamn + " " + anmälan.barnEfternamn);
                BodyText = BodyText.Replace("ReplaceContentCaretaker", anmälan.Förnamn + " " + anmälan.Efternamn);

                if (anmälan.Beviljad.ToLower() == "ja")
                {
                    BodyText = BodyText.Replace("ReplaceContentBeviljad", "<span style =\"color: green; font - weight: bold; \">" + anmälan.Beviljad + "</span>");
                }
                else
                {
                    BodyText = BodyText.Replace("ReplaceContentBeviljad", "<span style =\"color: red; font - weight: bold; \">" + anmälan.Beviljad + "</span>");
                }

                BodyText = BodyText.Replace("ReplaceContentMotivering", anmälan.Motivering);

                SendEmail(Subject, anmälan.E_post);
            }
            catch
            {
            }
        }
예제 #12
0
        public string GetBodyText(MessageBodyType BodyType)
        {
            string BodyText;

            if (!ContainsKey(BodyType))
            {
                if (BodyType != MessageBodyType.Text && BodyType != MessageBodyType.Html)
                {
                    if (ContainsKey(MessageBodyType.Text))
                    {
                        BodyText = this[MessageBodyType.Text];
                    }
                    else
                    {
                        return(null);
                    }
                }
                else
                {
                    return(null);
                }
            }
            else
            {
                BodyText = this[BodyType];
            }

            if (BodyType != MessageBodyType.Html)
            {
                return(BodyText.Replace("&amp;", "&"));
            }
            else
            {
                return(BodyText);
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (BodyText != null)
            {
                BodyText.Dispose();
                BodyText = null;
            }

            if (BodyViewBottomConstraint != null)
            {
                BodyViewBottomConstraint.Dispose();
                BodyViewBottomConstraint = null;
            }

            if (DoctorLabel != null)
            {
                DoctorLabel.Dispose();
                DoctorLabel = null;
            }

            if (MedicalCenterLabel != null)
            {
                MedicalCenterLabel.Dispose();
                MedicalCenterLabel = null;
            }

            if (SelectionDropDownImage != null)
            {
                SelectionDropDownImage.Dispose();
                SelectionDropDownImage = null;
            }

            if (SendButton != null)
            {
                SendButton.Dispose();
                SendButton = null;
            }

            if (senderLabel != null)
            {
                senderLabel.Dispose();
                senderLabel = null;
            }

            if (SenderSelectionView != null)
            {
                SenderSelectionView.Dispose();
                SenderSelectionView = null;
            }

            if (SenderSeparator != null)
            {
                SenderSeparator.Dispose();
                SenderSeparator = null;
            }

            if (SenderSeparatorTopToSenderViewBottomConstraint != null)
            {
                SenderSeparatorTopToSenderViewBottomConstraint.Dispose();
                SenderSeparatorTopToSenderViewBottomConstraint = null;
            }

            if (SenderSeparatorTopToSenderViewSelectionBottomConstraint != null)
            {
                SenderSeparatorTopToSenderViewSelectionBottomConstraint.Dispose();
                SenderSeparatorTopToSenderViewSelectionBottomConstraint = null;
            }

            if (SenderView != null)
            {
                SenderView.Dispose();
                SenderView = null;
            }

            if (SubjectTextfield != null)
            {
                SubjectTextfield.Dispose();
                SubjectTextfield = null;
            }
        }