Ejemplo n.º 1
0
        private void aMCServiceToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmAMC frm = new frmAMC();

            frm.MdiParent = this;
            frm.Show();
        }
Ejemplo n.º 2
0
        public frmEditor(frmAMC prevForm, long CustomerId, int TabIndex)
        {
            InitializeComponent();

            CurrentCustomerId = CustomerId;
            CurrTabIndex      = TabIndex;
            previousForm      = prevForm;


            SqlCeCommand cmd = new SqlCeCommand();

            cmd.CommandText = @"SELECT  Date,NextServiceDate, AMC_ReminderType, AMC_ExpiryDate     
                                FROM Customer WHERE CustomerId = @Id";

            cmd.Parameters.AddWithValue("@Id", CustomerId);
            DataTable dt = dbWrapper.SelectData(cmd);

            if (dt.Rows.Count > 0)
            {
                txtInstallationDate.Text = Convert.ToDateTime(dt.Rows[0]["Date"]).ToLongDateString();
                dtExpiryDate.Text        = Convert.ToDateTime(dt.Rows[0]["AMC_ExpiryDate"]).ToLongDateString();

                dtCurrentVisit.Text = Convert.ToDateTime(dt.Rows[0]["NextServiceDate"]).ToLongDateString();

                if (Convert.ToInt16(dt.Rows[0]["AMC_ReminderType"]) == 1)
                {
                    dtNextVisit.Text = Convert.ToDateTime(dt.Rows[0]["NextServiceDate"]).Date.AddYears(1).ToLongDateString();
                }
                else
                {
                    dtNextVisit.Text = Convert.ToDateTime(dt.Rows[0]["NextServiceDate"]).Date.AddMonths(Util.ServiceAfterMonths).ToLongDateString();
                }


                if (dtNextVisit.Value.Date > dtExpiryDate.Value.Date)
                {
                    dtNextVisit.Enabled = false;
                    chkAgree.Visible    = !dtNextVisit.Enabled;
                }

                if (CurrTabIndex == 1)
                {
                    dtCurrentVisit.Text = DateTime.Now.Date.ToLongDateString();
                    dtNextVisit.Text    = DateTime.Now.AddMonths(Util.ServiceAfterMonths).ToLongDateString();
                }
            }
        }
Ejemplo n.º 3
0
        public frmScheduleNextVisit(frmAMC prevForm, long CustomerId, short code)
        {
            InitializeComponent();
            CurrentCustomerId = CustomerId;
            Marker            = code;
            previousForm      = prevForm;

            SqlCeCommand cmd = new SqlCeCommand();

            cmd.CommandText = @"SELECT  Date, AMC_ExpiryDate, NextServiceDate      
                                FROM Customer WHERE CustomerId = @Id";

            cmd.Parameters.AddWithValue("@Id", CustomerId);
            DataTable dt = dbWrapper.SelectData(cmd);

            if (dt.Rows.Count > 0)
            {
                txtInstallationDate.Text = Convert.ToDateTime(dt.Rows[0]["Date"]).ToLongDateString();
                txtExpiryDate.Text       = Convert.ToDateTime(dt.Rows[0]["AMC_ExpiryDate"]).ToLongDateString();
                dtNextVisit.Text         = Convert.ToDateTime(dt.Rows[0]["NextServiceDate"]).ToLongDateString();
            }
            LoadPreviousServiceData();
        }