Пример #1
0
        private static void SetEnvironment(string siteCode)
        {
            System.Globalization.CultureInfo CultureInfo = System.Windows.Forms.Application.CurrentCulture.Clone() as System.Globalization.CultureInfo;
            CultureInfo = new CultureInfo("en-US");
            DateTimeFormatInfo dtInfo = new DateTimeFormatInfo();

            dtInfo.LongDatePattern     = "MM/dd/yyyy h:mm:ss tt";
            dtInfo.ShortDatePattern    = "MM/dd/yyyy";
            CultureInfo.DateTimeFormat = dtInfo;
            System.Windows.Forms.Application.CurrentCulture = CultureInfo;

            //lay chuoi ket noi
            AppCon ac = new AppCon();
            string StructConnection = ac.GetValue("StructDb");

            if (StructConnection == "" && File.Exists("InstallerMng.exe"))
            {
                ProcessStartInfo psi = new ProcessStartInfo("InstallerMng.exe", siteCode);
                Process.Start(psi);
                Environment.Exit(0);
            }
            StructConnection = Security.DeCode(StructConnection);
            string structDb = "CDT" + ac.GetValue("ShortName");

            Config.NewKeyValue("StructDb", structDb);
            Config.NewKeyValue("StructConnection", StructConnection);
        }
Пример #2
0
        public PosMain(DataRow drUser)
        {
            AppCon ac = new AppCon();

            softwareType = ac.GetValue("SoftwareType");
            machineTable = ac.GetValue("MachineTable");
            if (softwareType == "SV" && machineTable == "")
            {
                messageBox msg = new messageBox("Lỗi", "Lỗi cấu hình", "Phải nhập thông tin Machine Table"); msg.ShowDialog();
            }
            InitializeComponent();
            m1.Visible      = false;
            m2.Visible      = false;
            m3.Visible      = false;
            m4.Visible      = false;
            m0_1.Visible    = false;
            m0_2.Visible    = false;
            header.Visible  = false;
            body.Visible    = false;
            body_1.Visible  = false;
            body_2.Visible  = false;
            footer.Visible  = false;
            loginUser       = drUser;
            casx.Text       = loginUser["Ca"].ToString();
            usrname.Text    = loginUser["HoTen"].ToString();
            timer1.Enabled  = true;
            timer1.Interval = 1000;
            timer2.Enabled  = true;
            timer2.Interval = 10000;
            timer3.Enabled  = true;
            timer3.Interval = 10000;
            machine.Text    = machineTable;
            type.Text       = softwareType;
        }
Пример #3
0
        public ReturnForm(PosMain posmain)
        {
            AppCon ac = new AppCon();

            softwareType = ac.GetValue("SoftwareType");
            machineTable = ac.GetValue("MachineTable");
            mainFrm      = posmain;
            InitializeComponent();
        }
Пример #4
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     if (remain <= 0)
     {
         AppCon ac = new AppCon();
         ac.SetValue("Expire", Security.EnCode(DateTime.MinValue.ToString("MM/dd/yyyy")));
         Environment.Exit(0);
     }
     else
     {
         this.Close();
     }
 }
Пример #5
0
        public AddForm(PosMain posMain)
        {
            AppCon ac = new AppCon();

            softwareType = ac.GetValue("SoftwareType");
            machineTable = ac.GetValue("MachineTable");
            if (softwareType == "SV" && machineTable == "")
            {
                messageBox msg = new messageBox("Lỗi", "Lỗi cấu hình", "Phải nhập thông tin Machine Table"); msg.ShowDialog();
            }
            InitializeComponent();
            mainFrm = posMain;
        }
Пример #6
0
        private void FrmStartup_FormClosed(object sender, FormClosedEventArgs e)
        {
            string value = "1";
            string msg   = "Tự động xuất hiện màn hình 'Bắt đầu sử dụng' trong những lần sau?";

            msg = _vi ? msg : UIDictionary.Translate(msg);
            if (XtraMessageBox.Show(msg, Config.GetValue("PackageName").ToString(), MessageBoxButtons.YesNo) == DialogResult.No)
            {
                value = "0";
            }
            AppCon ac = new AppCon();

            ac.SetValue("Beginner", value);
        }
Пример #7
0
        private static void SetEnvironment(string siteCode)
        {
            CultureInfo CultureInfo = Application.CurrentCulture.Clone() as CultureInfo;

            CultureInfo = new CultureInfo("en-US");
            DateTimeFormatInfo dtInfo = new DateTimeFormatInfo();

            dtInfo.LongDatePattern     = "MM/dd/yyyy h:mm:ss tt";
            dtInfo.ShortDatePattern    = "MM/dd/yyyy";
            CultureInfo.DateTimeFormat = dtInfo;
            Application.CurrentCulture = CultureInfo;
            Config.NewKeyValue("PackageName", "Phần mềm Quản lý Giấy cuộn tại xưởng");
            //lay chuoi ket noi
            AppCon ac    = new AppCon();
            string posDb = ac.GetValue("POSDb");

            posDb = Security.DeCode(posDb);
            Config.NewKeyValue("DataConnection", posDb);

            string longwayDb = ac.GetValue("LongwayDb");

            longwayDb = Security.DeCode(longwayDb);
            Config.NewKeyValue("StructConnection", longwayDb);
        }