Example #1
0
 public static HtmlString FillInRegions(this IHtmlHelper helper, ContentURI uri,
                                        string selectName, DataHelpers.GeneralHelpers.VIEW_EDIT_TYPES viewEditType,
                                        int geoRegionId)
 {
     using (StringWriter result = new StringWriter())
     {
         if (uri.URIDataManager.GeoRegions != null)
         {
             string sCssClass         = "Select250";
             string sJavascriptMethod = (geoRegionId == 0) ? string.Empty : string.Empty;
             bool   bIsSelected       = (geoRegionId == 0) ? true : false;
             if (viewEditType != DataHelpers.GeneralHelpers.VIEW_EDIT_TYPES.full)
             {
                 foreach (GeoRegion georegion in uri.URIDataManager.GeoRegions)
                 {
                     if (georegion.PKId == geoRegionId)
                     {
                         bIsSelected = true;
                     }
                     else
                     {
                         bIsSelected = false;
                     }
                     if (bIsSelected)
                     {
                         result.Write(georegion.GeoRegionName);
                         break;
                     }
                 }
             }
             else
             {
                 result.WriteLine(helper.SelectStart(viewEditType, string.Concat("GeoRegionId", geoRegionId.ToString()),
                                                     selectName, sCssClass));
                 result.WriteLine(helper.Option(AppHelper.GetResource("MAKE_SELECTION"),
                                                "0", bIsSelected));
                 bIsSelected = false;
                 foreach (GeoRegion georegion in uri.URIDataManager.GeoRegions)
                 {
                     if (georegion.PKId == geoRegionId)
                     {
                         bIsSelected = true;
                     }
                     else
                     {
                         bIsSelected = false;
                     }
                     result.WriteLine(helper.Option(georegion.GeoRegionName,
                                                    georegion.PKId.ToString(), bIsSelected));
                 }
                 result.WriteLine(helper.SelectEnd());
             }
         }
         return(new HtmlString(result.ToString()));
     }
 }
Example #2
0
 public static HtmlString FillInClubGroups(this IHtmlHelper helper, ContentURI uri,
                                           string selectName, DataHelpers.GeneralHelpers.VIEW_EDIT_TYPES viewEditType,
                                           int clubGroupId)
 {
     using (StringWriter result = new StringWriter())
     {
         if (uri.URIDataManager.ClubGroups != null)
         {
             string sCssClass         = "Select250";
             string sJavascriptMethod = (clubGroupId == 0) ? string.Empty : string.Empty;
             bool   bIsSelected       = (clubGroupId == 0) ? true : false;
             if (viewEditType != DevTreks.Data.Helpers.GeneralHelpers.VIEW_EDIT_TYPES.full)
             {
                 foreach (AccountClass clubgroup in uri.URIDataManager.ClubGroups)
                 {
                     if (clubgroup.PKId == clubGroupId)
                     {
                         bIsSelected = true;
                     }
                     else
                     {
                         bIsSelected = false;
                     }
                     if (bIsSelected)
                     {
                         result.Write(clubgroup.AccountClassName);
                         break;
                     }
                 }
             }
             else
             {
                 result.WriteLine(helper.SelectStart(viewEditType, string.Concat("ClubGroupId", clubGroupId.ToString()),
                                                     selectName, sCssClass));
                 result.WriteLine(helper.Option(AppHelper.GetResource("MAKE_SELECTION"),
                                                "0", bIsSelected));
                 bIsSelected = false;
                 foreach (AccountClass clubgroup in uri.URIDataManager.ClubGroups)
                 {
                     if (clubgroup.PKId == clubGroupId)
                     {
                         bIsSelected = true;
                     }
                     else
                     {
                         bIsSelected = false;
                     }
                     result.WriteLine(helper.Option(clubgroup.AccountClassName,
                                                    clubgroup.PKId.ToString(), bIsSelected));
                 }
                 result.WriteLine(helper.SelectEnd());
             }
         }
         return(new HtmlString(result.ToString()));
     }
 }
