Complex Gridview Edit - asp.net

I have a gridview that displays data in a crosstab format. The hours for each day are displayed. Each day is actually a separate row in the underlying table, so a row in the grid represents seven underlying tables.
WeekEnding(sat) Project Category Sun Mon Tues Wed Thur Fri Sat
8/14/2010 Proj1 testing 1 2 2 3 2
I want to write custom code to update each day. I have to caclulate the date based on weekending date and day ( ex fri date == Weekending - 1 day) and make 7 different update statements - one for each day in the row.
Where can I do this? Would I use the Gridview ItemUpdating event(edit: I meant RowUpdating event)?
======================
I need to add code when they click the "Update" button but not sure what event that is.
Currently when they click edit i have a textbox that appears for each days hours

Use the RowDataBound since you aleady have all the information you need to do this, inside this event you can get the complete object information that is bound and use the findControl to update the columns

Related

Manipulating data from sqlite database

Am a beginner in android development and i am designing an android app which takes input of a date and stores it in sqlite database. Could you please explain how i can retrieve the date and use it to calculate other dates which i will display in another activity
Eg if input is 1/1/2019, i need to calculate events that occur after this date and display them in order of events and the date
Event 1 - 12/01/2019
Event 2 - 2/02/2019
Event 3 - 26/02/2019
Event 1 occurs after like 21 days, event 2 occurs after like 24 days
How should i perform this calculation and display them in another activity?
The link mentioned above is correct. To put it simply just use SQLite's date function - it can calculate dates quite easily:
SELECT date('2019-01-12', '+21 days');
gives you 2019-02-02.
Instead of the date value use a column name of your table if approbiate.
Take the calculated date for the second event and add 24 days and SQLite gives you the date for the third event.
SELECT date('2019-02-02', '+24 days');
2019-02-26
Hint: my answer only deals with the database side (cause that's what your question is tagged with). I have no idea about the Android programming.

fullcalendar wrong timespamp for midnight

I am using fullcalendar.io and I realized that if I create a new event in the month view, dragging across one or more days, it returns a timestamp for the end date which is later rendered as 12 am of the day after while it should be logic that a function date("what-ever-format", timestamp) returns 12 pm of the current day, or, in any case, not the following day.
Any idea how to fix this???

Event Shift for one day for all-day event on fullcalendar

Having problem for "all-day" event that an event with start Nov 10 and end Nov 12 will span only 2 days on the calendar.
Looks like the documentation for the old version has the right one that I want it to work.
But with the new version, is there a way I can make it span for 3 days instead of 2 days without changing the end date?
The problem of changing the end date is that I allow user to store the end date. I don't think changing the end date from the user input is a good idea.
Any suggestion?
Yes, it looks like it is defined in that way in full calendar. For example if you drop some event on 3rd march for 1 day then
start : Mar 03 2020 00:00:00
end : Mar 04 2020 00:00:00
Hope it helps.

How to create only a week calendar with previous and next week buttons

I am really stucked at this.what i want is that there should be 6 table cells in which i should have days with date. like
Monday 4/3/2013 Tuesday 5/3/2013 and so on till saturday
.i have two more buttons,previous week and next week button.. it should automatically show next week when i click the next week button and should show the previous week whenever i press the previous button..
also the i need to take the value of days/month and year so that i can use them in where clause in my sql query..pls its urgent can anyone help me with this...
im providing a link you can see what exactly i want by visiting this link
www.test.ginormous.in/dinesmart/Filestore/Food/Capture.png
i am just giving you the outline as posting the whole code is not possible.
create an asp:panel in your aspx page
try generating the table structure dynamically inside that panel by writing myPanel.innerhtml = "(your html structure generated in a string)"
use theDate.AddDays(7 - (int)theDate.DayOfWeek) to get the date for this weeks sunday.(where theDay is the current date or the date given by you and change 7 to 6 if you want it for monday as this returns date for sunday etc..)
on previous and next click you can add or subtract 7 days from the first day of the weel that is generated above.
hope this helps you.

how add a form in views

I created a views showing user details, and i would like to show this views by date-wise.
I want to create a starting date and ending date (January 1 2011 to February 25 2011), then click submit. It show only the user join between January 1 to February 25.
Is it not possible to do in views, if so please tell me the other methods to do.
For this you can use the Filter area in views. You select the User Join date as a filter, then you click the Expose button. Then in the radio list choose the one where it says something like "is between". Then you should have a form where you can select a start and end date for the users on the page.

Resources