Ejemplo n.º 1
0
    protected void DownLoad(object sender, EventArgs e)
    {
        IList  all  = Sys_Dep.Init().GetAll(null, "order by orders asc,phone desc");
        string text = "组织机构通讯录\r\n\r\n";
        string str  = "Organization ContactsBook";

        foreach (object current in all)
        {
            Sys_DepInfo sys_DepInfo = current as Sys_DepInfo;
            if (!string.IsNullOrEmpty(sys_DepInfo.Phone))
            {
                string text2 = text;
                text = string.Concat(new string[]
                {
                    text2,
                    sys_DepInfo.DepName,
                    ":",
                    sys_DepInfo.Phone,
                    "\r\n"
                });
            }
        }
        base.Response.Clear();
        base.Response.ClearHeaders();
        base.Response.Buffer = false;
        base.Response.AppendHeader("Content-Disposition", "attachment;filename=" + str + ".txt");
        base.Response.ContentType = "application/vnd.txt";
        base.Response.Write(text);
        base.Response.Flush();
        base.Response.End();
    }
Ejemplo n.º 2
0
    private void Show()
    {
        IList all = Sys_Dep.Init().GetAll(null, "order by orders asc,phone desc");

        this.rpt.DataSource = all;
        this.rpt.DataBind();
        this.num.InnerHtml = "当前总计 - <span style='color:#ff0000; font-weight:bold;'>" + all.Count + "</span> 个 记录数据";
    }
Ejemplo n.º 3
0
    private void DeleteDep(Sys_DepInfo sdi)
    {
        IList all = Sys_Dep.Init().GetAll("ParentID=" + sdi.id, null);

        for (int i = 0; i < all.Count; i++)
        {
            Sys_DepInfo sdi2 = all[i] as Sys_DepInfo;
            this.DeleteDep(sdi2);
        }
        this.DeleteUser(sdi.id);
        this.DeleteModule(sdi.id);
        Sys_Dep.Init().Delete(sdi.id);
    }
Ejemplo n.º 4
0
		private void GetTreeItems(int did, IList li)
		{
			IList all = Sys_User.Init().GetAll("DepID=" + did, "order by status asc,orders asc");
			foreach (object current in all)
			{
				li.Add(current);
			}
			IList all2 = Sys_Dep.Init().GetAll("ParentID=" + did, "order by orders asc");
			if (all2.Count != 0)
			{
				foreach (Sys_DepInfo sys_DepInfo in all2)
				{
					this.GetTreeItems(sys_DepInfo.id, li);
				}
			}
		}
Ejemplo n.º 5
0
    protected void Del_Btn(object sender, EventArgs e)
    {
        LinkButton  linkButton      = sender as LinkButton;
        string      commandArgument = linkButton.CommandArgument;
        Sys_DepInfo byId            = Sys_Dep.Init().GetById(Convert.ToInt32(commandArgument));

        if (byId.ParentID != 0)
        {
            this.DeleteDep(byId);
            this.Show();
        }
        else
        {
            base.Response.Write("<script>alert('根节点不可删除!');window.location='Dep_List.aspx';</script>");
        }
    }
Ejemplo n.º 6
0
    private void Show(string uid)
    {
        Sys_DepInfo byId = Sys_Dep.Init().GetById(Convert.ToInt32(uid));

        this.UDepName5.InnerText   = byId.DepName;
        this.Orders5.InnerText     = string.Concat(byId.Orders);
        this.Notes5.InnerText      = byId.Notes;
        this.IsPosition5.InnerText = ((byId.IsPosition == 0) ? "职位" : "部门");
        this.Phone5.InnerText      = byId.Phone;
        if (byId.ParentID != 0)
        {
            Sys_DepInfo byId2 = Sys_Dep.Init().GetById(Convert.ToInt32(byId.ParentID));
            this.father5.InnerText = byId2.DepName;
        }
        else
        {
            this.father5.InnerText = "无上级 部门/职位";
        }
    }
Ejemplo n.º 7
0
    private void Show(string did)
    {
        Sys_DepInfo byId = Sys_Dep.Init().GetById(Convert.ToInt32(did));

        this.ViewState["sd"]          = byId;
        this.parentID.SelectedValue   = string.Concat(byId.ParentID);
        this.UDepName.Value           = byId.DepName;
        this.Notes.Value              = byId.Notes;
        this.IsPosition.SelectedValue = string.Concat(byId.IsPosition);
        this.Orders.Value             = string.Concat(byId.Orders);
        this.Phone.Value              = byId.Phone;
        IList         all  = Sys_Dep_Module.Init().GetAll("DepID=" + did, null);
        List <string> list = new List <string>();

        for (int i = 0; i < all.Count; i++)
        {
            Sys_Dep_ModuleInfo sys_Dep_ModuleInfo = all[i] as Sys_Dep_ModuleInfo;
            list.Add(string.Concat(sys_Dep_ModuleInfo.ModuleID));
        }
        this.ViewState["old_module"] = list;
        this.powerListBind(all, this.powerList);
    }
