Beispiel #1
0
        private void LoadGrid()
        {
            try
            {
                {
                    //Grid.Rows.Clear();
                    string vWhere = string.Empty;
                    if (!string.IsNullOrEmpty(TxtFilter.Text))
                    {
                        vWhere = " AND Parties.PartyName Like '%" + TxtFilter.Text + "%'";
                    }
                    vWhere += "and  PartyID like '61%' ";



                    DataTable dt = objDAL.getRecord(vWhere);
                    Grid.AutoGenerateColumns = false;
                    Grid.DataSource          = dt;
                }
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);
            }
        }
Beispiel #2
0
        private void LoadGrid()
        {
            try
            {
                //Grid.Rows.Clear();
                string vWhere = string.Empty;
                if (!string.IsNullOrEmpty(txtFilter.Text))
                {
                    vWhere = " AND Parties.PartyName Like '%" + txtFilter.Text + "%'";
                }

                DataTable dt = objDAL.getRecord(vWhere);
                Grid.AutoGenerateColumns = false;
                Grid.DataSource          = dt;
            }
            catch (Exception exc)
            {
                Message.ShowMessage(MyMessages.MessageType.Error, exc.Message);
            }
        }
        private void cmdSelect_Click(object sender, RoutedEventArgs e)
        {
            txtId.Text = "32";
            DataTable dt = objDAL.getRecord(" AND PartyID=" + txtId.Text);
            txtId.Tag = dt.Rows[0]["AccountID"].ToString();
            txtName.Text = dt.Rows[0]["PartyName"].ToString();
            txtCNIC.Text = dt.Rows[0]["CNICNo"].ToString();
            txtContactNo.Text = dt.Rows[0]["ContactNo"].ToString();
            txtCity.Text = dt.Rows[0]["City"].ToString();
            txtEmail.Text = dt.Rows[0]["Email"].ToString();
            txtWeb.Text = dt.Rows[0]["Web"].ToString();
            txtNTN.Text = dt.Rows[0]["NTN"].ToString();
            txtAddress.Text = dt.Rows[0]["Address"].ToString();
            txtId.Tag = dt.Rows[0]["AccountID"].ToString();
            //chkSupplier.Checked = Convert.ToBoolean(dt.Rows[0]["IsSupplier"].ToString());
            //chkCustomer.Checked = Convert.ToBoolean(dt.Rows[0]["IsCustomer"].ToString());

            txtOpDebit.Text = decimal.Parse(dt.Rows[0]["OpeningDebit"].ToString()).ToString("G29");
            txtOpCredit.Text = decimal.Parse(dt.Rows[0]["OpeningCredit"].ToString()).ToString("G29");
        }
Beispiel #4
0
        private void TxtCustomerID_TextChanged(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(TxtCustomerID.Text))
            {
                TxtCustomerName.Text = string.Empty;
            }
            else
            {
                string vWhere = string.Empty;
                vWhere = "AND Parties.PartyID = " + TxtCustomerID.Text;
                DAL.Parties obj = new DAL.Parties();

                obj.connectionstring = objDAL.connectionstring; //System.Configuration.ConfigurationSettings.GetConfig(string).ConnectionStrings["MyString"].ConnectionString;
                //DataTable dt = obj.getParties(vWhere);
                DataTable dt = obj.getRecord(vWhere);

                if (dt.Rows.Count > 0)
                {
                    TxtCustomerID.Text   = dt.Rows[0]["PartyID"].ToString();   // vForm.MyID;
                    TxtCustomerName.Text = dt.Rows[0]["PartyName"].ToString(); // vForm.MyName;
                }
            }
        }