I have a big problem. I made a module using starter kit. Everything works well, but I cannot record. I've localized the problem. When I insert a breakpoint, I see that the textbox contains the former value.
I'm sure it's the problem because when I insert a value by setting the value in the code, it's ok.
System;
using
DotNetNuke;
using
DotNetNuke.Common;
using
DotNetNuke.Common.Utilities;
using
DotNetNuke.Entities.Modules;
using
DotNetNuke.Services.Exceptions;
using
DotNetNuke.Services.Localization;
namespace
{
YourCompany.Modules.ECWCalendar/// -----------------------------------------------------------------------------
/// <summary>
/// The EditECWCalendar class is used to manage content
/// </summary>
/// <remarks>
/// </remarks>
/// <history>
/// </history>
/// -----------------------------------------------------------------------------
partial class EditECWCalendar : PortalModuleBase
{
#region
Private Membersprivate int ItemId = Null.NullInteger;
#endregion
#region
Event Handlers/// -----------------------------------------------------------------------------
/// <summary>
/// Page_Load runs when the control is loaded
/// </summary>
/// <remarks>
/// </remarks>
/// <history>
/// </history>
/// -----------------------------------------------------------------------------
{
protected void Page_Load(System.Object sender, System.EventArgs e)try
{
ECWCalendarController ecwCalendarController = new ECWCalendarController();ECWCalendarDetailController ecwCalendarDetailController = new ECWCalendarDetailController();//If this is the first visit to the page, bind the role data to the datalist
{
if (Page.IsPostBack)int ecwCalendarId = Convert.ToInt32(cboRaces.SelectedValue);// load element
ECWCalendarDetailInfo ecwCalendarDetailInfo = ecwCalendarDetailController.GetECWCalendarDetail(ecwCalendarId);if (ecwCalendarDetailInfo == null)// Doesn't exist => create detail for this race
{
ecwCalendarDetailInfo =
ecwCalendarDetailInfo.ECWCalendarID = ecwCalendarId;
ecwCalendarDetailInfo.ProvinceId =
new ECWCalendarDetailInfo();int.Parse(Settings["province"].ToString());int.Parse((string)Settings["province"]); // = default module value
ecwCalendarDetailInfo.RegistrationFrom = (
string)Settings["registrationfrom"]; // = default module value
ecwCalendarDetailInfo.RegistrationTo = (
string)Settings["registrationto"]; // = default module value
ecwCalendarDetailInfo.StartTimeA = (
string)Settings["starttimea"]; // = default module value
ecwCalendarDetailInfo.DistanceA = (
string)Settings["distancea"]; // = default module value
ecwCalendarDetailInfo.StartTimeB = (
string)Settings["starttimeb"]; // = default module value
ecwCalendarDetailInfo.DistanceB = (
string)Settings["distanceB"]; // = default module value
ecwCalendarDetailInfo.StartTimeC = (
string)Settings["starttimec"]; // = default module value
ecwCalendarDetailInfo.DistanceC = (
string)Settings["distancec"]; // = default module value
ecwCalendarDetailInfo.BibsPosition =
Convert.ToInt32(Settings["bibsposition"]); // = default module value
ecwCalendarDetailInfo.Approved =
ecwCalendarDetailInfo.CreatedByUser = UserInfo.Username;
ecwCalendarDetailInfo.CreatedDate =
ecwCalendarDetailController.AddECWCalendarDetail(ecwCalendarDetailInfo);
}
false;DateTime.Now;// Fills the form
}
this.FillsForm(ecwCalendarDetailInfo);else
{
// Load races
cboRaces.DataSource = ecwCalendarController.GetFormatedECWCalendars(PortalId);
cboRaces.DataBind();
// Load provinces
cboProvinces.DataSource = ecwCalendarDetailController.GetECWProvinces();
cboProvinces.DataBind();
}
}
catch (Exception exc) //Module failed to load
{
}
}
{
cboProvinces.SelectedValue = ecwCalendarDetailInfo.ProvinceId.ToString();
txtRegistrationPlace.Text = ecwCalendarDetailInfo.RegistrationPlace;
txtRegistrationFrom.Text = ecwCalendarDetailInfo.RegistrationFrom;
txtRegistrationTo.Text = ecwCalendarDetailInfo.RegistrationTo;
txtChanginRoom.Text = ecwCalendarDetailInfo.ChangingRoom;
txtStartTimeA.Text = ecwCalendarDetailInfo.StartTimeA;
txtDistanceA.Text = ecwCalendarDetailInfo.DistanceA.ToString();
txtStartTimeB.Text = ecwCalendarDetailInfo.StartTimeB;
txtDistanceB.Text = ecwCalendarDetailInfo.DistanceB.ToString();
txtStartTimeC.Text = ecwCalendarDetailInfo.StartTimeC;
txtDistanceC.Text = ecwCalendarDetailInfo.DistanceC.ToString();
rdblBibsPosition.SelectedIndex = ecwCalendarDetailInfo.BibsPosition;
cbApproved.Checked = ecwCalendarDetailInfo.Approved;
ctlAudit.CreatedByUser = ecwCalendarDetailInfo.CreatedByUser.ToString();
ctlAudit.CreatedDate = ecwCalendarDetailInfo.CreatedDate.ToShortDateString();
ctlAudit.Visible =
}
Exceptions.ProcessModuleLoadException(this, exc);private void FillsForm(ECWCalendarDetailInfo ecwCalendarDetailInfo)true;/// -----------------------------------------------------------------------------
/// <summary>
/// cmdCancel_Click runs when the cancel button is clicked
/// </summary>
/// <remarks>
/// </remarks>
/// <history>
/// </history>
/// -----------------------------------------------------------------------------
{
protected void cmdCancel_Click(System.Object sender, System.EventArgs e)try
{
}
this.Response.Redirect(Globals.NavigateURL(this.TabId), true);catch (Exception exc) //Module failed to load
{
}
}
Exceptions.ProcessModuleLoadException(this, exc);/// -----------------------------------------------------------------------------
/// <summary>
/// cmdUpdate_Click runs when the update button is clicked
/// </summary>
/// <remarks>
/// </remarks>
/// <history>
/// </history>
/// -----------------------------------------------------------------------------
{
protected void cmdUpdate_Click(System.Object sender, System.EventArgs e)try
{
ecwCalendarDetailInfo.ECWCalendarID =
ecwCalendarDetailInfo.ProvinceId =
ecwCalendarDetailInfo.RegistrationPlace = txtRegistrationPlace.Text.Trim();
ecwCalendarDetailInfo.RegistrationFrom = txtRegistrationFrom.Text.Trim();
ecwCalendarDetailInfo.RegistrationTo = txtRegistrationTo.Text.Trim();
ecwCalendarDetailInfo.ChangingRoom = txtChanginRoom.Text.Trim();
ecwCalendarDetailInfo.StartTimeA = txtStartTimeA.Text.Trim();
ecwCalendarDetailInfo.DistanceA = txtDistanceA.Text.Trim();
ecwCalendarDetailInfo.StartTimeB = txtStartTimeB.Text.Trim();
ecwCalendarDetailInfo.DistanceB = txtDistanceB.Text.Trim();
ecwCalendarDetailInfo.StartTimeC = txtStartTimeC.Text.Trim();
ecwCalendarDetailInfo.DistanceC = txtDistanceC.Text.Trim();
ecwCalendarDetailInfo.BibsPosition = rdblBibsPosition.SelectedIndex;
ecwCalendarDetailInfo.Approved = cbApproved.Checked;
ecwCalendarDetailInfo.CreatedByUser = UserInfo.Username;
ecwCalendarDetailInfo.CreatedDate =
ECWCalendarDetailController ecwCalendarDetailController = new ECWCalendarDetailController();ECWCalendarDetailInfo ecwCalendarDetailInfo = new ECWCalendarDetailInfo();Convert.ToInt32(cboRaces.SelectedValue);Convert.ToInt32(cboProvinces.SelectedValue);DateTime.Now;//Update the content within the ECWCalendar table
ecwCalendarDetailController.UpdateECWCalendarDetail(ecwCalendarDetailInfo);
//refresh cache
}
ModuleController.SynchronizeModule(ModuleId);catch (Exception exc) //Module failed to load
{
}
}
Exceptions.ProcessModuleLoadException(this, exc);
#endregion
}
}