Пример #1
0
 public void deleteLink(int RID)
 {
     ebridgeEntities _db = new ebridgeEntities();
     RESOURCE_LINK r = _db.RESOURCE_LINK.SingleOrDefault(link => link.RID==RID);
     if (r != null)
     {
         _db.RESOURCE_LINK.Remove(r);
         _db.SaveChanges();
     }
     else
     {
         throw new ApplicationException("Can't find the link");
     }
 }
Пример #2
0
 public void updateLink(int RID, string URL_TEXT, string URL, string ADDTL_TEXT, string ACTIVE, int Rank)
 {
     ebridgeEntities _db = new ebridgeEntities();
     RESOURCE_LINK r = _db.RESOURCE_LINK.SingleOrDefault(link => link.RID == RID);
     if (r != null)
     {
         r.URL_TEXT=URL_TEXT;
         r.ADDTL_TEXT=ADDTL_TEXT;
         r.URL=URL;
         r.RANK=Rank;
         r.DATE_TIME=DateTime.Now;
         _db.SaveChanges();
     }
     else
     {
         throw new ApplicationException("Can't find the link");
     }
 }
Пример #3
0
    protected void SendMessage(object sender, EventArgs e)
    {
        string DialogBody = CKEditor1.Text.Trim();
        if (String.IsNullOrEmpty(DialogBody)) return;

        ebridgeEntities _db = new ebridgeEntities();

        MESSAGE_ALT newMessage = new MESSAGE_ALT();

        newMessage.MESSAGE_BODY = HttpUtility.HtmlEncode(DialogBody);
        newMessage.DATE_TIME = DateTime.Now;

        if (UserType == "participant")
        {
            newMessage.FROM_ID = ParticipantId;
        }
        else if (UserType == "counselor")
        {
            newMessage.TO_ID = ParticipantId;
        }
        _db.MESSAGE_ALT.Add(newMessage);
        _db.SaveChanges();
        getThreadMessages();
    }
Пример #4
0
 public void createLink(string URL_TEXT, string URL, string Addtl_Text, int Rank )
 {
     ebridgeEntities _db = new ebridgeEntities();
     _db.RESOURCE_LINK.Add( new RESOURCE_LINK { URL_TEXT=URL_TEXT, URL=URL, ADDTL_TEXT=ADDTL_TEXT, RANK=Rank, DATE_TIME=DateTime.Now, SITE_ID="s", CREATED_BY="C001", ACTIVE="True"});
     _db.SaveChanges();
 }
Пример #5
0
    public static string setHours(string[] hours)
    {
        JavaScriptSerializer serial = new JavaScriptSerializer();

        string CounselorId= HttpContext.Current.Session["COUNSELOR_ID"] as string;
        Dictionary<string, string> SchoolInfo = HttpContext.Current.Session["SCHOOL"] as Dictionary<string, string>;
        if (string.IsNullOrEmpty(CounselorId) || SchoolInfo == null) return "failure";

        string _tmp = "";
        foreach (string v in hours)
        {
            _tmp += v + '|';
        }
        _tmp = _tmp.Substring(0, _tmp.Length - 1);

        ebridgeEntities _db = new ebridgeEntities();
        _db.SITE.Add(new SITE{ DATE_TIME= DateTime.Now, ID=SchoolInfo["code"], HOURS=_tmp});
        _db.SaveChanges();
        return "success";

    }