Beispiel #1
0
        public SPO(TypeofAgreementMenu tam)
        {
            InitializeComponent();
            this.tam = tam;
            MySqlConnection cnn = new MySqlConnection("server=code4cat.me; user id=jackysc; password=123456; database=procurement;SslMode=none");

            cnn.Open();
            String           query = "select * from SPO ORDER BY SPONo ASC;";
            MySqlCommand     cmd   = new MySqlCommand(query, cnn);
            MySqlDataAdapter ada   = new MySqlDataAdapter(query, cnn);
            DataTable        dt    = new DataTable();

            ada.Fill(dt);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DataRow dr = dt.Rows[i];

                ListViewItem listitem = new ListViewItem(dr["SPONo"].ToString());
                listitem.SubItems.Add(dr["SupplierNo"].ToString());
                listitem.SubItems.Add(dr["CreationDate"].ToString());
                listitem.SubItems.Add(dr["EffectiveDate"].ToString());
                listitem.SubItems.Add(dr["BuyerName"].ToString());
                listitem.SubItems.Add(dr["BillingAddress"].ToString());
                listitem.SubItems.Add(dr["BuyerAccount"].ToString());
                listitem.SubItems.Add(dr["RestNo"].ToString());
                listitem.SubItems.Add(dr["ExpectedDeliveryDate"].ToString());
                listitem.SubItems.Add(dr["TermsAndCondition"].ToString());

                listView1.Items.Add(listitem);
            }
            dateTimeCompare();
        }
        public Form1(TypeofAgreementMenu tam)
        {
            InitializeComponent();
            this.tam = tam;
            MySqlConnection cnn = new MySqlConnection("server=code4cat.me; user id=jackysc; password=123456; database=procurement;SslMode=none");

            cnn.Open();
            String           query = "select * from BlanketPurchaseAgreement ORDER BY BPANo ASC;";
            MySqlCommand     cmd   = new MySqlCommand(query, cnn);
            MySqlDataAdapter ada   = new MySqlDataAdapter(query, cnn);
            DataTable        dt    = new DataTable();

            ada.Fill(dt);
            CultureInfo arSA = new CultureInfo("ar-SA");

            arSA.DateTimeFormat.Calendar = new UmAlQuraCalendar();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DataRow dr = dt.Rows[i];

                ListViewItem listitem = new ListViewItem(dr["BPANo"].ToString());
                listitem.SubItems.Add(dr["RequestNo"].ToString());
                listitem.SubItems.Add(dr["PurchaseOrderRevision"].ToString());
                listitem.SubItems.Add(dr["CreationDate"].ToString());
                listitem.SubItems.Add(dr["EffectiveDate"].ToString());
                listitem.SubItems.Add(dr["BuyerName"].ToString());
                listitem.SubItems.Add(dr["BillingAddress"].ToString());
                listitem.SubItems.Add(dr["AmountAgreed"].ToString());
                listitem.SubItems.Add(dr["Currency"].ToString());
                listitem.SubItems.Add(dr["TermsAndCondition"].ToString());
                listitem.SubItems.Add(dr["SupplierNo"].ToString());

                listView1.Items.Add(listitem);
            }

            DateTime now = DateTime.Now;
            DateTime effectiveDate;
            int      datecompare;

            for (int i = 0; i < listView1.Items.Count; i++)
            {
                effectiveDate = DateTime.Parse(listView1.Items[i].SubItems[4].Text);
                datecompare   = DateTime.Compare(now, effectiveDate);
                if (datecompare > 0)
                {
                    listView1.Items[i].BackColor = Color.Yellow;
                }
                else
                {
                    continue;
                }
            }
            //textBox1.Text = datecompare.ToString();
        }
Beispiel #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            switch (deptCode)
            {
            case "AM":
                this.Hide();
                EditMenu em = new EditMenu(this, 0);
                em.Show();
                break;

            case "RM":
                this.Hide();
                PurchaseRequest pr = new PurchaseRequest(this, restNo, StaffNo);
                pr.Show();
                break;

            case "PM":
                this.Hide();
                TypeofAgreementMenu tam = new TypeofAgreementMenu(staffName, this);
                tam.Show();
                break;

            case "CM":
                this.Hide();
                Category cat = new Category(this);
                cat.Show();
                break;

            case "WC":
                this.Hide();
                WHViewDPI dpi = new WHViewDPI(this);
                dpi.Show();
                break;

            case "AD":
                this.Hide();
                TypeofAgreementMenu adtam = new TypeofAgreementMenu(staffName, this);
                adtam.Show();
                break;
            }
        }