コード例 #1
0
 private void metroTile2_Click(object sender, EventArgs e)
 {
     Forms.EditItem ec = new Forms.EditItem(this);
     ec.txtItemName.Text         = this.gvStock.CurrentRow.Cells[1].Value.ToString();
     ec.cmbcatname.DataSource    = new DAO().ShowCatList1();
     ec.cmbcatname.DisplayMember = "Display";
     ec.cmbcatname.ValueMember   = "CatId";
     ec.cmbcatname.Text          = new DAO().GetCatDescfromCatId(int.Parse(gvStock.CurrentRow.Cells[2].Value.ToString()));
     ec.txtReOrder.Text          = gvStock.CurrentRow.Cells[5].Value.ToString();
     ec.TxtitemPrice.Text        = this.gvStock.CurrentRow.Cells[3].Value.ToString();
     ec.txtItemQuantity.Text     = this.gvStock.CurrentRow.Cells[4].Value.ToString();
     ec.Show();
 }
コード例 #2
0
        private void metroTile2_Click(object sender, EventArgs e)
        {
            if (userRolesObj.getCheckstate("EditStock") == true)
            {
                Forms.EditItem ec = new Forms.EditItem(this);
                ec.IId = int.Parse(this.gvStock.CurrentRow.Cells[0].Value.ToString());
                ec.txtItemName.Text = this.gvStock.CurrentRow.Cells[1].Value.ToString();
                //ec.cmbcatname.DataSource = new DAO().ShowCatList1();
                //ec.cmbcatname.DisplayMember = "Display";
                //ec.cmbcatname.ValueMember = "CatId";
                //ec.cmbcatname.Text = new DAO().GetCatDescfromCatId(int.Parse(gvStock.CurrentRow.Cells[2].Value.ToString()));
                ec.txtReOrder.Text      = gvStock.CurrentRow.Cells[6].Value.ToString();
                ec.TxtitemPrice.Text    = this.gvStock.CurrentRow.Cells[3].Value.ToString();
                ec.txtItemQuantity.Text = this.gvStock.CurrentRow.Cells[2].Value.ToString();
                ec.txtitemdesc.Text     = this.gvStock.CurrentRow.Cells[7].Value.ToString();

                ec.Show();
            }
            else
            {
                MessageBox.Show("you don't have permission to enter here, Contact admin For further Details");
                return;
            }
        }