public DepartmentEntityDC SaveDepertment(DepartmentEntityDC DepartmentEntityDC) { //AccountListEntityDC MemberListEntityDC = new AccountListEntityDC(); AccountsServiceSoapClient membersrv = new AccountsServiceSoapClient(); return(membersrv.SaveDepertment(DepartmentEntityDC)); }
public DepartmentEntityDC SaveDepertment(DepartmentEntityDC DepartmentEntityDC) { DepartmentEntityDC productResponse = new DepartmentEntityDC(); // AccountEntityDC member = new AccountEntityDC(); AccountDAL memberDAL = new AccountDAL(); productResponse = memberDAL.SaveDepertment(DepartmentEntityDC); return(productResponse); }
public DepartmentEntityDC SaveDepertment(DepartmentEntityDC DepartmentEntityDC) { int Count = 0; AccountManager member = new AccountManager(); DepartmentEntityDC ListAccount = new DepartmentEntityDC(); ListAccount = member.SaveDepertment(DepartmentEntityDC); return(ListAccount); }
public DepartmentListEntityDC GetAllDepartment() { DepartmentListEntityDC Accounts = new DepartmentListEntityDC(); List <DepartmentEntityDC> AccountList = new List <DepartmentEntityDC>(); using (DbConnection conn = Jaqen.CreateConnection()) { conn.Open(); try { using (DbCommand sprocCmd = conn.CreateCommand()) { sprocCmd.CommandType = CommandType.StoredProcedure; sprocCmd.CommandText = GET_ALL_DEPARTMENT; using (IDataReader sprocReader = Jaqen.ExecuteReader(sprocCmd)) { while (sprocReader.Read()) { DepartmentEntityDC Account = new DepartmentEntityDC(); Account.DepartmentID = sprocReader["DepartmentID"].ToInt(); Account.DepartmentName = sprocReader["DepartmentName"].ToStringDefault(); AccountList.Add(Account); } } Accounts.DepartmentList = AccountList; } } catch (Exception ex) { throw ex; } finally { if (conn != null) { conn.Close(); } } } return(Accounts); }
public DepartmentEntityDC SaveDepertment(DepartmentEntityDC parent) { int AffiliationID = 0; using (DbConnection conn = Jaqen.CreateConnection()) { conn.Open(); try { using (DbCommand sprocCmd = conn.CreateCommand()) { sprocCmd.CommandType = CommandType.StoredProcedure; sprocCmd.CommandText = SAVE_DEPARTMENT; sprocCmd.Parameters.Add(new SqlParameter("@DepartmentName", parent.DepartmentName.ToDatabaseObj()) { SqlDbType = SqlDbType.NVarChar }); using (IDataReader sprocReader = Jaqen.ExecuteReader(sprocCmd)) { while (sprocReader.Read()) { AffiliationID = sprocReader["DepartmentID"].ToInt(); // parent.AccountID = AccountID; } } } } catch (Exception ex) { throw ex; } finally { if (conn != null) { conn.Close(); } } } return(parent); }