Ejemplo n.º 1
0
        public void Delete(int id)
        {
            WorkLogInfo workLogInfo = new WorkLogInfo();

            workLogInfo.id = id;
            this.control.DeleteEntity(workLogInfo);
        }
Ejemplo n.º 2
0
 protected void Save_Btn(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(this.LogTitle.Value) && !string.IsNullOrEmpty(this.namelist.Value) && !string.IsNullOrEmpty(this.addTime.Value) && !string.IsNullOrEmpty(this.Bodys.Value))
     {
         HttpFileCollection files = HttpContext.Current.Request.Files;
         int num = 1;
         for (int i = 0; i < files.Count; i++)
         {
             HttpPostedFile f = files[i];
             if (Config.IsValidFile(f))
             {
                 num++;
             }
         }
         if (!string.IsNullOrEmpty(base.Request.QueryString["wid"]))
         {
             WorkLogInfo workLogInfo = this.ViewState["di"] as WorkLogInfo;
             workLogInfo.LogTitle   = this.LogTitle.Value;
             workLogInfo.FilePath   = this.UpdateFiles();
             workLogInfo.Notes      = this.Bodys.Value;
             workLogInfo.namelist   = this.namelist.Value;
             workLogInfo.ShareUsers = this.userlist.Value;
             workLogInfo.UpdateTime = DateTime.Now.ToString("yyyy-MM-dd");
             WorkLog.Init().Update(workLogInfo);
             MessageBox.ShowAndRedirect(this, "保存成功!", "WorkLogMenu.aspx");
         }
         else
         {
             WorkLogInfo workLogInfo = new WorkLogInfo();
             workLogInfo.AddTime         = this.addTime.Value;
             workLogInfo.UpdateTime      = DateTime.Now.ToString("yyyy-MM-dd");
             workLogInfo.CreatorDepName  = this.DepName;
             workLogInfo.CreatorID       = Convert.ToInt32(this.Uid);
             workLogInfo.CreatorRealName = this.RealName;
             workLogInfo.LogTitle        = this.LogTitle.Value;
             workLogInfo.FilePath        = this.UpdateFiles();
             workLogInfo.Notes           = this.Bodys.Value;
             workLogInfo.namelist        = this.namelist.Value;
             workLogInfo.ShareUsers      = this.userlist.Value;
             WorkLog.Init().Add(workLogInfo);
             MessageBox.ShowAndRedirect(this, "保存成功!", "WorkLogMenu.aspx");
         }
     }
     else
     {
         MessageBox.ShowAndRedirect(this, "必填项不能为空!", base.Request.Url.AbsoluteUri);
     }
 }
Ejemplo n.º 3
0
    protected void Del_Btn(object obj, EventArgs e)
    {
        LinkButton   linkButton   = obj as LinkButton;
        RepeaterItem repeaterItem = linkButton.Parent.Parent as RepeaterItem;
        Panel        panel        = repeaterItem.FindControl("d") as Panel;

        if (panel.Visible)
        {
            HtmlInputCheckBox htmlInputCheckBox = repeaterItem.FindControl("chk") as HtmlInputCheckBox;
            int         id   = Convert.ToInt32(htmlInputCheckBox.Value);
            WorkLogInfo byId = WorkLog.Init().GetById(id);
            Help.DeleteFiles(byId.FilePath);
            WorkLog.Init().Delete(id);
            this.Show();
        }
    }
Ejemplo n.º 4
0
    protected void Save_Btn(object sender, EventArgs e)
    {
        HttpFileCollection files = HttpContext.Current.Request.Files;
        int num = 1;

        for (int i = 0; i < files.Count; i++)
        {
            HttpPostedFile f = files[i];
            if (Config.IsValidFile(f))
            {
                num++;
            }
        }
        if (!string.IsNullOrEmpty(base.Request.QueryString["wid"]))
        {
            WorkLogInfo workLogInfo = this.ViewState["di"] as WorkLogInfo;
            workLogInfo.LogTitle   = this.LogTitle.Value;
            workLogInfo.FilePath   = this.UpdateFiles();
            workLogInfo.Notes      = this.Bodys.Value;
            workLogInfo.namelist   = this.namelist.Value;
            workLogInfo.ShareUsers = this.userlist.Value;
            workLogInfo.UpdateTime = DateTime.Now.ToString("yyyy-MM-dd");
            WorkLog.Init().Update(workLogInfo);
            string str = HttpContext.Current.Server.HtmlEncode("您好!工作汇报已保存成功!");
            base.Response.Redirect("/InfoTip/Operate_Success.aspx?returnpage=" + base.Request.Url.AbsoluteUri + "&tip=" + str);
        }
        else
        {
            WorkLogInfo workLogInfo = new WorkLogInfo();
            workLogInfo.AddTime         = this.addTime.Value;
            workLogInfo.UpdateTime      = DateTime.Now.ToString("yyyy-MM-dd");
            workLogInfo.CreatorDepName  = this.DepName;
            workLogInfo.CreatorID       = Convert.ToInt32(this.Uid);
            workLogInfo.CreatorRealName = this.RealName;
            workLogInfo.LogTitle        = this.LogTitle.Value;
            workLogInfo.FilePath        = this.UpdateFiles();
            workLogInfo.Notes           = this.Bodys.Value;
            workLogInfo.namelist        = this.namelist.Value;
            workLogInfo.ShareUsers      = this.userlist.Value;
            WorkLog.Init().Add(workLogInfo);
            string str = HttpContext.Current.Server.HtmlEncode("您好!工作汇报已保存成功!");
            base.Response.Redirect("/InfoTip/Operate_Success.aspx?returnpage=" + base.Request.Url.AbsoluteUri + "&tip=" + str);
        }
    }