Ejemplo n.º 8
0
 protected void Save_Btn(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(base.Request.QueryString["did"]))
     {
         int         num         = Convert.ToInt32(base.Request.QueryString["did"]);
         Sys_DepInfo sys_DepInfo = this.ViewState["sd"] as Sys_DepInfo;
         sys_DepInfo.DepName    = this.UDepName.Value.Replace("#", "").Replace(",", "");
         sys_DepInfo.IsPosition = Convert.ToInt32(this.IsPosition.SelectedValue);
         sys_DepInfo.Orders     = Convert.ToInt32(this.Orders.Value);
         sys_DepInfo.Notes      = this.Notes.Value;
         sys_DepInfo.Phone      = this.Phone.Value;
         if (sys_DepInfo.ParentID != 0)
         {
             sys_DepInfo.ParentID = Convert.ToInt32(this.parentID.SelectedValue);
         }
         Sys_Dep.Init().Update(sys_DepInfo);
         string cmdText = string.Concat(new object[]
         {
             "update Sys_User set DepName='",
             sys_DepInfo.DepName,
             "' where DepID=",
             sys_DepInfo.id
         });
         MsSqlOperate.ExecuteNonQuery(CommandType.Text, cmdText, null);
         List <string> list  = this.ViewState["old_module"] as List <string>;
         List <string> list2 = new List <string>();
         for (int i = 0; i < this.powerList.Items.Count; i++)
         {
             if (this.powerList.Items[i].Selected)
             {
                 list2.Add(this.powerList.Items[i].Value);
             }
         }
         for (int i = 0; i < list.Count; i++)
         {
             if (!list2.Contains(list[i]))
             {
                 string cmdText2 = string.Concat(new object[]
                 {
                     "delete from Sys_Dep_Module where DepID=",
                     num,
                     " and ModuleID=",
                     list[i]
                 });
                 MsSqlOperate.ExecuteNonQuery(CommandType.Text, cmdText2, null);
             }
         }
         for (int i = 0; i < list2.Count; i++)
         {
             if (!list.Contains(list2[i]))
             {
                 Sys_Dep_ModuleInfo sys_Dep_ModuleInfo = new Sys_Dep_ModuleInfo();
                 sys_Dep_ModuleInfo.ModuleID = Convert.ToInt32(list2[i]);
                 sys_Dep_ModuleInfo.DepID    = num;
                 Sys_Dep_Module.Init().Add(sys_Dep_ModuleInfo);
             }
         }
         string str = HttpContext.Current.Server.HtmlEncode("您好!部门/职位已编辑成功!");
         base.Response.Redirect("~/InfoTip/Operate_Success.aspx?returnpage=" + base.Request.Url.AbsoluteUri + "&tip=" + str);
     }
     else
     {
         Sys_DepInfo sys_DepInfo = new Sys_DepInfo();
         sys_DepInfo.DepName    = this.UDepName.Value.Replace("#", "").Replace(",", "");
         sys_DepInfo.IsPosition = Convert.ToInt32(this.IsPosition.SelectedValue);
         sys_DepInfo.Orders     = Convert.ToInt32(this.Orders.Value);
         sys_DepInfo.Notes      = this.Notes.Value;
         sys_DepInfo.Phone      = this.Phone.Value;
         sys_DepInfo.ParentID   = Convert.ToInt32(this.parentID.SelectedValue);
         Sys_Dep.Init().Add(sys_DepInfo);
         for (int i = 0; i < this.powerList.Items.Count; i++)
         {
             if (this.powerList.Items[i].Selected)
             {
                 Sys_Dep_ModuleInfo sys_Dep_ModuleInfo = new Sys_Dep_ModuleInfo();
                 sys_Dep_ModuleInfo.ModuleID = Convert.ToInt32(this.powerList.Items[i].Value);
                 sys_Dep_ModuleInfo.DepID    = sys_DepInfo.id;
                 Sys_Dep_Module.Init().Add(sys_Dep_ModuleInfo);
             }
         }
         string str = HttpContext.Current.Server.HtmlEncode("您好!部门/职位已添加成功!");
         base.Response.Redirect("~/InfoTip/Operate_Success.aspx?returnpage=" + base.Request.Url.AbsoluteUri + "&tip=" + str);
     }
 }
