Exemple #1
0
        public Int64 InsertHelpUs(Int64 userId, string title, string message, IDbTransaction transaction)
        {
            try
            {
                IDbDataParameter[] paramData;
                Int16 Result = 0;
                paramData = DALHelperParameterCache.GetSpParameterSet(transaction, "InsertHelpUs"); foreach (IDbDataParameter Item in paramData)
                {
                    switch (Item.ParameterName)
                    {
                    case "UserId":
                        Item.Value = userId;
                        break;

                    case "Title":
                        Item.Value = title;
                        break;

                    case "Message":
                        Item.Value = message;
                        break;
                    }
                }
                Result = Convert.ToInt16(DALHelper.ExecuteNonQuery(transaction, CommandType.StoredProcedure, "InsertHelpUs", paramData));
                return(Result);
            }
            catch (Exception ex)
            {
                ErrorLogDL.InsertErrorLog(ex.Message, "InsertHelpUs");
                throw ex;
            }
        }
Exemple #2
0
        private DataTable SelectSecurityProfile(User _user, IDbConnection con)
        {
            DataSet dsResult = new DataSet();

            try
            {
                IDbDataParameter[] paramData;
                paramData = DALHelperParameterCache.GetSpParameterSet(con, "GetLogin"); foreach (IDbDataParameter Item in paramData)
                {
                    switch (Item.ParameterName)
                    {
                    case "Email":
                        Item.Value = _user.email;
                        break;

                    case "UserName":
                        Item.Value = _user.username;
                        break;

                    case "Password":

                        Item.Value = _user.password;
                        break;

                    case "Lat":
                        Item.Value = "";
                        break;

                    case "Long":
                        Item.Value = "";
                        break;

                    case "DeviceToken":
                        Item.Value = _user.deviceToken;
                        break;
                    }
                }

                DALHelper.FillDataset(con, CommandType.StoredProcedure, "GetLogin", dsResult, new string[] { "User" }, paramData);

                return(dsResult.Tables.Contains("User") ? dsResult.Tables["User"] : null);
            }
            catch (FileNotFoundException)
            {
                return(dsResult.Tables.Contains("SecurityProfile") ? dsResult.Tables["SecurityProfile"] : null);
                //throw new RisException("¥CmnFilenotfound¥");
                //throw new Exception("File not found");
            }
            catch (UnauthorizedAccessException)
            {
                return(dsResult.Tables.Contains("SecurityProfile") ? dsResult.Tables["SecurityProfile"] : null);
                //throw new RisException("¥CmnFilenotfound¥");
                //throw new Exception("File not found");
            }
            catch (Exception ex)
            {
                ErrorLogDL.InsertErrorLog(ex.Message, "SelectSecurityProfile");
                throw ex;
            }
        }
Exemple #3
0
        public Int16 ResetPassword(User _user, IDbTransaction transaction)
        {
            try
            {
                IDbDataParameter[] paramData;
                Int16 Result = 0;
                paramData = DALHelperParameterCache.GetSpParameterSet(transaction, "ResetPassword"); foreach (IDbDataParameter Item in paramData)
                {
                    switch (Item.ParameterName)
                    {
                    case "UserId":
                        Item.Value = _user.userId;
                        break;

                    case "Password":
                        Item.Value = _user.password;
                        break;
                    }
                }
                Result = Convert.ToInt16(DALHelper.ExecuteNonQuery(transaction, CommandType.StoredProcedure, "ResetPassword", paramData));
                return(Result);
            }
            catch (Exception ex)
            {
                ErrorLogDL.InsertErrorLog(ex.Message, "ResetPassword");
                throw ex;
            }
        }
Exemple #4
0
        public Int16 AddGallery(DataRow dr, IDbTransaction transaction, Int32 hostelId)
        {
            try
            {
                IDbDataParameter[] paramData;
                Int16 Result = 0;
                paramData = DALHelperParameterCache.GetSpParameterSet(transaction, "InsertGallery"); foreach (IDbDataParameter Item in paramData)
                {
                    switch (Item.ParameterName)
                    {
                    case "HostelId":
                        Item.Value = hostelId;

                        break;

                    case "ImageUrl":
                        Item.Value = dr["ImageUrl"];
                        break;
                    }
                }
                Result = Convert.ToInt16(DALHelper.ExecuteNonQuery(transaction, CommandType.StoredProcedure, "InsertGallery", paramData));
                return(Result);
            }
            catch (Exception ex)
            {
                ErrorLogDL.InsertErrorLog(ex.Message, "AddGallery");
                throw ex;
            }
        }
