protected void btnSubmit_Click(object sender, EventArgs e) { var t = new Satrabel.OpenBlocks.Block.Block(); var tc = new BlockController(); if (ItemId > 0) { t = tc.GetBlock(ItemId, PortalId); t.LastModifiedByUserId = UserId; t.LastModifiedOnDate = DateTime.Now; //t.AssignedUserId = Convert.ToInt32(ddlAssignedUser.SelectedValue); } else { t = new Satrabel.OpenBlocks.Block.Block() { //AssignedUserId = Convert.ToInt32(ddlAssignedUser.SelectedValue), CreatedByUserId = UserId, CreatedOnDate = DateTime.Now, }; } t.Name = txtName.Text.Trim(); t.CultureCode = ddlCultureCode.SelectedIndex > 0 ? ddlCultureCode.SelectedValue : ""; t.BlockType = int.Parse(rblType.SelectedValue); if (t.BlockType == 1) { t.Content = txtContentTxt.Text.Trim(); } else if (t.BlockType == 2) { t.Content = ((TextEditor)txtContentHtml).Text; } t.LastModifiedOnDate = DateTime.Now; t.LastModifiedByUserId = UserId; t.PortalId = PortalId; if (t.BlockId > 0) { tc.UpdateBlock(t); } else { tc.CreateBlock(t); } Response.Redirect(DotNetNuke.Common.Globals.NavigateURL()); }
protected void btnSubmit_Click(object sender, EventArgs e) { var t = new Satrabel.OpenBlocks.Block.Block(); var tc = new BlockController(); if (ItemId > 0) { t = tc.GetBlock(ItemId, PortalId); t.LastModifiedByUserId = UserId; t.LastModifiedOnDate = DateTime.Now; //t.AssignedUserId = Convert.ToInt32(ddlAssignedUser.SelectedValue); } else { t = new Satrabel.OpenBlocks.Block.Block() { //AssignedUserId = Convert.ToInt32(ddlAssignedUser.SelectedValue), CreatedByUserId = UserId, CreatedOnDate = DateTime.Now, }; } t.Name = txtName.Text.Trim(); t.CultureCode = ddlCultureCode.SelectedIndex > 0 ? ddlCultureCode.SelectedValue : ""; t.BlockType = int.Parse(rblType.SelectedValue); if (t.BlockType == 1) t.Content = txtContentTxt.Text.Trim(); else if (t.BlockType == 2) t.Content = ((TextEditor)txtContentHtml).Text; t.LastModifiedOnDate = DateTime.Now; t.LastModifiedByUserId = UserId; t.PortalId = PortalId; if (t.BlockId > 0) { tc.UpdateBlock(t); } else { tc.CreateBlock(t); } Response.Redirect(DotNetNuke.Common.Globals.NavigateURL()); }