public static void LoadSowerText(AxSowerRichTextBox AView, string DocText, M_Topic oCurrTopic) { AView.Clear(); if (oCurrTopic.TopicFace.Length > 0) { AView.DocType = PublicClass.SowerExamPlugn.GetTopicDocType(PublicClass.StudentDir, int.Parse(oCurrTopic.TopicTypeId), int.Parse(oCurrTopic.TopicId), 0); AView.SowerText = DocText; } }
public bool SaveTopic(int Topic_Id, int Meeting_Id, string Topic_Name_Ar, string Topic_Name_En, int Topic_Status_Id, int Structure_Id, string Arabic_Description, string English_Description, string Arabic_Recommendation, string English_Recommendation, string Arabic_RecommendationDoc, string English_RecommendationDoc) { try { db.Configuration.LazyLoadingEnabled = false; M_Topic Topic = db.M_Topic.Create(); if (Topic_Id != 0) { Topic = db.M_Topic.First(x => x.Topic_Id == Topic_Id); } Topic.Meeting_Id = Meeting_Id; Topic.Topic_Status = Topic_Status_Id; if (Structure_Id > 0) { Topic.Structure_Id = Structure_Id; } else { Topic.Structure_Id = null; } Topic.Topic_Name_Ar = Topic_Name_Ar; Topic.Topic_Name_En = Topic_Name_En; Topic.Topic_Description_Ar = Arabic_Description; Topic.Topic_Description_En = English_Description; Topic.Topic_Recommendation_Ar = Arabic_Recommendation; Topic.Topic_Recommendation_En = English_Recommendation; Topic.Topic_Recommendation_Doc_Ar = Arabic_RecommendationDoc; Topic.Topic_Recommendation_Doc_En = English_RecommendationDoc; if (Topic_Id != 0) { db.Entry(Topic).State = System.Data.EntityState.Modified; } else { Topic.Create_Date = DateTime.Now.Date; db.M_Topic.Add(Topic); } db.SaveChanges(); /* Add it to log file */ LogData = "data:" + JsonConvert.SerializeObject(Topic, logFileModule.settings); if (Meeting_Id != 0) { logFileModule.logfile(10, "تعديل بيانات موضوع", "update Topic", LogData); } else { logFileModule.logfile(10, "إضافة موضوع", "Add Topic", LogData); } } catch { return(false); } return(true); }