private void Logare_Click(object sender, EventArgs e)
        {
            var form3 = new LoggingForm();

            form3.BringToFront();
            form3.Show();
        }
Beispiel #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

#if DEBUG
            LoggingForm frmLogging = new LoggingForm();
            frmLogging.Show();
#endif

            //加入Entity Framework的sql cmd logger
            DbInterception.Add(new LoggerCommandInterceptor());

            log4net.Config.XmlConfigurator.Configure();

            Application.Run(new MainForm());
        }
Beispiel #3
0
        /// <summary>
        /// Convert <see cref="LoggingForm"/> to an unsigned integer.
        /// </summary>
        /// <param name="form">Logging form enumeration <see cref="LoggingForm"/>.</param>
        /// <returns>Converted unsigned integer that represents the logging form.</returns>
        public static uint LoggingFormToUint(LoggingForm form)
        {
            uint ret = LFORM_DENSE;

            switch (form)
            {
            default:
            case LoggingForm.Dense: break;

            case LoggingForm.AllOut: ret = LFORM_ALLOUT; break;

            case LoggingForm.Crossing: ret = LFORM_CROSSING; break;

            case LoggingForm.IRQ1: ret = LFORM_IRQ1; break;

            case LoggingForm.IRQ2: ret = LFORM_IRQ2; break;

            case LoggingForm.BothIRQs: ret = LFORM_BOTHIRQS; break;
            }

            return(ret);
        }
        public static Form ShowFormByName(string formName, out bool isLogout)
        {
            Form form             = null;
            bool isFunctionLogout = false;

            if (!string.IsNullOrWhiteSpace(formName))
            {
                formName = formName.Trim();

                //Check if form is opened
                if (OpenedForms.Contains(formName))
                {
                    form = (Form)OpenedForms[formName];
                    form.Dispose();
                    if (form.IsDisposed)
                    {
                        OpenedForms.Remove(formName);
                        form = null;
                    }
                }

                switch (formName)
                {
                case "Danh mục khách hàng":
                    ListCustomerForm listCustomerForm = new ListCustomerForm();
                    form = (Form)listCustomerForm;
                    break;

                case "Danh mục loại quảng cáo":
                    ListShowTypeForm listShowTypeForm = new ListShowTypeForm();
                    form = (Form)listShowTypeForm;
                    break;

                case "Danh mục buổi phát":
                    ListSessionForm listSessionForm = new ListSessionForm();
                    form = (Form)listSessionForm;
                    break;

                case "Danh mục thời điểm":
                    ListTimeSlotForm listTimeSlotForm = new ListTimeSlotForm();
                    form = (Form)listTimeSlotForm;
                    break;

                case "Danh mục thời lượng":
                    ListDurationForm listDurationForm = new ListDurationForm();
                    form = (Form)listDurationForm;
                    break;

                //Nhập liệu
                case "Hợp đồng quảng cáo":
                    ListContractForm listContractForm = new ListContractForm();
                    form = (Form)listContractForm;
                    break;

                case "Xếp lịch theo ngày":
                    SortScheduleByDayForm sortScheduleByDayForm = new SortScheduleByDayForm();
                    form = (Form)sortScheduleByDayForm;
                    break;

                //In ấn
                case "In lịch phát sóng":
                    SchedulePrintForm schedulePrintForm = new SchedulePrintForm();
                    form = (Form)schedulePrintForm;
                    break;

                case "Báo cáo doanh thu":
                    RevenuePrintForm revenuePrintForm = new RevenuePrintForm();
                    form = (Form)revenuePrintForm;
                    break;

                case "Đối chiếu công nợ":
                    LiabilitesPrintForm liabilitesPrintForm = new LiabilitesPrintForm();
                    form = (Form)liabilitesPrintForm;
                    break;

                case "Chứng nhận phát sóng":
                    ShowCommitmentPrintForm showCommitmentPrintForm = new ShowCommitmentPrintForm();
                    form = (Form)showCommitmentPrintForm;
                    break;

                case "Dự trù thời lượng":
                    ExpectedPrintForm expectedPrintForm = new ExpectedPrintForm();
                    form = (Form)expectedPrintForm;
                    break;

                case "Đăng ký quảng cáo":
                    InputSchedulePrintForm inputSchedulePrintForm = new InputSchedulePrintForm();
                    form = (Form)inputSchedulePrintForm;
                    break;

                case "Bảng giá quảng cáo":
                    PricingPrintForm pricingPrintForm = new PricingPrintForm();
                    form = (Form)pricingPrintForm;
                    break;

                //Trợ giúp
                case "Đổi mật khẩu":
                    ChangePasswordForm changePasswordForm = new ChangePasswordForm();
                    form = (Form)changePasswordForm;
                    break;

                case "Thông tin ứng dụng":
                    HelpForm helpForm = new HelpForm();
                    form = (Form)helpForm;
                    break;

                //Quyền Admin
                case "Đặt lại mật khẩu":
                    ResetPasswordForm resetPasswordForm = new ResetPasswordForm();
                    form = (Form)resetPasswordForm;
                    break;

                case "Xem lịch sử":
                    LoggingForm loggingForm = new LoggingForm();
                    form = (Form)loggingForm;
                    break;

                case "Tạo tài khoản":
                    CreateAccountForm createAccountForm = new CreateAccountForm();
                    form = (Form)createAccountForm;
                    break;

                case "Logout":
                    Session.Logout();
                    isFunctionLogout = true;
                    break;

                case "Exit":
                    Application.Exit();
                    break;
                }

                if (form != null)
                {
                    form.Owner         = GlobalForm.ActiveForm;
                    form.MdiParent     = GlobalForm.ActiveForm;
                    form.ShowInTaskbar = true;
                    form.BringToFront();
                    form.TopMost       = true;
                    form.MinimizeBox   = true;
                    form.WindowState   = FormWindowState.Normal;
                    form.StartPosition = FormStartPosition.CenterScreen;

                    form.Show();

                    if (!OpenedForms.Contains(formName))
                    {
                        OpenedForms.Add(formName, form);
                    }
                }
            }

            isLogout = isFunctionLogout;
            return(form);
        }