Ejemplo n.º 9
0
 protected void Save_Btn(object sender, EventArgs e)
 {
     this.nums = Convert.ToInt32(this.ViewState["nums"]);
     if (this.nums == 0)
     {
         Bas_ComInfo bas_ComInfo = new Bas_ComInfo();
         bas_ComInfo.MsgState       = Convert.ToInt32(this.TypeID.Value);
         bas_ComInfo.et3            = Convert.ToInt32(this.et3.Value);
         bas_ComInfo.ComName        = this.ComName.Value.Replace("#", "").Replace(",", "");
         bas_ComInfo.Notes          = this.Notes.Value;
         bas_ComInfo.AddTime        = DateTime.Now;
         bas_ComInfo.BBSState       = Convert.ToInt32(this.BBSState.Checked);
         bas_ComInfo.ValidCodeState = Convert.ToInt32(this.ValidCodeState.Checked);
         bas_ComInfo.TipsState      = Convert.ToInt32(this.TipsState.Checked);
         bas_ComInfo.WebUrl         = "http://" + this.WebUrl.Value.ToLower().Replace("http://", "");
         bas_ComInfo.Logo           = this.Logo.Value;
         bas_ComInfo.et4            = this.et4.Value;
         Bas_Com.Init().Add(bas_ComInfo);
         Sys_DepInfo sys_DepInfo = new Sys_DepInfo();
         sys_DepInfo.DepName  = bas_ComInfo.ComName.Replace("#", "").Replace(",", "");
         sys_DepInfo.Notes    = bas_ComInfo.Notes;
         sys_DepInfo.ParentID = 0;
         sys_DepInfo.Orders   = 0;
         sys_DepInfo.ComID    = bas_ComInfo.id;
         sys_DepInfo.ComGUID  = bas_ComInfo.guid;
         Sys_Dep.Init().Add(sys_DepInfo);
         HttpContext.Current.Application["cominfo"] = bas_ComInfo;
         try
         {
             // this.Sendcom(bas_ComInfo);
         }
         catch
         {
         }
         string str = HttpContext.Current.Server.HtmlEncode("您好!企业信息已成功保存!");
         base.Response.Redirect("~/InfoTip/Operate_Success.aspx?returnpage=" + base.Request.Url.AbsoluteUri + "&tip=" + str);
     }
     else
     {
         Bas_ComInfo bas_ComInfo = this.ViewState["Bas_Com"] as Bas_ComInfo;
         bas_ComInfo.MsgState       = Convert.ToInt32(this.TypeID.Value);
         bas_ComInfo.et3            = Convert.ToInt32(this.et3.Value);
         bas_ComInfo.ComName        = this.ComName.Value.Replace("#", "").Replace(",", "");
         bas_ComInfo.Notes          = this.Notes.Value;
         bas_ComInfo.BBSState       = Convert.ToInt32(this.BBSState.Checked);
         bas_ComInfo.ValidCodeState = Convert.ToInt32(this.ValidCodeState.Checked);
         bas_ComInfo.TipsState      = Convert.ToInt32(this.TipsState.Checked);
         bas_ComInfo.WebUrl         = "http://" + this.WebUrl.Value.ToLower().Replace("http://", "");
         bas_ComInfo.Logo           = this.Logo.Value;
         bas_ComInfo.et4            = this.et4.Value;
         Bas_Com.Init().Update(bas_ComInfo);
         HttpContext.Current.Application["cominfo"] = bas_ComInfo;
         IList all = Sys_Dep.Init().GetAll("ComID=" + bas_ComInfo.id, null);
         if (all.Count != 0)
         {
             Sys_DepInfo sys_DepInfo = all[0] as Sys_DepInfo;
             sys_DepInfo.DepName  = bas_ComInfo.ComName.Replace("#", "").Replace(",", "");
             sys_DepInfo.Notes    = bas_ComInfo.Notes;
             sys_DepInfo.ParentID = 0;
             sys_DepInfo.Orders   = 0;
             sys_DepInfo.ComID    = bas_ComInfo.id;
             sys_DepInfo.ComGUID  = bas_ComInfo.guid;
             Sys_Dep.Init().Update(sys_DepInfo);
             IList all2 = Sys_User.Init().GetAll("depid=" + sys_DepInfo.id, null);
             foreach (object current in all2)
             {
                 Sys_UserInfo sys_UserInfo = current as Sys_UserInfo;
                 sys_UserInfo.DepName = sys_DepInfo.DepName.Replace("#", "").Replace(",", "");
                 Sys_User.Init().Update(sys_UserInfo);
             }
         }
         try
         {
             // this.Sendcom(bas_ComInfo);
         }
         catch
         {
         }
         string str = HttpContext.Current.Server.HtmlEncode("您好!企业信息已成功保存!");
         base.Response.Redirect("~/InfoTip/Operate_Success.aspx?returnpage=" + base.Request.Url.AbsoluteUri + "&tip=" + str);
     }
 }