public Class(string name, string nameSpace, List <string> refrences, List <string> attributes) : this(name, nameSpace) { this.Refrences = refrences; this.Attributes = attributes; Refrences.ForEach(r => NameSpaces.Add(r)); }
private void Awake() { if (Instance == null) { Instance = this; } else { Destroy(this); } GetDictionaries(); }
private void btn_Send_Click(object sender, EventArgs e) { if (Refrencetype == 1) { using (TransactionScope ts = new TransactionScope()) { List <DataGridView> chek_User = new List <DataGridView>(); foreach (DataGridViewRow row in dgvShowUser.Rows) { //Insertsenddate(); Refrences rf = new Refrences(); if (Convert.ToBoolean(row.Cells["Select"].Value) == true) { rf.LetterID = this.GetLetterID; rf.UserID = this.refrencekonande; rf.RefrenceUserID = this.refrenceshode; rf.ReciveRefrenceUserID = Convert.ToInt32(row.Cells["UserID"].Value); rf.CreateDate = PublicVariebale.ToDayDate; DBCommon.Context.Refrences.Add(rf); DBCommon.Context.SaveChanges(); } } DBCommon.Context.SaveChanges(); ts.Complete(); MessageBox.Show("ارجاع نامه با موفقیت انجام شد", "موفقیت", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } } else { using (TransactionScope ts = new TransactionScope()) { ///Exit to Draft /// var query_Update = (from u in DBCommon.Context.Letters where u.LetterID == this.GetLetterID select u).SingleOrDefault(); query_Update.DraftyType = 2; query_Update.SendLetterDate = PublicVariebale.ToDayDate; DBCommon.Context.SaveChanges(); ///// /// List <DataGridView> chek_User = new List <DataGridView>(); foreach (DataGridViewRow row in dgvShowUser.Rows) { //Insertsenddate(); SendLetter sl = new SendLetter(); if (Convert.ToBoolean(row.Cells["Select"].Value) == true) { sl.UserID = Convert.ToInt32(row.Cells["UserID"].Value); sl.LetterID = this.GetLetterID; sl.ReadType = 1; sl.Status = 1; DBCommon.Context.SendLetter.Add(sl); } } DBCommon.Context.SaveChanges(); ts.Complete(); MessageBox.Show("ارسال نامه با موفقیت انجام شد", "موفقیت", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } } }