예제 #1
0
        public UserAction GetUserDetails(string UserName)
        {
            try
            {
                oDatabaseHandler = new DatabaseHandler();
                DataSet oDataSet = new DataSet();
                oDataSet = oDatabaseHandler.FillData("select U.UserId,U.RoleId,R.[Role] RoleName,R.[Create],R.Edit,R.[View],R.Assign,R.Finish from Users as U "
                                                     + " inner join Roles R on R.RoleId=U.RoleId"
                                                     + " where U.UserName='******'");

                if (oDataSet != null && oDataSet.Tables != null && oDataSet.Tables.Count > 0 && oDataSet.Tables[0].Rows != null && oDataSet.Tables[0].Rows.Count > 0)
                {
                    UserAction oUserDetails = new UserAction();
                    //oUserDetails.Cus = int.Parse(oDataSet.Tables[0].Rows[0]["UserId"].ToString());
                    oUserDetails.UserName = UserName;// oDataSet.Tables[0].Rows[0]["UserId"].ToString();
                    oUserDetails.RoleID = int.Parse(oDataSet.Tables[0].Rows[0]["RoleId"].ToString());

                    oUserDetails.RoleName = oDataSet.Tables[0].Rows[0]["RoleName"].ToString();
                    oUserDetails.Create = bool.Parse(oDataSet.Tables[0].Rows[0]["Create"].ToString());
                    oUserDetails.Edit = bool.Parse(oDataSet.Tables[0].Rows[0]["Edit"].ToString());
                    oUserDetails.View = bool.Parse(oDataSet.Tables[0].Rows[0]["View"].ToString());
                    oUserDetails.Assign = bool.Parse(oDataSet.Tables[0].Rows[0]["Assign"].ToString());
                    oUserDetails.Finish = bool.Parse(oDataSet.Tables[0].Rows[0]["Finish"].ToString());

                    return oUserDetails;
                }
                return null;
            }
            catch (Exception ex)
            {

            }
            return null;
        }
예제 #2
0
        public string GetPassword(string UserName)
        {
            try
            {
                oDatabaseHandler = new DatabaseHandler();
                DataSet oDataSet = new DataSet();
                oDataSet = oDatabaseHandler.FillData("select [Password] from Users where UserName='******'");
                if (oDataSet != null && oDataSet.Tables != null && oDataSet.Tables.Count > 0 && oDataSet.Tables[0].Rows != null && oDataSet.Tables[0].Rows.Count > 0)
                {
                    return oDataSet.Tables[0].Rows[0][0].ToString();
                }
                else
                    return "";
            }
            catch (Exception ex)
            {

            }
            return "";
        }
예제 #3
0
        public AppProduct GetAppProductDetails()
        {
            try
            {
                DatabaseHandler oDBH = new DatabaseHandler();

                DataTable oAppCustDataTableOne = oDBH.FillData_SP("GetAppProductDetails").Tables[0];

                /*NOW FETCH PRODUCT DETAIL*/

                string sqlQuery = "select top 1 DID,AppConfigDID,ProductCategory,ProductName,ProductLogo,ProductShortDesc,ProductDesc,ProductHTML,ProductStatus,ShareWidgetAdded,LikeWidgetAdded,ReccWidgetAdded,CommentsWidgetAdded,InquiryWidgetAdded,LikeGatewayAdded,AppCanvasHeight,AppCanvasWidth,AppCaption,TwitterWidgetAdded,ProductBannerImage,ProductBannerURL from AppProduct with (nolock) where DID='" + oAppCustDataTableOne.Rows[0]["DID"].ToString() + "'";

                DataTable oAppCustDataTable = oDBH.FillData(sqlQuery).Tables[0];
                if (oAppCustDataTable != null)
                {
                    AppProduct _oAppProduct = new AppProduct();
                    _oAppProduct.DID = oAppCustDataTable.Rows[0]["DID"].ToString();
                    _oAppProduct.AppConfigDID = oAppCustDataTable.Rows[0]["AppConfigDID"].ToString();
                    _oAppProduct.ProductCategory = oAppCustDataTable.Rows[0]["ProductCategory"].ToString();
                    _oAppProduct.ProductName = oAppCustDataTable.Rows[0]["ProductName"].ToString();
                    _oAppProduct.ProductLogo = HttpUtility.HtmlDecode(oAppCustDataTable.Rows[0]["ProductLogo"].ToString());
                    _oAppProduct.ProductShortDesc = oAppCustDataTable.Rows[0]["ProductShortDesc"].ToString();
                    _oAppProduct.ProductDesc = HttpUtility.HtmlDecode(oAppCustDataTable.Rows[0]["ProductDesc"].ToString());
                    _oAppProduct.ProductHTML = HttpUtility.HtmlDecode(oAppCustDataTable.Rows[0]["ProductHTML"].ToString());
                    _oAppProduct.ProductStatus = oAppCustDataTable.Rows[0]["ProductStatus"].ToString();
                    _oAppProduct.ShareWidgetAdded = oAppCustDataTable.Rows[0]["ShareWidgetAdded"].ToString();
                    _oAppProduct.ReccWidgetAdded = oAppCustDataTable.Rows[0]["ReccWidgetAdded"].ToString();
                    _oAppProduct.InquiryWidgetAdded = oAppCustDataTable.Rows[0]["InquiryWidgetAdded"].ToString();
                    _oAppProduct.CommentsWidgetAdded = oAppCustDataTable.Rows[0]["CommentsWidgetAdded"].ToString();
                    _oAppProduct.LikeWidgetAdded = oAppCustDataTable.Rows[0]["LikeWidgetAdded"].ToString();
                    _oAppProduct.CanvasHeight = oAppCustDataTable.Rows[0]["AppCanvasHeight"].ToString();
                    _oAppProduct.CanvasWidth = oAppCustDataTable.Rows[0]["AppCanvasWidth"].ToString();
                    _oAppProduct.AppCaption = oAppCustDataTable.Rows[0]["AppCaption"].ToString();
                    _oAppProduct.TwitterWidgetAdded = oAppCustDataTable.Rows[0]["TwitterWidgetAdded"].ToString();
                    _oAppProduct.SHeaderBannerImg = oAppCustDataTable.Rows[0]["ProductBannerImage"].ToString();
                    _oAppProduct.SHeaderBannerURL = oAppCustDataTable.Rows[0]["ProductBannerURL"].ToString();
                    return _oAppProduct;
                }
                else { return null; }
            }
            catch (Exception ex)
            {
                //Log4NetUtility.ErrorDebug(this.GetType().FullName, "Error in GetConfigData(string _AppId)", ex);
                throw ex;
            }
        }
예제 #4
0
        public DataTable GetAppCustomerList()
        {
            try
            {
                DatabaseHandler dataAccess = new DatabaseHandler();
                string sqlQuery = "select * from AppCustomer with (nolock)";

                return dataAccess.FillData(sqlQuery).Tables[0];
            }
            catch (Exception ex)
            {
                //Log4NetUtility.ErrorDebug(this.GetType().FullName, "Error in GetConfigData(string _AppId)", ex);
                throw ex;
            }
        }
예제 #5
0
        public DataSet GetTempData(int TemplateID)
        {
            DataSet dsToolkit1 = new DataSet();

            DatabaseHandler oDBH = new DatabaseHandler();
            dsToolkit1 = oDBH.FillData("select * from Template where tid=" + Convert.ToString(TemplateID));

            return dsToolkit1;
        }
