Exemplo n.º 1
0
        private void frmMain_Load(object sender, EventArgs e)
        {
            //  Permission_Hide_Menu(); // call permission hide

            this.Text = this.Text + " " + config("Config.xml", "company") + " V" + config("Config.xml", "version");

            Class.RegistryWriter rg = new Class.RegistryWriter();
            //   this.defaultGiaoDien.LookAndFeel.SkinName = "Xmas 2008 Blue";
            this.defaultGiaoDien.LookAndFeel.SkinName = rg.valuekey("style");
            string sv = rg.valuekey("server");

            if (sv == "Blue")
            {
                btnCauHinh_ItemClick(null, null);
            }
            else
            {
                btnDangNhap_ItemClick(null, null);
            }

            //// timechechSv.Enabled = true;
            SkinHelper.InitSkinPopupMenu(barSubItem2);
            SkinHelper.InitSkinPopupMenu(barSubItem4);
        }
Exemplo n.º 2
0
        //    public string _taikhoan;


        private void frmDangnhap_Load(object sender, EventArgs e)
        {
            //txtTaiKhoan.Text = "admin";
            //txtMatkhau.Text = "123456";
            Class.RegistryWriter rg = new Class.RegistryWriter();
            string user             = rg.valuekey("user_client");

            if (user != "Blue" & user != "")
            {
                txtTaiKhoan.Text     = user;
                checkLuuPass.Checked = true;
            }
            else
            {
                txtTaiKhoan.Text     = "admin";
                checkLuuPass.Checked = false;
            }
        }
Exemplo n.º 3
0
        public static string get_config(string _id)
        {
            RegistryWriter rg = new RegistryWriter();

            return(rg.valuekey(_id));
        }
Exemplo n.º 4
0
        //string template_grid = Application.StartupPath + @"\Templates\Templates_Menu.xml";

        private void btnDangNhap_ItemClick(object sender, ItemClickEventArgs e)
        {
            frmDangNhap frm = new frmDangNhap();

            frm.Owner = this;
            frm.ShowDialog();
            if (_taiKhoan != "")
            {
                Waiting.ShowWaitForm();
                Waiting.SetWaitFormDescription("Đang tải thông tin tài khoản..");
                Permission_Show_Menu(_taiKhoan);
                //hien thi btndoimatkhau
                btnDoiMatKhau.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
                // goi chuc nang thong bao
                this.btnThongBao.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
                Class.RegistryWriter rg = new Class.RegistryWriter();
                lblFullname.Caption = "Đang sử dụng: " + _taiKhoan + "  | Thời gian: " + DateTime.Now.ToString("dd/MM/yyyy h:m tt") + "   |  Máy chủ: " + rg.valuekey("server");
                sv_host             = rg.valuekey("server");

                // goi thong tin de luu Log phan mem
                Class.S_Log.Call_PcInfo();
                Class.S_Log.UserName = _taiKhoan.ToLower();
                ribbon.SelectedPage  = Menu_Hrm;
                Class.S_Log.Insert("Hệ thống", "Đăng nhập");
                Class.App.client_User = _taiKhoan;
                if (rg.valuekey("alert") == "Blue")
                {
                    btnThongBao.Enabled = true;
                }
                else if (rg.valuekey("alert") == "1")
                {
                    btnThongBao.Enabled = true;
                    Class.ThongKe tk = new Class.ThongKe();
                    DataTable     dt = tk.CT_EMPLOYEE_GetListBirthday();
                    if (dt.Rows.Count > 0)
                    {
                        dt.Columns.Add("Day", Type.GetType("System.String"));
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            string txt = ((DateTime)dt.Rows[i]["BirthDay"]).Day.ToString();
                            if (txt.Length == 1)
                            {
                                txt = "0" + txt;
                            }
                            dt.Rows[i]["Day"] = txt;
                        }
                        DataView dv = dt.DefaultView;
                        dv.Sort = "Day ASC";
                        dt      = dv.ToTable();

                        // xuat thong bao sinh nhat sap den
                        string tb = "";
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            tb += (i + 1).ToString() + ". " + dt.Rows[i]["FirstName"].ToString() + " " + dt.Rows[i]["LastName"].ToString() + ": <i>" + ((DateTime)dt.Rows[i]["Birthday"]).ToString("dd/MM/yyyy") + "</i>\n";
                        }
                        alertControl.Show(this, "Danh sách sắp đến ngày sinh nhật:", tb);
                        //-------------
                        // xuat danh sach sap phai ky lai hop dong
                        Class.DanhMuc_HopDong hd   = new Class.DanhMuc_HopDong();
                        DataTable             dthd = hd.CT_CONTRACT_GetListJustExpiration();
                        if (dthd.Rows.Count > 0)
                        {
                            DataView _dv = new DataView();
                            _dv      = dthd.DefaultView;
                            _dv.Sort = "ToDate ASC";


                            string tb2 = "";
                            for (int i = 0; i < _dv.Count; i++)
                            {
                                tb2 += (i + 1).ToString() + ". " + _dv[i]["FirstName"].ToString() + " " + _dv[i]["LastName"].ToString() + " -<i> " + ((DateTime)_dv[i]["ToDate"]).ToString("dd/MM/yyyy") + "</i>\n";;
                            }
                            alertControl.Show(this, "Danh sách sắp ký lại hợp đồng :", tb2);
                        }
                        ////-----------------=================
                        if (File.Exists(@"media/" + Class.App.media))
                        {
                            SoundPlayer simpleSound = new SoundPlayer(@"media/" + Class.App.media);
                            simpleSound.Play();
                        }
                    }
                }
                else
                {
                    btnThongBao.Enabled = false;
                }

                Waiting.CloseWaitForm();
            }
        }