Beispiel #1
0
        public static void UpdateHistory(string task, string FullName, string UserID)
        {
            LoilocContext   db = new LoilocContext();
            tblHistoryLogin tblhistorylogin = new tblHistoryLogin();

            tblhistorylogin.FullName   = FullName;
            tblhistorylogin.Task       = task;
            tblhistorylogin.idUser     = int.Parse(UserID);
            tblhistorylogin.DateCreate = DateTime.Now;
            tblhistorylogin.Active     = true;

            db.tblHistoryLogins.Add(tblhistorylogin);
            db.SaveChanges();
        }
Beispiel #2
0
 public static void ProductCreateTag(int id, string keyword)
 {
     string[] Mang = keyword.Split(',');
     for (int i = 0; i < Mang.Length; i++)
     {
         string name = Mang[i];
         if (name != null && name != "")
         {
             string kiemtra = Mang[i].Substring(0, 1);
             if (kiemtra == " ")
             {
                 name = Mang[i].Remove(0, 1);
             }
             tblProductTag productTag = new tblProductTag();
             productTag.idp  = id;
             productTag.Name = name;
             productTag.Tag  = NameToTag(name);
             db.tblProductTags.Add(productTag);
             db.SaveChanges();
         }
     }
 }