Ejemplo n.º 1
0
 private void SaveBranch()
 {
     if (String.IsNullOrEmpty(id.Text))
     {
         data.Insert(new Branch(0, name.Text));
     }
     else
     {
         Branch branch = branches[current];
         branch.Name = name.Text;
         data.Update(branches[current]);
     }
 }
 protected override void SaveMaintained()
 {
     if (String.IsNullOrEmpty(Form.id.Text))
     {
         data.Insert(new Branch(0, Form.name.Text));
     }
     else
     {
         Branch branch = Current();
         branch.Name = Form.name.Text;
         data.Update(Current());
     }
 }
Ejemplo n.º 3
0
        private void SaveBranch()
        {
            IDbCommand command = new SqlCommand();////SqlCommand command = new SqlCommand();

            ////if (id.Text.Equals(""))
            if (string.IsNullOrEmpty(id.Text))
            {
                ////strSql = insertBranchSql;//Create Sql String with parameter @SelectedLP
                data.Insert(new Branch(0, name.Text));
            }
            else
            {
                ////strSql = updateBranchSql;
                Branch branch = branches[currentRowIndex];
                branch.Name = name.Text;
                data.Update(branches[currentRowIndex]);
            }
        }