private void labelItem10_Click(object sender, EventArgs e) { var query = (from u in DBCommon.Context.UserAccess where u.UserID == PublicVariebale.gUserID where u.SystemPartID == 20 select u); var result = query.ToList(); if (result.Count > 0) { formclosing(); FormNumber = 11; fm_srl = new SendRefrenceLetter(); fm_srl.Show(); // fm_sd.MdiParent = this; fm_srl.TopMost = true; } else { labelItem10.Text = "شما به این بخش دسترسی ندارید"; } }
private void formclosing() { if (FormNumber == 7) { fm_sr = new Frm_ShowRememebr(); fm_sr.Close(); } if (FormNumber == 14) { fm_ar = new Frm_AddRememeber(); fm_ar.Close(); } if (FormNumber == 15) { fm_sd = new Frm_ShowDrafts(); fm_sd.Close(); } if (FormNumber == 12) { //fm_cl = new Frm_CreateLetter(); //fm_cl.Close(); } if (FormNumber == 1) { fm_rl = new Frm_ReciveLetter(); fm_rl.Close(); } if (FormNumber == 8) { fm_sl = new Frm_SendLetter(); fm_sl.Close(); } if (FormNumber == 13) { fm_cn = new Frm_CrateNote(); fm_cn.Close(); } if (FormNumber == 10) { fm_ss = new Frm_ShowSendNote(); fm_ss.Close(); } if (FormNumber == 6) { fm_rn = new Frm_ReciveNote(); fm_rn.Close(); } if (FormNumber == 3) { fm_un = new Frm_UnReadLetter(); fm_un.Close(); } if (FormNumber == 2) { fm_rel = new Frm_ReadLetter(); fm_rel.Close(); } if (FormNumber == 4) { fm_sf2 = new ShowletterForce2(); fm_sf2.Close(); } if (FormNumber == 5) { fm_st = new Frm_Security2(); fm_st.Close(); } if (FormNumber == 16) { fm_sa = new Frm_ShowNewsForAllUser(); fm_sa.Close(); } if (FormNumber == 11) { fm_srl = new SendRefrenceLetter(); fm_srl.Close(); } if (FormNumber == 20) { fm_rr = new Frm_ReciveRefrenceLEtter(); fm_rr.Close(); } }