public RMConfirmDN(ViewDeliveryNoteMenu m, String DNId, String status)
        {
            InitializeComponent();
            this.m      = m;
            this.DNId   = DNId;
            this.status = status;
            cnn.Open();
            MySqlDataAdapter sda = new MySqlDataAdapter("SELECT DN.ItemID, ItemName, ItemDescription, Quantity, Quantity as Arrived FROM DeliveryNote DN, Item I WHERE DN.ItemID=I.ItemID and DeliveryID = '" + DNId + "';", cnn);

            if (status.Equals("COM") || status.Equals("DNC"))
            {
                btnGen.Enabled = false;
                sda            = new MySqlDataAdapter("SELECT DN.ItemID, ItemName, ItemDescription, Quantity, ArrivedQty as Arrived FROM DeliveryNote DN, Item I WHERE DN.ItemID=I.ItemID and DeliveryID = '" + DNId + "';", cnn);
            }
            DataTable dt = new DataTable();

            sda.Fill(dt);
            dGVItem.DataSource = dt;
            MySqlDataAdapter getDNInfo = new MySqlDataAdapter("SELECT DeliveryID, dn.RequestNo, DesID, dn.CreationDate, DeliveryDate From DeliveryNote dn, PurchaseRequest pr Where dn.RequestNo=pr.RequestNo and DeliveryID = '" + DNId + "';", cnn);
            DataTable        DNInfo    = new DataTable();

            getDNInfo.Fill(DNInfo);
            cnn.Close();
            lbDID.Text          = DNInfo.Rows[0][0].ToString();
            lbRNo.Text          = DNInfo.Rows[0][1].ToString();
            lbDesId.Text        = DNInfo.Rows[0][2].ToString();
            lbCreationDate.Text = Convert.ToDateTime(DNInfo.Rows[0][3]).ToString("dd-MM-yyyy");
            lbDeliveryDate.Text = Convert.ToDateTime(DNInfo.Rows[0][4]).ToString("dd-MM-yyyy");
            lbStatus.Text       = status;
            rno = lbRNo.Text;
            btnUpdate.Enabled = false;
        }
Пример #2
0
        public WHUpdateDN(ViewDeliveryNoteMenu m, String DNId, String status)
        {
            InitializeComponent();
            this.m      = m;
            this.DNId   = DNId;
            this.status = status;
            cnn.Open();
            MySqlDataAdapter sda = new MySqlDataAdapter("SELECT DN.ItemID, ItemName, ItemDescription, Quantity as quantity, ArrivedQty as arrived FROM DeliveryNote DN, Item I WHERE DN.ItemID=I.ItemID and DeliveryID = '" + DNId + "';", cnn);
            DataTable        dt  = new DataTable();

            sda.Fill(dt);
            dGVItem.DataSource = dt;
            MySqlDataAdapter getDNInfo = new MySqlDataAdapter("SELECT DeliveryID, RequestNo, DesID, CreationDate From DeliveryNote Where DeliveryID = '" + DNId + "';", cnn);
            DataTable        DNInfo    = new DataTable();

            getDNInfo.Fill(DNInfo);
            cnn.Close();
            lbDID.Text          = DNInfo.Rows[0][0].ToString();
            lbRNo.Text          = DNInfo.Rows[0][1].ToString();
            lbDesId.Text        = DNInfo.Rows[0][2].ToString();
            lbCreationDate.Text = DNInfo.Rows[0][3].ToString();
            lbStatus.Text       = status;
            rno = lbRNo.Text;
            btnUpdate.Enabled = false;
            Dictionary <String, String> comboSource = new Dictionary <String, String>();

            comboSource.Add("1", "DLI");
            comboSource.Add("2", "COM");
            comboSource.Add("3", "DNC");
            comboSource.Add("4", "CAN");
            cbStatus.DataSource    = new BindingSource(comboSource, null);
            cbStatus.DisplayMember = "Value";
            cbStatus.ValueMember   = "Key";
            MySqlDataAdapter getRest  = new MySqlDataAdapter("Select RestName, RestAddress From PurchaseRequest pr, Restaurant r where RequestNo = '" + rno + "' and pr.restNo=r.restNo;", cnn);
            DataTable        restInfo = new DataTable();

            getRest.Fill(restInfo);
            lbRName.Text = restInfo.Rows[0][0].ToString();
            lbAddress.AppendText(restInfo.Rows[0][1].ToString());
        }
Пример #3
0
        private void btn2_Click(object sender, EventArgs e)
        {
            switch (deptCode)
            {
            case "PM":
                this.Hide();
                PRMapping prm = new PRMapping(this);
                prm.Show();
                break;

            case "RM":
                this.Hide();
                ViewDeliveryNoteMenu vDN = new ViewDeliveryNoteMenu(this, "RM", restNo);
                vDN.Show();
                break;

            case "AD":
            case "WC":
                this.Hide();
                ViewDeliveryNoteMenu WHvDN = new ViewDeliveryNoteMenu(this, "WC");
                WHvDN.Show();
                break;

            case "AM":
                this.Hide();
                EditMenu em = new EditMenu(this, 1);
                em.Show();
                break;

            case "CM":
                this.Hide();
                Item itm = new Item(this);
                itm.Show();
                break;
            }
        }