Ejemplo n.º 5
0
 private void Show(string did)
 {
     if (!string.IsNullOrEmpty(did))
     {
         WorkLogInfo byId = WorkLog.Init().GetById(Convert.ToInt32(did));
         this.ViewState["di"]  = byId;
         this.LogTitle.Value   = byId.LogTitle;
         this.Bodys.Value      = byId.Notes;
         this.userlist.Value   = byId.ShareUsers;
         this.namelist.Value   = byId.namelist;
         this.addTime.Value    = byId.AddTime;
         this.addTime.Disabled = true;
         if (!string.IsNullOrEmpty(byId.FilePath) && byId.FilePath.Contains("|"))
         {
             this.Attachword.Visible = true;
             List <TmpInfo> list  = new List <TmpInfo>();
             string[]       array = byId.FilePath.Split(new char[]
             {
                 '|'
             });
             for (int i = 0; i < array.Length; i++)
             {
                 if (array[i].Trim() != "")
                 {
                     TmpInfo tmpInfo = new TmpInfo();
                     int     num     = array[i].LastIndexOf('/') + 1;
                     string  tmp     = array[i].Substring(num, array[i].Length - num);
                     string  tmp2    = array[i].Replace("~", "");
                     tmpInfo.Tmp1 = array[i];
                     tmpInfo.Tmp2 = tmp;
                     tmpInfo.Tmp3 = tmp2;
                     list.Add(tmpInfo);
                 }
             }
             this.rpt.DataSource = list;
             this.rpt.DataBind();
         }
     }
 }
Ejemplo n.º 6
0
    private void Show(string wid)
    {
        WorkLogInfo byId = WorkLog.Init().GetById(Convert.ToInt32(wid));

        if (this.Uid == string.Concat(byId.CreatorID) || byId.ShareUsers.Contains("#" + this.Uid + "#"))
        {
            this.TaskUser.InnerText   = byId.CreatorRealName + "(" + byId.CreatorDepName + ")";
            this.WorkTitle.InnerText  = byId.LogTitle;
            this.AddTime.InnerText    = byId.AddTime;
            this.UpdateTime.InnerText = byId.UpdateTime;
            if (this.Notes.InnerHtml.ToLower().Contains("script"))
            {
                this.Notes.InnerHtml = byId.Notes.ToLower().Replace("script", "scrript").Replace("\r\n", "<br>");
            }
            else
            {
                this.Notes.InnerHtml = byId.Notes.ToLower().Replace("\r\n", "<br>");
            }
            if (!string.IsNullOrEmpty(byId.FilePath))
            {
                string[] array = byId.FilePath.Split(new char[]
                {
                    '|'
                });
                for (int i = 0; i < array.Length; i++)
                {
                    if (array[i].Trim() != "")
                    {
                        int    num = array[i].LastIndexOf('/') + 1;
                        string arg = array[i].Substring(num, array[i].Length - num);
                        string s   = array[i].Replace("~", "");
                        this.fjs += string.Format(this.fj, base.Server.UrlEncode(s), arg);
                    }
                }
            }
        }
    }
Ejemplo n.º 7
0
 public void Update(WorkLogInfo WorkLog_)
 {
     this.control.UpdateEntity(WorkLog_, WorkLog_.id);
 }
Ejemplo n.º 8
0
 public void Add(WorkLogInfo WorkLog_)
 {
     this.control.AddEntity(WorkLog_);
 }
Ejemplo n.º 9
0
 public void Update(WorkLogInfo com)
 {
     WorkLog.dal.Update(com);
 }
Ejemplo n.º 10
0
 public void Add(WorkLogInfo com)
 {
     WorkLog.dal.Add(com);
 }