Exemplo n.º 1
0
        //**********************************************************************************
        public SqlCommand EditOneBranches(Branches_Info objBranches_Info)
        {
            SqlCommand command = new SqlCommand("Update Branches Set Name= @Name Where ID= @ID");

            command.CommandType = CommandType.Text;
            command.Parameters.Add("@ID", SqlDbType.NVarChar, 25).Value    = objBranches_Info.ID;
            command.Parameters.Add("@Name", SqlDbType.NVarChar, 135).Value = objBranches_Info.Name;
            this.AddCommand(command);
            return(command);
        }
Exemplo n.º 2
0
        public SqlCommand CreateOneBranches(Branches_Info objBranches_Info)
        {
            SqlCommand command = new SqlCommand("INSERT INTO Branches(ID, Name) VALUES (@ID, @Name)");

            command.CommandType = CommandType.Text;
            command.Parameters.Add("@ID", SqlDbType.NVarChar, 25).Value    = objBranches_Info.ID;
            command.Parameters.Add("@Name", SqlDbType.NVarChar, 135).Value = objBranches_Info.Name;
            this.AddCommand(command);
            return(command);
        }
Exemplo n.º 3
0
 protected int Delete(Branches_Info obj)
 {
     if (obj == null)
     {
         throw new Exception("Invalid data input");
     }
     _dalBranch.RemoveOneBranches(obj.ID);
     if (_dalBranch.Execute())
     {
         return(_dalBranch.LastRecordsEffected);
     }
     else
     {
         throw _dalBranch.GetException;
     }
 }
Exemplo n.º 4
0
        private Branches_Info GenerateObj(DataRow ordBranches)
        {
            if (ordBranches == null)
            {
                throw new Exception("");
            }
            Branches_Info objBranches_Info = new Branches_Info();

            if (ordBranches["ID"] != DBNull.Value)
            {
                objBranches_Info.ID = Convert.ToString(ordBranches["ID"]);
            }
            if (ordBranches["Name"] != DBNull.Value)
            {
                objBranches_Info.Name = Convert.ToString(ordBranches["Name"]);
            }
            return(objBranches_Info);
        }
Exemplo n.º 5
0
 public static int Update(Branches_Info obj)
 {
     return(dal_branch.Update(obj.ID, obj.Name));
 }
Exemplo n.º 6
0
 public static int Insert(Branches_Info obj)
 {
     return(dal_branch.Insert(obj.ID, obj.Name));
 }