예제 #6
0
        public AppCustomer GetCustomerInfo(string email, string cid, bool login)
        {
            if (email != null && cid == null)
            {
                try
                {
                    DataSet dsFinalHTML = new DataSet();
                    DatabaseHandler oDBH = new DatabaseHandler();
                    AppCustomer oAppCustomer = new AppCustomer();
                    dsFinalHTML = oDBH.FillData_SP("GetCustomerInfo", email);

                    oAppCustomer.CustomerID = Convert.ToString(dsFinalHTML.Tables[0].Rows[0]["cid"].ToString());
                    oAppCustomer.SCompanyName = Convert.ToString(dsFinalHTML.Tables[0].Rows[0]["ccompany"].ToString());
                    oAppCustomer.SCustomerCountry = Convert.ToInt32(dsFinalHTML.Tables[0].Rows[0]["ctryid"].ToString());
                    oAppCustomer.SCustomerPWD = Convert.ToString(dsFinalHTML.Tables[0].Rows[0]["password"].ToString());
                    oAppCustomer.SCustomerStatus = Convert.ToString(dsFinalHTML.Tables[0].Rows[0]["cstatus"].ToString());
                    oAppCustomer.SCustomerUserName = Convert.ToString(dsFinalHTML.Tables[0].Rows[0]["username"].ToString());
                    oAppCustomer.SCustomerEmail = email;

                    return oAppCustomer;
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            else if (login)
            {
                try
                {
                    DataSet dsFinalHTML = new DataSet();
                    DatabaseHandler oDBH = new DatabaseHandler();
                    AppCustomer oAppCustomer = new AppCustomer();
                    dsFinalHTML = oDBH.FillData("select * from customer where cemail='" + email + "'");

                    oAppCustomer.CustomerID = Convert.ToString(dsFinalHTML.Tables[0].Rows[0]["cid"].ToString());
                    oAppCustomer.SCompanyName = Convert.ToString(dsFinalHTML.Tables[0].Rows[0]["ccompany"].ToString());
                    oAppCustomer.SCustomerCountry = Convert.ToInt32(dsFinalHTML.Tables[0].Rows[0]["ctryid"].ToString());
                    oAppCustomer.SCustomerPWD = Convert.ToString(dsFinalHTML.Tables[0].Rows[0]["password"].ToString());
                    oAppCustomer.SCustomerStatus = Convert.ToString(dsFinalHTML.Tables[0].Rows[0]["cstatus"].ToString());
                    oAppCustomer.SCustomerUserName = Convert.ToString(dsFinalHTML.Tables[0].Rows[0]["username"].ToString());
                    oAppCustomer.SCustomerEmail = email;

                    return oAppCustomer;
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            else if (email == null && cid != null)
            {
                DataSet dsFinalHTML = new DataSet();
                DatabaseHandler oDBH = new DatabaseHandler();
                AppCustomer oAppCustomer = new AppCustomer();
                dsFinalHTML = oDBH.FillData("select * from customer where cid='" + cid + "'");

                oAppCustomer.CustomerID = Convert.ToString(dsFinalHTML.Tables[0].Rows[0]["cid"].ToString());
                oAppCustomer.SCompanyName = Convert.ToString(dsFinalHTML.Tables[0].Rows[0]["ccompany"].ToString());
                oAppCustomer.SCustomerCountry = Convert.ToInt32(dsFinalHTML.Tables[0].Rows[0]["ctryid"].ToString());
                oAppCustomer.SCustomerPWD = Convert.ToString(dsFinalHTML.Tables[0].Rows[0]["password"].ToString());
                oAppCustomer.SCustomerStatus = Convert.ToString(dsFinalHTML.Tables[0].Rows[0]["cstatus"].ToString());
                oAppCustomer.SCustomerUserName = Convert.ToString(dsFinalHTML.Tables[0].Rows[0]["username"].ToString());

                return oAppCustomer;
            }
            else
            {
                try
                {
                    DataSet dsFinalHTML = new DataSet();
                    DatabaseHandler oDBH = new DatabaseHandler();
                    AppCustomer oAppCustomer = new AppCustomer();
                    dsFinalHTML = oDBH.FillData("select cemail from customer where cid='" + cid + "'");

                    oAppCustomer.SCustomerEmail = Convert.ToString(dsFinalHTML.Tables[0].Rows[0]["cemail"].ToString());

                    return oAppCustomer;
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
예제 #7
0
 public string FetchSweepStakeUtilData(string aDID, string contentType)
 {
     try
     {
         DataSet dsFinalHTML = new DataSet();
         DatabaseHandler oDBH = new DatabaseHandler();
         switch (contentType)
         {
             case "TERMSCOND": dsFinalHTML = oDBH.FillData("select Terms from SweepstakeData where [AppConfigDID]='" + aDID + "'");
                 return dsFinalHTML.Tables[0].Rows[0]["Terms"].ToString();
                 break;
             case "PRIVACY": dsFinalHTML = oDBH.FillData("select Privacy from SweepstakeData where [AppConfigDID]='" + aDID + "'");
                 return dsFinalHTML.Tables[0].Rows[0]["Privacy"].ToString();
                 break;
             case "RULES": dsFinalHTML = oDBH.FillData("select Rules from SweepstakeData where [AppConfigDID]='" + aDID + "'");
                 return dsFinalHTML.Tables[0].Rows[0]["Rules"].ToString();
                 break;
             default: return string.Empty; break;
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }