public Maticsoft.Model.SNS.SearchWordLog DataRowToModel(DataRow row) { Maticsoft.Model.SNS.SearchWordLog log = new Maticsoft.Model.SNS.SearchWordLog(); if (row != null) { if ((row["ID"] != null) && (row["ID"].ToString() != "")) { log.ID = int.Parse(row["ID"].ToString()); } if (row["SearchWord"] != null) { log.SearchWord = row["SearchWord"].ToString(); } if ((row["CreatedUserId"] != null) && (row["CreatedUserId"].ToString() != "")) { log.CreatedUserId = int.Parse(row["CreatedUserId"].ToString()); } if (row["CreatedNickName"] != null) { log.CreatedNickName = row["CreatedNickName"].ToString(); } if ((row["CreatedDate"] != null) && (row["CreatedDate"].ToString() != "")) { log.CreatedDate = DateTime.Parse(row["CreatedDate"].ToString()); } if ((row["Status"] != null) && (row["Status"].ToString() != "")) { log.Status = int.Parse(row["Status"].ToString()); } } return log; }
public void LogKeyWord(string q) { Maticsoft.BLL.SNS.SearchWordLog log = new Maticsoft.BLL.SNS.SearchWordLog(); Maticsoft.Model.SNS.SearchWordLog model = new Maticsoft.Model.SNS.SearchWordLog(); if (!string.IsNullOrWhiteSpace(q)) { model.CreatedDate = DateTime.Now; if (base.currentUser != null) { model.CreatedNickName = base.currentUser.NickName; model.CreatedUserId = base.currentUser.UserID; } model.SearchWord = q; log.Add(model); } }