public string SignUp(ClsUserDetails ObjUser) { using (ClsUser_DAL obj = new ClsUser_DAL()) { return(obj.SignUp(ObjUser)); } }
public List <ClsUserDetails> GetAllUserDetails() { UserMaster Table = new UserMaster(); DataSet ds = Table.GetAllUserDetails(); List <ClsUserDetails> User_List = new List <ClsUserDetails>(); ClsUserDetails details; if (HasData(ds, 0)) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { if (ds.Tables[0].Rows[i] != null) { details = new ClsUserDetails(); details.UserID = ds.Tables[0].Rows[i]["nID"].ToString(); details.UserName = ds.Tables[0].Rows[i]["cFullName"].ToString(); details.ShortID = ds.Tables[0].Rows[i]["cShortID"].ToString(); details.Email = ds.Tables[0].Rows[i]["cMailId"].ToString(); details.ContactNo = ds.Tables[0].Rows[i]["cContactNumber"].ToString(); details.Password = Decrypt(ds.Tables[0].Rows[i]["cPassword"].ToString()); details.LeveID = Convert.ToInt32(ds.Tables[0].Rows[i]["nLevelID"].ToString()); details.DesignationID = Convert.ToInt32(ds.Tables[0].Rows[i]["nDesignationID"].ToString()); details.DepartmentID = Convert.ToInt32(ds.Tables[0].Rows[i]["nDepartmentID"].ToString()); details.RoleIds = Convert.ToInt32(ds.Tables[0].Rows[i]["nRoleID"].ToString()); details.LeveName = ds.Tables[0].Rows[i]["LevelName"].ToString(); details.DesignationName = ds.Tables[0].Rows[i]["Designation"].ToString(); details.DepartmentName = ds.Tables[0].Rows[i]["Department"].ToString(); details.OrgshortID = ds.Tables[0].Rows[i]["OrgShortId"].ToString(); User_List.Add(details); } } } return(User_List); }
public List <ClsUserDetails> UserSearchByID(int argUserID) { UserMaster Table = new UserMaster(); DataSet ds = Table.SearchByUserID(argUserID); DataTable dt = ds.Tables[0]; List <ClsUserDetails> ObjectDetails = new List <ClsUserDetails>(); DataTable dtRemoveDuplicate = new DataTable(); if (HasData(ds, 0)) { if (ds.Tables[0].Rows[0] != null) { dtRemoveDuplicate = ds.Tables[0]; string name = "", name1 = ""; for (int i = 0; i < dtRemoveDuplicate.Rows.Count; i++) { ClsUserDetails details = new ClsUserDetails(); details.UserID = dtRemoveDuplicate.Rows[i]["nID"].ToString(); details.ShortID = dtRemoveDuplicate.Rows[i]["cShortID"].ToString(); details.LonNumber = dtRemoveDuplicate.Rows[i]["cLONNumber"].ToString(); details.DesignationName = dtRemoveDuplicate.Rows[i]["cProcessDesc"].ToString(); details.Remark = dtRemoveDuplicate.Rows[i]["cRemarks"].ToString(); details.currentStep = dtRemoveDuplicate.Rows[i]["CurrentStep"].ToString(); details.ProcessID = Convert.ToInt32(dtRemoveDuplicate.Rows[i]["ProcessID"].ToString()); details.NsequenceNO = dtRemoveDuplicate.Rows[i]["nSequence"].ToString(); details.DepartmentName = dtRemoveDuplicate.Rows[i]["DepartmentName"].ToString(); details.DCreatedOn = dtRemoveDuplicate.Rows[i]["dCreatedOn"].ToString(); details.DLastModification = dtRemoveDuplicate.Rows[i]["LastMadification"].ToString(); details.NtotalDays = dtRemoveDuplicate.Rows[i]["TotNoDays"].ToString(); details.PRNumbers = dtRemoveDuplicate.Rows[i]["PRNumber"].ToString(); details.colors = "#f0f0f5"; if (i < dtRemoveDuplicate.Rows.Count - 1) { if (details.LonNumber == dtRemoveDuplicate.Rows[i + 1]["cLONNumber"].ToString()) { details.hidds = "none"; name = dtRemoveDuplicate.Rows[i]["cLONNumber"].ToString(); } else { details.hidds = "none"; } } else { details.hidds = "none"; } ObjectDetails.Add(details); } } } return(ObjectDetails); }
public List <ClsUserDetails> GetPreviousStageDetails(int argUserID, int stageDetails, string LonNumber) { UserMaster Table = new UserMaster(); DataSet ds = Table.GetpreviousDetails(argUserID, stageDetails, LonNumber); List <ClsUserDetails> ObjectDetails = new List <ClsUserDetails>(); if (HasData(ds, 0)) { if (ds.Tables[0].Rows[0] != null) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { ClsUserDetails details = new ClsUserDetails(); details.UserID = ds.Tables[0].Rows[i]["nID"].ToString(); ObjectDetails.Add(details); } } } return(ObjectDetails); }
public List <ClsUserDetails> UserSearchbyDateWise(int argUserID, string argFromdate, string argTodate) { UserMaster Table = new UserMaster(); DataSet ds = Table.SearchByUserDateWise(argUserID, argFromdate, argTodate); DataTable dt = ds.Tables[0].Copy(); List <ClsUserDetails> ObjectDetails = new List <ClsUserDetails>(); DataTable dtRemoveDuplicate = new DataTable(); if (HasData(ds, 0)) { //string[] listvalues2; if (ds.Tables[0].Rows[0] != null) { dtRemoveDuplicate = DeleteDuplicateFromDataTable(dt, "cLonNumber"); for (int i = 0; i < dtRemoveDuplicate.Rows.Count; i++) { ClsUserDetails details = new ClsUserDetails(); details.UserID = dtRemoveDuplicate.Rows[i]["nID"].ToString(); details.ShortID = ds.Tables[0].Rows[i]["cShortID"].ToString(); details.LonNumber = dtRemoveDuplicate.Rows[i]["cLONNumber"].ToString(); details.DesignationName = dtRemoveDuplicate.Rows[i]["cProcessDesc"].ToString(); details.Remark = dtRemoveDuplicate.Rows[i]["cRemarks"].ToString(); details.currentStep = dtRemoveDuplicate.Rows[i]["CurrentStep"].ToString(); details.ProcessID = Convert.ToInt32(dtRemoveDuplicate.Rows[i]["ProcessID"].ToString()); details.NsequenceNO = dtRemoveDuplicate.Rows[i]["nSequence"].ToString(); details.DepartmentName = dtRemoveDuplicate.Rows[i]["DepartmentName"].ToString(); details.DCreatedOn = dtRemoveDuplicate.Rows[i]["dCreatedOn"].ToString(); details.DLastModification = dtRemoveDuplicate.Rows[i]["LastMadification"].ToString(); details.NtotalDays = dtRemoveDuplicate.Rows[i]["TotNoDays"].ToString(); ObjectDetails.Add(details); } } } return(ObjectDetails); }
public ClsUserDetails GetUserSearchByID(int argUserID) { UserMaster Table = new UserMaster(); DataSet ds = Table.GetUserSearchByUserID(argUserID); ClsUserDetails details = new ClsUserDetails(); if (HasData(ds, 0)) { if (ds.Tables[0].Rows[0] != null) { details.UserID = ds.Tables[0].Rows[0]["nID"].ToString(); details.UserName = ds.Tables[0].Rows[0]["cFullName"].ToString(); details.ShortID = ds.Tables[0].Rows[0]["cShortID"].ToString(); details.Email = ds.Tables[0].Rows[0]["cMailId"].ToString(); details.ContactNo = ds.Tables[0].Rows[0]["cContactNumber"].ToString(); details.Password = Decrypt(ds.Tables[0].Rows[0]["cPassword"].ToString()); details.LeveID = Convert.ToInt32(ds.Tables[0].Rows[0]["nLevelID"].ToString()); details.DesignationID = Convert.ToInt32(ds.Tables[0].Rows[0]["nDesignationID"].ToString()); details.DepartmentID = Convert.ToInt32(ds.Tables[0].Rows[0]["nDepartmentID"].ToString()); } } return(details); }
public ClsUserDetails CheckUserIDPassword(string userID, string password) { ValidationException valex = new ValidationException(); UserMaster Table = new UserMaster(); if (userID.IsNullOrWhiteSpace() && password.IsNullOrWhiteSpace()) { valex.AddError("Please Enter UserID And Password"); } else if (userID.IsNullOrWhiteSpace()) { valex.AddError("Please Enter UserID"); } else if (password.IsNullOrWhiteSpace()) { valex.AddError("Please Enter Password"); } if (valex.errorList.IsNotEmpty()) { throw valex; } DataSet ds = Table.GetUserDetailsByCredentials(userID, Encrypt(password)); if (IsvalidDataset(ds)) { if (ds.Tables[0].Rows[0]["nID"].IsNotNull()) { int id = ds.Tables[0].Rows[0]["nID"].ToString().ToInt(); if (id > 0) { ClsUserDetails details = new ClsUserDetails(); //details.UserRowID = id; if (ds.Tables[0].Rows[0]["nID"].IsNotNull()) { details.UserID = ds.Tables[0].Rows[0]["nID"].ToString(); } if (ds.Tables[0].Rows[0]["cFullName"].IsNotNull()) { details.UserName = ds.Tables[0].Rows[0]["cFullName"].ToString(); } if (ds.Tables[0].Rows[0]["cShortID"].IsNotNull()) { details.ShortID = ds.Tables[0].Rows[0]["cShortID"].ToString(); } if (ds.Tables[0].Rows[0]["cMailId"].IsNotNull()) { details.Email = ds.Tables[0].Rows[0]["cMailId"].ToString(); } if (ds.Tables[0].Rows[0]["cContactNumber"].IsNotNull()) { details.ContactNo = ds.Tables[0].Rows[0]["cContactNumber"].ToString(); } if (ds.Tables[0].Rows[0]["cPassword"].IsNotNull()) { details.Password = Decrypt(ds.Tables[0].Rows[0]["cPassword"].ToString()); } if (ds.Tables[0].Rows[0]["nLevelID"].IsNotNull()) { details.LeveID = Convert.ToInt32(ds.Tables[0].Rows[0]["nLevelID"].ToString()); } if (ds.Tables[0].Rows[0]["nDesignationID"].IsNotNull()) { details.DesignationID = Convert.ToInt32(ds.Tables[0].Rows[0]["nDesignationID"].ToString()); } if (ds.Tables[0].Rows[0]["nDepartmentID"].IsNotNull()) { details.DepartmentID = Convert.ToInt32(ds.Tables[0].Rows[0]["nDepartmentID"].ToString()); } return(details); } } } else { valex.AddError("Incorrect User Name or Password"); throw valex; } return(null); }
public string SignUp(ClsUserDetails ObjUser) { try { DBParameterCollection ObJParameterCOl = new DBParameterCollection(); DBParameter objDBParameter = new DBParameter("@Ref_User_ID", ObjUser.Ref_User_ID, DbType.Int64); ObJParameterCOl.Add(objDBParameter); objDBParameter = new DBParameter("@UserCode", ObjUser.UserCode, DbType.String); ObJParameterCOl.Add(objDBParameter); objDBParameter = new DBParameter("@FullName", ObjUser.FullName, DbType.String); ObJParameterCOl.Add(objDBParameter); objDBParameter = new DBParameter("@EmailID", ObjUser.EmailID, DbType.String); ObJParameterCOl.Add(objDBParameter); objDBParameter = new DBParameter("@Password", ObjUser.Password, DbType.String); ObJParameterCOl.Add(objDBParameter); objDBParameter = new DBParameter("@MobileNumber", ObjUser.MobileNumber, DbType.String); ObJParameterCOl.Add(objDBParameter); objDBParameter = new DBParameter("@Bio", ObjUser.Bio, DbType.String); ObJParameterCOl.Add(objDBParameter); objDBParameter = new DBParameter("@Gender", ObjUser.Gender, DbType.String); ObJParameterCOl.Add(objDBParameter); objDBParameter = new DBParameter("@StudioGears", ObjUser.StudioGears, DbType.String); ObJParameterCOl.Add(objDBParameter); objDBParameter = new DBParameter("@SocialProfileUrl", ObjUser.SocialProfileUrl, DbType.String); ObJParameterCOl.Add(objDBParameter); objDBParameter = new DBParameter("@PayPalEmailID", ObjUser.PayPalEmailID, DbType.String); ObJParameterCOl.Add(objDBParameter); objDBParameter = new DBParameter("@AuthorityIDs", ObjUser.AuthorityIDs, DbType.String); ObJParameterCOl.Add(objDBParameter); objDBParameter = new DBParameter("@UserMasterDataIDs", ObjUser.UserMasterDataIDs, DbType.String); ObJParameterCOl.Add(objDBParameter); objDBParameter = new DBParameter("@CreatedBy", ObjUser.CreatedBy, DbType.String); ObJParameterCOl.Add(objDBParameter); DBHelper objDbHelper = new DBHelper(); Int64 Ref_User_ID = Convert.ToInt64(objDbHelper.ExecuteScalar(Constant.SignUp, ObJParameterCOl, CommandType.StoredProcedure)); if (Ref_User_ID > 0) { ObjUser.FileManager.ForEach(File => { DBParameterCollection ObJParameterCOl1 = new DBParameterCollection(); DBParameter objDBParameter1 = new DBParameter("@FileManagerID", File.FileManagerID, DbType.Int64); ObJParameterCOl1.Add(objDBParameter1); objDBParameter1 = new DBParameter("@ModuleID", Ref_User_ID, DbType.Int64); ObJParameterCOl1.Add(objDBParameter1); objDBParameter1 = new DBParameter("@ModuleType", File.ModuleType, DbType.String); ObJParameterCOl1.Add(objDBParameter1); objDBParameter1 = new DBParameter("@FileIdentifier", File.FileIdentifier, DbType.String); ObJParameterCOl1.Add(objDBParameter1); objDBParameter1 = new DBParameter("@FileName", File.FileName, DbType.String); ObJParameterCOl1.Add(objDBParameter1); objDBParameter1 = new DBParameter("@FilePath", File.FilePath, DbType.String); ObJParameterCOl1.Add(objDBParameter1); objDBParameter1 = new DBParameter("@FileExtension", File.FileExtension, DbType.String); ObJParameterCOl1.Add(objDBParameter1); objDBParameter1 = new DBParameter("@FileType", File.FileType, DbType.String); ObJParameterCOl1.Add(objDBParameter1); objDBParameter1 = new DBParameter("@FileSize", File.FileSize, DbType.Int64); ObJParameterCOl1.Add(objDBParameter1); objDBParameter1 = new DBParameter("@FileSequence", File.Sequence, DbType.Int32); ObJParameterCOl1.Add(objDBParameter1); objDbHelper.ExecuteScalar(Constant.SaveModuleFile, ObJParameterCOl1, CommandType.StoredProcedure).ToString(); }); } if (Ref_User_ID > 0 && ObjUser.Ref_User_ID == 0) { return("USERADDEDSUCCESS"); } else if (Ref_User_ID > 0 && ObjUser.Ref_User_ID > 0) { return("USERUPDATEDSUCCESS"); } else { return("USERALREADYEXISTS"); } } catch (Exception ex) { throw ex; } }