Example #3
0
        private static string GetControllerTitle(string controllerId)
        {
            string sControllerTitle = string.Empty;
            string sControllerIdLow = controllerId.ToLower();

            if (sControllerIdLow ==
                DevTreks.Controllers.CommonTreksController.COMMON_TREKS.ToLower())
            {
                sControllerTitle = AppHelper.GetResource("COMMONTREKS_TITLE");
            }
            else if (sControllerIdLow ==
                     DevTreks.Controllers.AgTreksController.AG_TREKS.ToLower())
            {
                sControllerTitle = AppHelper.GetResource("AGTREKS_TITLE");
            }
            else if (sControllerIdLow ==
                     DevTreks.Controllers.BuildTreksController.BUILD_TREKS.ToLower())
            {
                sControllerTitle = AppHelper.GetResource("BUILDTREKS_TITLE");
            }
            else if (sControllerIdLow ==
                     DevTreks.Controllers.HealthTreksController.HEALTH_TREKS.ToLower())
            {
                sControllerTitle = AppHelper.GetResource("HOMETREKS_TITLE");
            }
            else if (sControllerIdLow ==
                     DevTreks.Controllers.HomeTreksController.HOME_TREKS.ToLower())
            {
                sControllerTitle = AppHelper.GetResource("HOMETREKS_TITLE");
            }
            else if (sControllerIdLow ==
                     DevTreks.Controllers.GreenTreksController.GREEN_TREKS.ToLower())
            {
                sControllerTitle = AppHelper.GetResource("GREENTREKS_TITLE");
            }
            else if (sControllerIdLow ==
                     DevTreks.Controllers.GovTreksController.GOV_TREKS.ToLower())
            {
                sControllerTitle = AppHelper.GetResource("GOVTREKS_TITLE");
            }
            return(sControllerTitle);
        }
Example #4
0
        public static void FillInClubCreditFormData(Microsoft.AspNetCore.Http.HttpContext context,
                                                    AccountToMember loggedInMember)
        {
            if (loggedInMember != null)
            {
                if (loggedInMember.ClubDefault == null)
                {
                    //retrieve the account id and build a new club
                    loggedInMember.ClubDefault = new Account();
                }
                if (loggedInMember.ClubDefault.AccountToCredit == null)
                {
                    loggedInMember.ClubDefault.AccountToCredit = new List <AccountToCredit>();
                    loggedInMember.ClubDefault.AccountToCredit.Add(new AccountToCredit());
                }
                if (loggedInMember.ClubDefault.AccountToCredit.Count == 0)
                {
                    loggedInMember.ClubDefault.AccountToCredit.Add(new AccountToCredit());
                }
                string sFormValue = context.Request.Form.FirstOrDefault(k => k.Key == "txtCardFullName").Value;
                //string sFormValue = context.Request.Form["txtCardFullName"] ?? AppHelper.GetResource("NONE");
                if (sFormValue.EndsWith("*"))
                {
                    //get rid of the javascript-inserted stars
                    sFormValue = sFormValue.Replace("*", string.Empty);
                }
                loggedInMember.ClubDefault.AccountToCredit.FirstOrDefault().CardFullName = sFormValue;
                //sFormValue = context.Request.Form["txtCardFullNumber"] ?? AppHelper.GetResource("NONE");
                if (sFormValue.EndsWith("*"))
                {
                    //get rid of the javascript-inserted stars
                    sFormValue = sFormValue.Replace("*", string.Empty);
                }
                loggedInMember.ClubDefault.AccountToCredit.FirstOrDefault().CardFullNumber = sFormValue;
                //sFormValue = context.Request.Form["txtCardShortNumber"] ?? AppHelper.GetResource("NONE");
                if (sFormValue.EndsWith("*"))
                {
                    //get rid of the javascript-inserted stars
                    sFormValue = sFormValue.Replace("*", string.Empty);
                }
                loggedInMember.ClubDefault.AccountToCredit.FirstOrDefault().CardShortNumber = sFormValue;
                //sFormValue = context.Request.Form["selectcardtype"] ?? AppHelper.GetResource("NONE");
                if (sFormValue.EndsWith("*"))
                {
                    //get rid of the javascript-inserted stars
                    sFormValue = sFormValue.Replace("*", string.Empty);
                }
                loggedInMember.ClubDefault.AccountToCredit.FirstOrDefault().CardType = sFormValue;
                //sFormValue = context.Request.Form["selectcardmonth"] ?? AppHelper.GetResource("NONE");
                if (sFormValue.EndsWith("*"))
                {
                    //get rid of the javascript-inserted stars
                    sFormValue = sFormValue.Replace("*", string.Empty);
                }
                loggedInMember.ClubDefault.AccountToCredit.FirstOrDefault().CardEndMonth = sFormValue;
                //sFormValue = context.Request.Form["selectcardyear"]  ?? AppHelper.GetResource("NONE");
                if (sFormValue.EndsWith("*"))
                {
                    //get rid of the javascript-inserted stars
                    sFormValue = sFormValue.Replace("*", string.Empty);
                }
                loggedInMember.ClubDefault.AccountToCredit.FirstOrDefault().CardEndYear = sFormValue;

                //why store state? is it a requirement?
                loggedInMember.ClubDefault.AccountToCredit.FirstOrDefault().CardState = AppHelper.GetResource("NONE");//context.Request.Form["selectcardlocation"] ?? AppHelper.GetResource("NONE");
            }
        }