Exemplo n.º 1
0
        protected void cmdUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                PageFaceController controller = new PageFaceController();
                PageFaceInfo item = new PageFaceInfo();

                item.Content = txtContent.Text;
                item.ItemId = itemId;
                item.ModuleId = this.ModuleId;
                item.CreatedByUser = this.UserId;

                //determine if we are adding or updating
                if (Null.IsNull(item.ItemId))
                    controller.AddPageFace(item);
                else
                    controller.UpdatePageFace(item);

                Response.Redirect(Globals.NavigateURL(), true);
            }
            catch (Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }
Exemplo n.º 2
0
 protected void cmdDelete_Click(object sender, EventArgs e)
 {
     try
     {
         if (!Null.IsNull(itemId))
         {
             PageFaceController controller = new PageFaceController();
             controller.DeletePageFace(this.ModuleId, itemId);
             Response.Redirect(Globals.NavigateURL(), true);
         }
     }
     catch (Exception ex)
     {
         Exceptions.ProcessModuleLoadException(this, ex);
     }
 }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Request.QueryString["ItemId"] != null)
                {
                    itemId = Int32.Parse(Request.QueryString["ItemId"]);
                }

                if (!IsPostBack)
                {
                    //load the data into the control the first time
                    //we hit this page

                    cmdDelete.Attributes.Add("onClick", "javascript:return confirm('" + Localization.GetString("DeleteItem") + "');");

                    //check we have an item to lookup
                    if (!Null.IsNull(itemId))
                    {
                        //load the item
                        PageFaceController controller = new PageFaceController();
                        PageFaceInfo item = controller.GetPageFace(this.ModuleId, itemId);

                        if (item != null)
                        {
                            txtContent.Text = item.Content;
                            ctlAudit.CreatedByUser = item.CreatedByUserName;
                            ctlAudit.CreatedDate = item.CreatedDate.ToLongDateString();
                        }
                        else
                            Response.Redirect(Globals.NavigateURL(), true);
                    }
                    else
                    {
                        cmdDelete.Visible = false;
                        ctlAudit.Visible = false;
                    }
                }
            }
            catch (Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }