Example #1
0
        private void cboScheme_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (cboScheme.SelectedValue != null)
                {
                    DAL.ShareScheme obj = new DAL.ShareScheme();
                    obj.connectionstring = objDAL.connectionstring;
                    DataTable dt = obj.getRecord(" AND SchemeID=" + cboScheme.SelectedValue);

                    txtTotalShares.Text = dt.Rows[0]["TotalShares"].ToString();
                    txtSharePrice.Text  = decimal.Parse(dt.Rows[0]["PerShareValue"].ToString()).ToString("G29");
                    txtAvailable.Text   = obj.getAvailableShares(int.Parse(cboScheme.SelectedValue.ToString())).ToString();
                }
                else
                {
                    txtTotalShares.Text = string.Empty;
                    txtSharePrice.Text  = string.Empty;
                    txtAvailable.Text   = string.Empty;
                }
            }
            catch (Exception exc)
            {
                Message.ShowMessage(MyMessages.MessageType.Error, exc.Message);
            }
        }
Example #2
0
        private void LoadGrid()
        {
            try
            {
                //Grid.Rows.Clear();
                string vWhere = string.Empty;
                if (!string.IsNullOrEmpty(txtFilter.Text))
                {
                    vWhere = " AND SchemeTitle Like '%" + txtFilter.Text + "%'";
                }

                DataTable dt = objDAL.getRecord(vWhere);
                Grid.AutoGenerateColumns = false;
                Grid.DataSource          = dt;
            }
            catch (Exception exc)
            {
                Message.ShowMessage(MyMessages.MessageType.Error, exc.Message);
            }
        }
Example #3
0
        private void LoadSchemes()
        {
            try
            {
                DAL.ShareScheme obj = new DAL.ShareScheme();
                obj.connectionstring = objDAL.connectionstring;
                DataTable dt = obj.getRecord("");

                cboScheme.DisplayMember = "SchemeTitle";
                cboScheme.ValueMember   = "SchemeID";
                cboScheme.DataSource    = dt;
            }
            catch (Exception exc)
            {
                Message.ShowMessage(MyMessages.MessageType.Error, exc.Message);
            }
        }