Search Results

Search found 11 results on 1 pages for 'calibre2010'.

Page 1/1 | 1 

  • Grouping Months of a particular Time span together using DateTime.

    - by Calibre2010
    public static string TimeLine2(this HtmlHelper helper, string myString2) { StringBuilder myString3 = new StringBuilder(); DateTime start = new DateTime(2010, 1, 1); DateTime end = new DateTime(2011, 12, 12); myString3.Append("<table>"); myString3.Append("<tr>"); for (DateTime date = start; date <= end; date = date.AddDays(1)) { DayOfWeek dw = date.DayOfWeek; var g = date.Month; var sun = " "; switch (dw) { case DayOfWeek.Sunday: sun = "S"; break; case DayOfWeek.Monday: sun = "M"; break; case DayOfWeek.Tuesday: sun = "T"; break; case DayOfWeek.Wednesday: sun = "W"; break; case DayOfWeek.Thursday: sun = "T"; break; case DayOfWeek.Friday: sun = "F"; break; case DayOfWeek.Saturday: sun = "S"; break; } myString3.Append("<td>" + sun + " " + g + "</td>"); } myString3.Append("</tr>"); myString3.Append("<tr>"); for (DateTime date = start; date <= end; date = date.AddDays(1)) { var f = date.Day; myString3.Append("<td>" + f + "</td>"); } myString3.Append("</tr>"); myString3.Append("</table>"); return myString3.ToString(); } Basically, what I have here is a few loops showing all the days of the week and also all the days in a month. This is all placed inside of a table, so you get MTWTFSSMT W T F S S M M TWTFSSM 12345678910 11 12 13 14 + + to 31 1234567 I'm trying to code a way in which I can split all of these days of the week and days in months so that my code returns each month with all its days in the month and all its days of the week, not just all my months between my timeSpan but splits them so MAY MTWTFSSMTWTFSSMTWTFSSMTWTFSSMTWTF 12345678 JUNE MTWTFSSMTWTFSSMTWTFSSMTWTFSSMTWTF 123456789

    Read the article

  • whats the format for a string of forward slash / in c#

    - by Calibre2010
    Hi, I'm using a htmlhelper where i give table data id's based on day and month values which are retrieved. The problem is the id is not recognized in the format it is. / seems to not be picked up yet when i replace '/' with '-' it works. daysRow.AppendFormat("<td id='{0}/{1}'>{0}</td>", day, d1.Month.ToString()); can anyone tell me how to format this please. '/' forward slash in c#.

    Read the article

  • Model Binding using ASP.NET MVC, getting datainput to the controller.

    - by Calibre2010
    Pretty Basic one here guys. I have a View which holds 2 textfields for input and a submit button <%using (Html.BeginForm("DateRetrival", "Home", FormMethod.Post)){ %> <%=Html.TextBox("sday")%> <%=Html.TextBox("eday")%> <input type="submit" value="ok" id="run"/> <% }%> the following controller action which I want to bind the data input is as follows [AcceptVerbs(HttpVerbs.Get)] public ActionResult DateRetrival() { return View(); } [AcceptVerbs(HttpVerbs.Post)] public ActionResult DateRetrival(string submit) { return null; } When I debug this and look in the action methods parameter, the value is null. When I've entered values in both textboxes and and clicked the submit method.

    Read the article

  • Trying to return data asynchronously using jQuery AND jSon in MVC 2.0

    - by Calibre2010
    Hi, I am trying to use Jquerys getJSON method to return data server side to my browser, what happens is the url the getJSON method points to does get reached but upon the postback the result does not get returned to the browser for some odd reason. I wasen't sure if it was because I was using MVC 2.0 and jQuery 1.4.1 and it differs to the MVC 1.0 version and jQuerys 1.3.2 version. . this is the code sections Controller public JsonResult StringReturn() { NameDTO myName = new NameDTO(); myName.nameID = 1; myName.name= "James"; myName.nameDescription = "Jmaes"; return Json(myName); } View with JQuery <script type="text/javascript"> $(document).ready(function () { $("#myButton").click(function () { $.getJSON("Home/StringReturn/", null, function (data) { alert(data.name); $("#show").append($("<div>" + data.name + "</div>")); }); }); }); </script> HTML <input type="button" value="clickMe" id="myButton"/> <div id="show">d</div>

    Read the article

  • Basic Question on storing variables c# for use in other classes

    - by Calibre2010
    Ok guys I basically have a class which takes in 3 strings through the parameter of one of its method signatures. I've then tried to map these 3 strings to global variables as a way to store them. However, when I try to call these global variables from another class after instantiating this class they display as null values. this is the class which gets the 3 strings through the method setDate, and the mapping.. public class DateLogic { public string year1; public string month1; public string day1; public DateLogic() { } public void setDate(string year, string month, string day) { year1 = year; month1 = month; day1 = day; // getDate(); } public string getDate() { return year1 + " " + month1 + " " + day1; } } After this I try call this class from here public static string TimeLine2(this HtmlHelper helper, string myString2) { DateLogic g = new DateLogic(); string sday = g.day1; string smonth = g.month1; string syr = g.year1; } I've been debugging and the values make it all the way to the global variables but when called from this class here it doesnt show them, just shows null. Is this cause I'm creating a brand new instance, how do i resolve this?

    Read the article

  • Positioning decorated series of div tags on screen using offset, DOM JQUERY RELATED

    - by Calibre2010
    Hi, I am using JQuery to position a series of div tags which basically use a class inside of the tag which decorates the divs as bars. So the div is a green box based on its css specifications to the glass. I have a list of STARTING postions, a list of left coordiantes- for the starting points I wish to position my DIV say 556, 560, 600 these automatically are generated as left positions in a list I have a list of ENDING postions, a list of left coordiantes- for the ending points I wish to position my DIV say 570, 590, 610 these automatically are generated as left positions in a list now for each start and end position, the bar(green box) i want to be drawn with its appropriate width as follows. so say f is the offset or position of the start and ff the offset or position of the end : Below draws the green box based on only one start and end position LEFT. if (f.left != 0) { $("#test").html($("<div>d</div>")).css({ position: 'absolute', left: (f.left) + "px", top: (f.top + 35) + "px", width: (ff.left - f.left) + 25 + "px" }).addClass("option1"); } I am looking to loop through the list of positons in the list and draw multiple green boxs based on the positions on the screen. The above code draws just one green box from the last offset position.

    Read the article

  • Saving a list of items in Application State ASP.NET MVC ?

    - by Calibre2010
    Hi Guys, I'm having a bit of trouble with knowing how I can save items from a list I have in Application state in the global.asax as- Application[""]. My controller basically takes in some user input, I then pass this to another classes Method as parameters it gets added to a list all the time. This data thats getting added to the list I want to store it, but without using a db. By using Application State. . I have been instantiating this class and calling its method to return the list of items but I dont think Application State is saving it. Here is what I have so far. . protected void Application_Start() { RegisterRoutes(RouteTable.Routes); TimeLineInformation t = new TimeLineInformation(); IList<SWTimeEnvInfoDTO> g = t.getInfo(); Application["AppID"] = g; } ^ Global.asax IList<SWTimeEnvInfoDTO> result = new List<SWTimeEnvInfoDTO>(); public void returnTimeLineInfo(string SWrelease, string EnvName, DateTime SDate, DateTime EDate) { SWTimeEnvInfoDTO myDTO = new SWTimeEnvInfoDTO(); myDTO.softwareReleaseName = SWrelease; myDTO.environmentName = EnvName; myDTO.StartDate = SDate; myDTO.EndDate = EDate; result.Add(myDTO); getInfo(); } public IList<SWTimeEnvInfoDTO> getInfo() { return result; } ^ class im calling The SWTimeEnvInfoDTO type has get and set methods for the data. I am calling the application from a View as well. It works with a string Application["AppID"] = "fgt"; and shows this once i read it from my view.

    Read the article

  • JQuery going through a set of UL and dynamically set ids incremently on each one

    - by Calibre2010
    I have an unordered list which contains serveral items called 'oListItems' the UL has a class but no id. The class OuteroListItems contains many of oListitems oList.AppendFormat("<ul class='OuteroListItems'>"); oList.AppendFormat("<li>"); oList.AppendFormat("<ul class='oListItems'>"); oList.AppendFormat("<li>" + s.sName + "</li>"); oList.AppendFormat("<li>" + s.eName + "</li>"); oList.AppendFormat("<li>" + s.SDate + "</li>"); oList.AppendFormat("<li>" + s.EDate + "</li>"); oList.AppendFormat("</ul>"); oList.AppendFormat("</li>"); oList.AppendFormat("</ul>"); I want for each .oListItem class that gets retrieved, add dynamically an id to it. var o = $(".oListItem"); $.each(o, function (){ var f = $(this).attr("id", 'listItem' + i); i++; }); wasent sure on the approach, this is what I have so far?

    Read the article

1