public AccountEntityDC SaveAccount(AccountEntityDC member) { AccountManager Manager = new AccountManager(); member = Manager.SaveAccount(member); return(member); }
public AccountEntityDC SaveAccount(AccountEntityDC member) { AccountDAL memberDAL = new AccountDAL(); member = memberDAL.SaveAccount(member); return(member); }
public AccountListEntityDC GetAccountByID(Guid AccountID) { AccountListEntityDC Accounts = new AccountListEntityDC(); List <AccountEntityDC> AccountList = new List <AccountEntityDC>(); using (DbConnection conn = Jaqen.CreateConnection()) { conn.Open(); try { using (DbCommand sprocCmd = conn.CreateCommand()) { sprocCmd.CommandType = CommandType.StoredProcedure; sprocCmd.CommandText = GET_ACCOUNT_BY_ID; sprocCmd.Parameters.Add(new SqlParameter("@AccountID", AccountID.ToGuid()) { SqlDbType = SqlDbType.UniqueIdentifier }); using (IDataReader sprocReader = Jaqen.ExecuteReader(sprocCmd)) { while (sprocReader.Read()) { AccountEntityDC Account = new AccountEntityDC(); Account.AccountID = sprocReader["AccountID"].ToGuid(); Account.AccountName = sprocReader["AccountName"].ToStringDefault(); Account.Branch = sprocReader["Branch"].ToStringDefault(); Account.EmailAddress = sprocReader["EmailAddress"].ToStringDefault(); Account.TelephoneNumber = sprocReader["TelephoneNumber"].ToStringDefault(); Account.Address = sprocReader["Address"].ToStringDefault(); Account.MobileNumber = sprocReader["MobileNumber"].ToString(); Account.CreatedBy = sprocReader["CreatedBy"].ToStringDefault(); Account.CreatedDate = sprocReader["CreatedDate"].ToStringDefault(); Account.UpdatedBy = sprocReader["UpdatedBy"].ToStringDefault(); Account.UpdatedDate = sprocReader["UpdatedDate"].ToStringDefault(); AccountList.Add(Account); } } Accounts.AccountList = AccountList; } } catch (Exception ex) { throw ex; } finally { if (conn != null) { conn.Close(); } } } return(Accounts); }
public AccountListEntityDC GetAllAccountMemberCount(string Search, int PageIndex, int PageSize, out int Count) { AccountListEntityDC productResponse = new AccountListEntityDC(); AccountEntityDC member = new AccountEntityDC(); AccountDAL memberDAL = new AccountDAL(); productResponse = memberDAL.GetAllAccountMemberCount(Search, PageIndex, PageSize, out Count); return(productResponse); }
public AccountListEntityDC GetAccountByID(Guid AccountID) { AccountListEntityDC productResponse = new AccountListEntityDC(); AccountEntityDC member = new AccountEntityDC(); AccountDAL memberDAL = new AccountDAL(); productResponse = memberDAL.GetAccountByID(AccountID); return(productResponse); }
public ActionResult SaveAccount(AccountModel model) { ViewBag.user = global; // try // { string id = model.Account.AccountID.ToString(); var result = Regex.Replace(id, @"{}", string.Empty); // Guid AcctID = result.ToString(); AccountBLL AccountBLL = new AccountBLL(); AccountEntityDC data = new AccountEntityDC(); data.AccountID = result.ToGuid(); data.AccountName = model.Account.AccountName; data.Branch = model.Account.Branch; data.Address = model.Account.Address; data.EmailAddress = model.Account.EmailAddress; data.TelephoneNumber = model.Account.TelephoneNumber; data.MobileNumber = model.Account.MobileNumber; data.CreatedBy = global.GlobalUserName; return(Json(AccountBLL.SaveAccount(data), JsonRequestBehavior.AllowGet)); // } //catch (Exception e) //{ // ////// resultmessageDC result = new ResultMessageDC() // //// // { // //// Code = "400", // //// Description = e.Message // //// // }; // // return Json(result, JsonRequestBehavior.AllowGet); //} }
public AccountEntityDC SaveAccount(AccountEntityDC member) { AccountsServiceSoapClient membersrv = new AccountsServiceSoapClient(); return(membersrv.SaveAccount(member)); }
public AccountListEntityDC GetAllAccount(string Search, int PageIndex, int PageSize, out int Count) { AccountListEntityDC Accounts = new AccountListEntityDC(); List <AccountEntityDC> AccountList = new List <AccountEntityDC>(); using (DbConnection conn = Jaqen.CreateConnection()) { conn.Open(); try { using (DbCommand sprocCmd = conn.CreateCommand()) { sprocCmd.CommandType = CommandType.StoredProcedure; sprocCmd.CommandText = GET_ALL_ACCOUNT; sprocCmd.Parameters.Add(new SqlParameter("@Search", Search.ToStringDefault()) { SqlDbType = SqlDbType.NVarChar }); sprocCmd.Parameters.Add(new SqlParameter("@PageIndex", PageIndex.ToInt()) { SqlDbType = SqlDbType.Int }); sprocCmd.Parameters.Add(new SqlParameter("@PageSize", PageSize.ToInt()) { SqlDbType = SqlDbType.Int }); var CountResult = sprocCmd.CreateParameter(); CountResult.ParameterName = "@Count"; CountResult.Direction = ParameterDirection.Output; CountResult.DbType = DbType.Int32; sprocCmd.Parameters.Add(CountResult); using (IDataReader sprocReader = Jaqen.ExecuteReader(sprocCmd)) { while (sprocReader.Read()) { AccountEntityDC Account = new AccountEntityDC(); Account.AccountID = sprocReader["AccountID"].ToGuid(); Account.AccountName = sprocReader["AccountName"].ToStringDefault(); Account.Branch = sprocReader["Branch"].ToStringDefault(); Account.EmailAddress = sprocReader["EmailAddress"].ToStringDefault(); Account.TelephoneNumber = sprocReader["TelephoneNumber"].ToStringDefault(); Account.Address = sprocReader["Address"].ToStringDefault(); Account.Counts = sprocReader["Counts"].ToStringDefault(); Account.MobileNumber = sprocReader["MobileNumber"].ToString(); Account.CreatedBy = sprocReader["CreatedBy"].ToStringDefault(); Account.CreatedDate = sprocReader["CreatedDate"].ToStringDefault(); Account.UpdatedBy = sprocReader["UpdatedBy"].ToStringDefault(); Account.UpdatedDate = sprocReader["UpdatedDate"].ToStringDefault(); AccountList.Add(Account); } } Accounts.AccountList = AccountList; Count = CountResult.Value.ToInt(); } } catch (Exception ex) { throw ex; } finally { if (conn != null) { conn.Close(); } } } return(Accounts); }
public AccountEntityDC SaveAccount(AccountEntityDC parent) { Guid AccountID = Guid.Empty; using (DbConnection conn = Jaqen.CreateConnection()) { conn.Open(); try { using (DbCommand sprocCmd = conn.CreateCommand()) { sprocCmd.CommandType = CommandType.StoredProcedure; sprocCmd.CommandText = SAVE_ACCOUNT; sprocCmd.Parameters.Add(new SqlParameter("@AccountID", parent.AccountID.ToGuid()) { SqlDbType = SqlDbType.UniqueIdentifier }); sprocCmd.Parameters.Add(new SqlParameter("@AccountName", parent.AccountName.ToDatabaseObj()) { SqlDbType = SqlDbType.NVarChar }); sprocCmd.Parameters.Add(new SqlParameter("@Branch", parent.Branch.ToDatabaseObj()) { SqlDbType = SqlDbType.NVarChar }); sprocCmd.Parameters.Add(new SqlParameter("@Address", parent.Address.ToDatabaseObj()) { SqlDbType = SqlDbType.NVarChar }); sprocCmd.Parameters.Add(new SqlParameter("@EmailAddress", parent.EmailAddress.ToDatabaseObj()) { SqlDbType = SqlDbType.NVarChar }); sprocCmd.Parameters.Add(new SqlParameter("@TelephoneNumber", parent.TelephoneNumber.ToDatabaseObj()) { SqlDbType = SqlDbType.NVarChar }); sprocCmd.Parameters.Add(new SqlParameter("@MobileNumber", parent.MobileNumber.ToDatabaseObj()) { SqlDbType = SqlDbType.NVarChar }); sprocCmd.Parameters.Add(new SqlParameter("@CreatedBy", parent.CreatedBy.ToDatabaseObj()) { SqlDbType = SqlDbType.NVarChar }); using (IDataReader sprocReader = Jaqen.ExecuteReader(sprocCmd)) { while (sprocReader.Read()) { AccountID = sprocReader["AccountID"].ToGuid(); parent.AccountID = AccountID; } } } } catch (Exception ex) { throw ex; } finally { if (conn != null) { conn.Close(); } } } return(parent); }