static void Save_KeepcontLogs(int id, DateTime keepcon_send_date, string keepcon_error_message, LogType logType) { using (BB_MovistarSM_LogsEntities dc = new BB_MovistarSM_LogsEntities()) { KeepconLogs wKeepconLogs = new KeepconLogs(); wKeepconLogs.id = id; wKeepconLogs.keepcon_send_date = keepcon_send_date; wKeepconLogs.keepcon_error_message = keepcon_error_message; wKeepconLogs.logtype = (int)logType; dc.KeepconLogs.AddObject(wKeepconLogs); dc.SaveChanges(); } }
public static KeepconPost GetPostById(int postId) { using (BB_MovistarSM_LogsEntities dc = new BB_MovistarSM_LogsEntities()) { return dc.KeepconPost.Where(s => s.PostID == postId).FirstOrDefault < KeepconPost>(); } }
static void Set_SendedTime(Import.Import import, Response response, DateTime datetime) { using (BB_MovistarSM_LogsEntities dc = new BB_MovistarSM_LogsEntities()) { foreach (Import.Content c in import.Contents) { var post = dc.KeepconPost.Where(s => s.PostID.Equals(c.Id)).FirstOrDefault(); post.keepcon_send_date = datetime; post.keepcon_send_setId = response.SetGuid; } dc.SaveChanges(); } }
/// <summary> /// Establece la bandera keepcon_ack par aindicar q al lote de post con un determinado set result id se le envio el ACK /// </summary> /// <param name="setId">Lote resultado</param> internal static void SaveResult_ACK(string setId) { using (BB_MovistarSM_LogsEntities dc = new BB_MovistarSM_LogsEntities()) { foreach (KeepconPost wKeepconPost in dc.KeepconPost.Where(p => p.keepcon_result_setId.Equals(setId))) { wKeepconPost.keepcon_ack = true; } dc.SaveChanges(); } }
/// <summary> /// /// </summary> /// <returns></returns> //internal static List<KeepconPost> Update_Sended_Post() //{ // using (BB_MovistarSM_LogsEntities dc = new BB_MovistarSM_LogsEntities()) // { // var x = from s in dc.KeepconPost where s.keepcon_send_date.HasValue == false select s; // return x.ToList<KeepconPost>(); // } //} #endregion /// <summary> /// Almacena resultado de moderacion /// </summary> /// <param name="export"></param> internal static void SaveResult(Export.Export export) { using (BB_MovistarSM_LogsEntities dc = new BB_MovistarSM_LogsEntities()) { foreach (Export.Content c in export.Contents) { var post = dc.KeepconPost.Where(s => s.PostID.Equals(c.Id)).FirstOrDefault(); post.keepcon_result_resived_date = System.DateTime.Now; post.keepcon_moderator_date = Fwk.HelperFunctions.DateFunctions.UnixLongTimeToDateTime(c.ModerationDate); post.keepcon_moderator_decision = c.ModerationDecision; post.keepcon_result_setId = export.SetId; if (c.Tagging != null) if (c.Tagging.Count > 0) { //try //{ post.keepcon_result_tagging = Fwk.HelperFunctions.FormatFunctions.GetStringBuilderWhitSeparator<Allus.Keepcon.Export.Tag>(c.Tagging, ',').ToString(); //} //catch (Exception r) //{ // throw r; //} } if (c.Comments != null) if (c.Comments.Count > 0) post.keepcon_result_comments = c.Comments[0].Text.Text; } dc.SaveChanges(); } }
public static List<String> Retrive_All_ContentType_To_Send() { using (BB_MovistarSM_LogsEntities dc = new BB_MovistarSM_LogsEntities()) { var x = (from s in dc.KeepconPost where s.keepcon_send_date.HasValue && String.IsNullOrEmpty(s.keepcon_result_setId) select s.KeepconCustomerCare).Distinct(); return x.ToList<String>(); } }
/// <summary> /// Retorna post retorna un batch = kc_batch /// </summary> /// <param name="takeNumber"></param> /// <returns></returns> internal static List<KeepconPost> RetrivePost_To_Send() { using (BB_MovistarSM_LogsEntities dc = new BB_MovistarSM_LogsEntities()) { var x = from s in dc.KeepconPost where s.keepcon_send_date.HasValue == false && String.IsNullOrEmpty(s.KeepconCustomerCare)==false select s; return x.Take(kc_batch).ToList<KeepconPost>(); } }