示例#1
0
 private void frmLedgerNew_Load(object sender, EventArgs e)
 {
     DAL.City ct = new DAL.City();
     DAL.Head h  = new DAL.Head();
     cmbCity.Source(ct.Select());
     cmbHead.Source(h.Select());
 }
 private void frmHeadnew_Load(object sender, EventArgs e)
 {
     DAL.Head head = new DAL.Head();
     cmbHead.Source(head.Select());
     this.MinimumSize = Size;
     this.MaximumSize = Size;
 }
示例#3
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            int er = 0;

            if (txtName.Text == "")
            {
                er++;
                ep.SetError(txtName, "Required");
            }
            if (er > 0)
            {
                return;
            }
            DAL.Head head = new DAL.Head();
            head.Name        = txtName.Text;
            head.Description = txtDescription.Text;
            if (cmbHead.SelectedValue != null && cmbHead.SelectedValue.ToString() != "")
            {
                head.HeadId = Convert.ToInt32(cmbHead.SelectedValue);
            }
            if (head.Insert())
            {
                MessageBox.Show("Data Saved");
                txtName.Text          = "";
                txtDescription.Text   = "";
                cmbHead.SelectedValue = -1;
                txtName.Focus();
            }
            else
            {
                MessageBox.Show(head.Error);
            }
        }
        private void addChild(int pid, TreeNode tn)
        {
            DAL.Head  head = new DAL.Head();
            DataTable dt   = head.Select(" where h1.headId = " + pid.ToString()).Tables[0];

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                TreeNode tn2 = new TreeNode();
                tn2.Text = dt.Rows[i].ItemArray[1].ToString();
                tn2.Tag  = dt.Rows[i].ItemArray[0].ToString();
                addChild(Convert.ToInt32(dt.Rows[i].ItemArray[0]), tn2);
                tn.Nodes.Add(tn2);
            }
        }
        private void frmHead_Load(object sender, EventArgs e)
        {
            DAL.Head  head = new DAL.Head();
            DataTable dt   = head.Select(" where h1.headId is null ").Tables[0];

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                TreeNode tn = new TreeNode();
                tn.Text = dt.Rows[i].ItemArray[1].ToString();
                tn.Tag  = dt.Rows[i].ItemArray[0].ToString();
                addChild(Convert.ToInt32(dt.Rows[i].ItemArray[0]), tn);
                tvHead.Nodes.Add(tn);
            }
        }
 private void btnSearch_Click(object sender, EventArgs e)
 {
     DAL.Head head = new DAL.Head();
     dgvHead.DataSource = head.Select().Tables[0];
 }
 private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     DAL.Head head = new DAL.Head();
     cmbHead.Source(head.Select());
 }
示例#8
0
 private void frmHeadNew_Load(object sender, EventArgs e)
 {
     DAL.Head head = new DAL.Head();
     cmbHead.Source(head.Select());
 }