public static Entity.EmployeeMaster GetById(int employeeId) { using (DataManager oDm = new DataManager()) { oDm.CommandType = CommandType.StoredProcedure; oDm.Add("@EmployeeId", SqlDbType.Int, ParameterDirection.Input, employeeId); SqlDataReader dr = oDm.ExecuteReader("EmployeeMaster_GetById"); Entity.EmployeeMaster employeeMaster = new Entity.EmployeeMaster(); if (dr.HasRows) { while (dr.Read()) { employeeMaster.EmployeeId = employeeId; employeeMaster.FName = (dr[1] == DBNull.Value) ? "" : dr[1].ToString(); employeeMaster.LName = (dr[2] == DBNull.Value) ? "" : dr[2].ToString(); employeeMaster.Email = (dr[3] == DBNull.Value) ? "" : dr[3].ToString(); employeeMaster.ContactNo = (dr[4] == DBNull.Value) ? "" : dr[4].ToString(); employeeMaster.BranchId = (dr[5] == DBNull.Value) ? 0 : int.Parse(dr[5].ToString()); employeeMaster.DesignationId = (dr[6] == DBNull.Value) ? 0 : int.Parse(dr[6].ToString()); employeeMaster.Status = (dr[7] == DBNull.Value) ? false : Convert.ToBoolean(dr[7]); employeeMaster.Password = (dr[8] == DBNull.Value) ? "" : dr[8].ToString(); employeeMaster.Address = (dr[9] == DBNull.Value) ? "" : dr[9].ToString(); } } return(employeeMaster); } }
public static Entity.AgentMaster GetAgentMasterById(int agentId) { using (DataManager oDm = new DataManager()) { oDm.CommandType = CommandType.StoredProcedure; oDm.Add("@pAgentId", SqlDbType.Int, ParameterDirection.Input, agentId); SqlDataReader dr = oDm.ExecuteReader("AgentMaster_GetById"); Entity.AgentMaster agentMaster = new Entity.AgentMaster(); if (dr.HasRows) { while (dr.Read()) { agentMaster.AgentId = agentId; agentMaster.Name = (dr[1] == DBNull.Value) ? "" : dr[1].ToString(); agentMaster.Email = (dr[2] == DBNull.Value) ? "" : dr[2].ToString(); agentMaster.ContactNo = (dr[3] == DBNull.Value) ? "" : dr[3].ToString(); agentMaster.Password = (dr[4] == DBNull.Value) ? "" : dr[4].ToString(); } } return(agentMaster); } }
public static int PaymentFailure(int TransactionId) { using (DataManager oDm = new DataManager()) { oDm.CommandType = CommandType.StoredProcedure; oDm.Add("@pTransactionId", SqlDbType.Int, TransactionId); SqlDataReader dr = oDm.ExecuteReader("PaymentFailure"); int Result = 0; if (dr.HasRows) { while (dr.Read()) { Result = Convert.ToInt32((dr["Result"] == DBNull.Value) ? "" : dr["Result"]); } } return(Result); } }
public static string GetPaymentDetailsByTransactionId(int TransactionId) { using (DataManager oDm = new DataManager()) { oDm.CommandType = CommandType.StoredProcedure; oDm.Add("@pTransactionId", SqlDbType.Int, TransactionId); SqlDataReader dr = oDm.ExecuteReader("PaymentDetails_GetByTransactionId"); string Amount = ""; if (dr.HasRows) { while (dr.Read()) { Amount = (dr["Amount"] == DBNull.Value) ? "" : dr["Amount"].ToString(); } } return(Amount); } }
public static Entity.Payment GetMemberDetailsByMemberId(int MemberId) { using (DataManager oDm = new DataManager()) { oDm.CommandType = CommandType.StoredProcedure; oDm.Add("@pMemberId", SqlDbType.Int, MemberId); SqlDataReader dr = oDm.ExecuteReader("MemberDetails_GetById"); Entity.Payment pm = new Entity.Payment(); if (dr.HasRows) { while (dr.Read()) { pm.MemberId = MemberId; pm.FName = (dr["MemberName"] == DBNull.Value) ? "" : dr["MemberName"].ToString(); pm.Email = (dr["Email"] == DBNull.Value) ? "" : dr["Email"].ToString(); pm.Mobile = (dr["MobileNo"] == DBNull.Value) ? "" : dr["MobileNo"].ToString(); } } return(pm); } }
public static Entity.Member GetAllById(int MemberId) { using (DataManager oDm = new DataManager()) { oDm.CommandType = CommandType.StoredProcedure; oDm.Add("@pMemberId", SqlDbType.Int, ParameterDirection.Input, MemberId); SqlDataReader dr = oDm.ExecuteReader("usp_Merchant_GetAllById"); Entity.Member EntityMember = new Entity.Member(); if (dr.HasRows) { while (dr.Read()) { EntityMember.MemberId = MemberId; EntityMember.MemberName = (dr[1] == DBNull.Value) ? "" : dr[1].ToString(); EntityMember.FormNo = (dr[2] == DBNull.Value) ? "" : dr[2].ToString(); EntityMember.FirmName = (dr[3] == DBNull.Value) ? "" : dr[3].ToString(); EntityMember.Address = (dr[4] == DBNull.Value) ? "" : dr[4].ToString(); EntityMember.BlockName = (dr[5] == DBNull.Value) ? "" : dr[5].ToString(); EntityMember.DistrictId = (dr[6] == DBNull.Value) ? 0 : int.Parse(dr[6].ToString()); EntityMember.Pin = (dr[7] == DBNull.Value) ? "" : dr[7].ToString(); EntityMember.MobileNo = (dr[8] == DBNull.Value) ? "" : dr[8].ToString(); EntityMember.LandLine = (dr[9] == DBNull.Value) ? "" : dr[9].ToString(); EntityMember.StartDate = (dr[10] == DBNull.Value) ? DateTime.MinValue : DateTime.Parse(dr[10].ToString()); EntityMember.EndDate = (dr[11] == DBNull.Value) ? DateTime.MinValue : DateTime.Parse(dr[11].ToString()); EntityMember.IsLifeMembership = (dr[12] == DBNull.Value) ? false : bool.Parse(dr[12].ToString()); EntityMember.LifeMembershipAmt = (dr[13] == DBNull.Value) ? 0 : decimal.Parse(dr[13].ToString()); EntityMember.IsYearlySMSSubscriber = (dr[14] == DBNull.Value) ? false : bool.Parse(dr[14].ToString()); EntityMember.SMSSubscriberAmt = (dr[15] == DBNull.Value) ? 0 : decimal.Parse(dr[15].ToString()); EntityMember.IsPortalMember = (dr[16] == DBNull.Value) ? false : bool.Parse(dr[16].ToString()); EntityMember.PortalMemberAmt = (dr[17] == DBNull.Value) ? 0 : decimal.Parse(dr[17].ToString()); } } return(EntityMember); } }
public static Entity.AgentMaster AuthenticateUser(string Email) { using (DataManager oDm = new DataManager()) { oDm.Add("@Email", SqlDbType.VarChar, 50, Email); oDm.CommandType = CommandType.StoredProcedure; SqlDataReader dr = oDm.ExecuteReader("GetUserNameAndPass_Customer"); Entity.AgentMaster agent = new Entity.AgentMaster(); if (dr.HasRows) { while (dr.Read()) { agent.AgentId = (dr[0] == DBNull.Value) ? 0 : Convert.ToInt32(dr[0].ToString()); agent.Email = (dr[1] == DBNull.Value) ? "" : dr[1].ToString(); agent.Password = (dr[2] == DBNull.Value) ? "" : dr[2].ToString(); agent.Name = (dr[3] == DBNull.Value) ? "" : dr[3].ToString(); } return(agent); } return(null); } }
public static Entity.EmployeeMaster AuthenticateUser(string Email) { using (DataManager oDm = new DataManager()) { oDm.Add("@Email", SqlDbType.VarChar, 50, Email); oDm.CommandType = CommandType.StoredProcedure; SqlDataReader dr = oDm.ExecuteReader("GetUserNameAndPass"); Entity.EmployeeMaster Employee = new Entity.EmployeeMaster(); if (dr.HasRows) { while (dr.Read()) { Employee.EmployeeId = (dr[0] == DBNull.Value) ? 0 : Convert.ToInt32(dr[0].ToString()); Employee.DesignationId = (dr[1] == DBNull.Value) ? 0 : Convert.ToInt32(dr[1].ToString()); Employee.Email = (dr[2] == DBNull.Value) ? "" : dr[2].ToString(); Employee.Password = (dr[3] == DBNull.Value) ? "" : dr[3].ToString(); Employee.Roles = (dr[4] == DBNull.Value) ? "" : dr[4].ToString(); } return(Employee); } return(null); } }