Ejemplo n.º 1
0
 protected void uiGridViewReadings_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "EditRead")
     {
         Readings objData = new Readings();
         objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));
         uiRadEditorPageContent.Content = Server.HtmlDecode(objData.ArContent);
         uiTextBoxDate.Text = objData.ViewDate.ToString("dd/MM/yyyy");
         uiPanelAllReadings.Visible = false;
         uiPanelCurrent.Visible = true;
         CurrentRead = objData;
     }
     else if (e.CommandName == "DeleteRead")
     {
         Readings objData = new Readings();
         objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));
         objData.MarkAsDeleted();
         objData.Save();
         LoadReadings();
     }
 }
Ejemplo n.º 2
0
 protected void uiLinkButtonUpdateReadings_Click(object sender, EventArgs e)
 {
     if (CurrentRead != null)
     {
         CurrentRead.ArContent = Server.HtmlEncode(uiRadEditorPageContent.Content);
         CurrentRead.ViewDate = DateTime.ParseExact(uiTextBoxDate.Text, "dd/MM/yyyy", null);
         CurrentRead.ReadingsType = 2;
         CurrentRead.Save();
     }
     else
     {
         Readings objData = new Readings();
         objData.AddNew();
         objData.ArContent = Server.HtmlEncode(uiRadEditorPageContent.Content);
         objData.ViewDate = DateTime.ParseExact(uiTextBoxDate.Text, "dd/MM/yyyy", null);
         objData.ReadingsType = 2;
         objData.Save();
     }
     uiPanelCurrent.Visible = false;
     uiPanelAllReadings.Visible = true;
     uiRadEditorPageContent.Content = "";
     uiTextBoxDate.Text = "";
     LoadReadings();
 }