Exemple #5
0
        public DataTable GetAllTravellerCheckInDetails(Int64 hostelId, IDbConnection con, string mode)
        {
            DataSet dsResult = new DataSet();

            try
            {
                IDbDataParameter[] paramData;

                paramData = DALHelperParameterCache.GetSpParameterSet(con, "GetTravellerCheckinDetails"); foreach (IDbDataParameter Item in paramData)
                {
                    switch (Item.ParameterName)
                    {
                    case "HostelId":
                        Item.Value = hostelId;
                        break;

                    case "Mode":
                        Item.Value = mode;

                        break;
                    }
                }
                DALHelper.FillDataset(con, CommandType.StoredProcedure, "GetTravellerCheckinDetails", dsResult, new string[] { "Traveller" }, paramData);

                return(dsResult.Tables.Contains("Traveller") ? dsResult.Tables["Traveller"] : null);
            }
            catch (Exception ex)
            {
                ErrorLogDL.InsertErrorLog(ex.Message, "GetTravellerCheckInHistory");
                throw ex;
            }
        }
Exemple #6
0
        public DataTable GetHostelProfile(Int32 hostelId, IDbConnection con)
        {
            DataSet dsResult = new DataSet();

            try
            {
                IDbDataParameter[] paramData;

                paramData = DALHelperParameterCache.GetSpParameterSet(con, "GetHostellerProfile"); foreach (IDbDataParameter Item in paramData)
                {
                    switch (Item.ParameterName)
                    {
                    case "HostelId":
                        Item.Value = hostelId;

                        break;
                    }
                }
                DALHelper.FillDataset(con, CommandType.StoredProcedure, "GetHostellerProfile", dsResult, new string[] { "HostelProfile" }, paramData);

                return(dsResult.Tables.Contains("HostelProfile") ? dsResult.Tables["HostelProfile"] : null);
            }
            catch (Exception ex)
            {
                ErrorLogDL.InsertErrorLog(ex.Message, "GetHostelProfile");
                throw ex;
            }
        }
Exemple #7
0
        private Int16 RegisterHostelUser(Hostel _hostel, IDbTransaction transaction)
        {
            try
            {
                IDbDataParameter[] paramData;
                Int16 Result = 0;
                paramData = DALHelperParameterCache.GetSpParameterSet(transaction, "sp_CreateUser"); foreach (IDbDataParameter Item in paramData)
                {
                    switch (Item.ParameterName)
                    {
                    case "UserName":
                        Item.Value = _hostel.username;

                        break;

                    case "Password":
                        Item.Value = _hostel.password;
                        break;

                    case "EmailId":
                        Item.Value = _hostel.emailId;
                        break;

                    case "Address":
                        Item.Value = _hostel.address;
                        break;

                    case "UserType":
                        Item.Value = "Hostel";
                        break;

                    case "PersonalWebSiteLink":
                        Item.Value = _hostel.websiteLink;
                        break;

                    case "ProfilePic":
                        Item.Value = _hostel.profilePic;
                        break;

                    case "HostelDormRoomWithBunks":
                        Item.Value = _hostel.hostelDormRoomwithBunks;
                        break;

                    case "HostelDormRoomWithoutBunks":
                        Item.Value = _hostel.hostelDormRoomwithoutBunks;
                        break;

                    case "FemaleBedRooms":
                        Item.Value = _hostel.femaleDormRooms;
                        break;

                    case "SingleBedRooms":
                        Item.Value = _hostel.singleBedRooms;
                        break;

                    case "DoubleBedRooms":
                        Item.Value = _hostel.doubleBedRooms;
                        break;

                    case "HostelName":
                        Item.Value = _hostel.hostelName;
                        break;

                    case "CityName":
                        Item.Value = _hostel.cityName;
                        break;
                    }
                }
                Result = Convert.ToInt16(DALHelper.ExecuteNonQuery(transaction, CommandType.StoredProcedure, "sp_CreateUser", paramData));
                return(Result);
            }
            catch (Exception ex)
            {
                ErrorLogDL.InsertErrorLog(ex.Message, "RegisterHostelUser");
                throw ex;
            }
        }