Beispiel #1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            PortalSecurity objSecurity = new PortalSecurity();

            var d  = new DocumentsInfo();
            var dc = new DocumentsInfoRepository();


            if (Page.IsValid == true)
            {
                if (DocumentId > 0)
                {
                    d = dc.GetItem(DocumentId, ModuleId);
                    if (d != null)
                    {
                        d.CohortStartDate = DateTime.Parse(txtCohortStartDate.Text.ToString());
                        //d.Action = rdbAction.SelectedValue.ToString();
                        d.Action = dplAction.SelectedValue.ToString();
                        FileInfo documentFile = (FileInfo)FileManager.Instance.GetFile(d.FileId);
                        d.GroupId = GroupId;
                    }
                }
                else
                {
                    d = new DocumentsInfo()
                    {
                        CreatedByUserId = UserId,
                        CreatedOnDate   = DateTime.UtcNow,
                        CohortStartDate = DateTime.Parse(txtCohortStartDate.Text.ToString()),
                        //Action = rdbAction.SelectedValue.ToString(),
                        Action  = dplAction.SelectedValue.ToString(),
                        FileId  = UploadFile(GroupId),
                        GroupId = GroupId,
                    };
                }

                d.LastModifiedOnDate   = DateTime.Now;
                d.LastModifiedByUserId = UserId;
                d.ModuleId             = ModuleId;

                if (d.DocumentId > 0)
                {
                    dc.UpdateItem(d);
                }
                else
                {
                    dc.CreateItem(d);
                }
                //Response.Redirect(DotNetNuke.Common.Globals.NavigateURL());
                //Response.Redirect(Globals.NavigateURL(PortalSettings.ActiveTab.TabID, PortalSettings, string.Empty , "groupId=" + GroupId.ToString()));
                Response.Redirect(Globals.NavigateURL(37, PortalSettings, string.Empty, "groupId=" + GroupId.ToString()));
            }
        }
 public void CreateItem(DocumentsInfo i)
 {
     repo.CreateItem(i);
 }