private void đăngNhậpToolStripMenuItem_Click(object sender, EventArgs e) { Login_Form Temp = new Login_Form(); Temp.ShowDialog(); if (Main_Form.isLogin == true) { if (QuanLyMode == true) { this.thốngKêToolStripMenuItem.Enabled = true; this.quảnLýNhânViênToolStripMenuItem.Enabled = true; } this.hoạtĐộngToolStripMenuItem.Enabled = true; this.quảnLýToolStripMenuItem.Enabled = true; this.đăngNhậpToolStripMenuItem.Enabled = false; this.đăngXuấtToolStripMenuItem.Enabled = true; Main_MonthCalendar.Show(); News_RichTextBox.Show(); Phong_GroupBox.Show(); App_Label.Hide(); NV_Label.Show(); News_Label.Show(); BS_layer.BLNhanVien bl = new BS_layer.BLNhanVien(); DataTable dt = new DataTable(); DataSet ds = new DataSet(); ds = bl.LayDSNVMainForm(user); dt = ds.Tables[0]; FontFamily f = new FontFamily("Times New Roman"); NV_Label.Font = new Font(f, 12); NV_Label.Text = "Nhân Viên đang đăng nhập: " + dt.Rows[0].ItemArray[0] + "\nTên: " + dt.Rows[0].ItemArray[1] + "\nChức Vụ: " + dt.Rows[0].ItemArray[2]; } }
public static void Write_Admin_Log(FoxTickerEntities db, App_Label app_label, Type model, Action_Flag action_flag, string object_id, string object_repr, string change_message, bool save = false) { //db.Mapping.GetTables(); auth_admin_log dal = new auth_admin_log(); dal.action_flag = (short)action_flag; dal.action_time = DateTime.Now; dal.user_id = int.Parse(HttpContext.Current.Session["UserID"].ToString()); dal.change_message = change_message; string label = app_label.ToString(); dal.auth_content_type = db.auth_content_type.Where(dct => dct.app_label == label && dct.model == model.Name.ToLower() + "s").FirstOrDefault(); dal.object_id = object_id; if (object_repr.Length > 200) { object_repr = object_repr.Substring(0, 199); } dal.object_repr = object_repr; db.auth_admin_log.AddObject(dal); if (save) { } //db.SaveChanges(); }
public Main_Form() { isLogin = false; QuanLyMode = true; InitializeComponent(); KhoiTaoMoi(); Main_MonthCalendar.Hide(); News_RichTextBox.Hide(); Phong_GroupBox.Hide(); News_Label.Hide(); this.NV_Label.Hide(); App_Label.Show(); }