Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Global.CurrentUser != null)
                {
                    AccessRight = Global.CurrentUser.AccessRight.ToString();
                }

                JsonContent = "";
                DztzDataContext dbContext = new DztzDataContext();
                var             id        = Convert.ToInt32(Request["ledgerNodeId"]);
                var             itemId    = Convert.ToInt32(Request["ledgerNodeItemId"]);
                var             node      = dbContext.LedgerNodes.First(ln => ln.Id == id);
                if (node != null)
                {
                    LedgerNodeId = id.ToString();
                    Content      = node.TemplateContent;
                    Global.CurrentSelectedLedger = id;
                }
                var action = Request["action"];
                if (action != null)
                {
                    LedgerItemId = "0";
                    if (action == "1")
                    {
                        //display template to let user to fill data,
                        // Use ajax to save data.
                        Title = node.LedgerNodeType + "  --  " + node.LedgerNodeName + "  --  新建";
                    }
                    else if (action == "2")
                    {
                        // display template to display the data.
                        if (itemId == 0)
                        {
                            Response.Redirect("search.aspx?action=2&ledgerNodeId=" + id.ToString());
                        }
                        else
                        {
                            var nodeItem = dbContext.LedgerNodeItems.FirstOrDefault <LedgerNodeItem>(ln => ln.LedgerNodeId == id && ln.Id == itemId);
                            if (nodeItem != null)
                            {
                                LedgerItemId = nodeItem.Id.ToString();
                                JsonContent  = HttpUtility.UrlEncode(nodeItem.TemplateValue, Encoding.UTF8);
                            }
                            else
                            {
                                Response.Redirect("task.aspx?action=1&ledgerNodeId=" + id.ToString());
                            }

                            Title = node.LedgerNodeType + "  --  " + node.LedgerNodeName + "  --  修改";
                        }
                    }
                }
            }
            catch (Exception exp)
            {
                Console.Out.WriteLine(exp.ToString());
            }
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                var action = Request["action"];
                Action = action;
                if (action != null)
                {
                    if (action == "1")
                    {
                        (LedgerItemsGridView.Columns[7] as CommandField).SelectText = "查看";
                    }
                    else if (action == "2")
                    {
                        (LedgerItemsGridView.Columns[7] as CommandField).SelectText = "修改";
                    }
                }

                var             id        = Convert.ToInt32(Request["ledgerNodeId"]);
                DztzDataContext dbContext = new DztzDataContext();
                var             q         = from ln in dbContext.LedgerNodes
                                            where ln.Id == id
                                            select
                                            new { type = ln.LedgerNodeType, name = ln.LedgerNodeName };
                Title = q.First().type + "  --  " + q.First().name + " -- 查询";
                Global.CurrentSelectedLedger = id;
            }
            catch (Exception exp)
            {
                Console.Out.WriteLine(exp.ToString());
            }
        }
Example #3
0
        protected void Upload_Click(object sender, EventArgs e)
        {
            var ledgerNodeType = LedgerTypeList.SelectedValue;
            var accessRight    = Convert.ToInt64(Convert.ToInt64(Request.Form["accessRight"].ToString()));

            if (FileUploadCtrl.HasFile)
            {
                StreamReader sr = new StreamReader(FileUploadCtrl.FileContent);

                string templateContent = sr.ReadToEnd();
                sr.Dispose();
                DztzDataContext dbContext = new DztzDataContext();
                string          time      = DateTime.Now.ToString();
                dbContext.LedgerNodes.InsertOnSubmit(new LedgerNode()
                {
                    LedgerNodeType   = ledgerNodeType,
                    LedgerNodeName   = LedgerNodeName.Text == ""?FileUploadCtrl.FileName:LedgerNodeName.Text,
                    AccessRight      = accessRight,
                    CreateTime       = time,
                    CreateUser       = Global.CurrentUser.UserName,
                    ModifyTime       = time,
                    ModifyUser       = Global.CurrentUser.UserName,
                    TemplateFileName = FileUploadCtrl.FileName,
                    TemplateContent  = templateContent
                });

                dbContext.SubmitChanges();
            }
            else
            {
                ;
            }

            Response.Redirect("AddNode.aspx");
        }
Example #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                DztzDataContext dbContext   = new DztzDataContext();
                var             accessLevel = Convert.ToInt64(Request["accessLevel"]);
                var             node        = dbContext.AccessLevels.SingleOrDefault(ln => ln.ALValue == accessLevel);
                if (node != null)
                {
                    if (!Page.IsPostBack)
                    {
                        this.AccessLevelName.Text = node.ALName;
                    }

                    currentSelectedAccessLevel = accessLevel;
                    this.SaveBttn.Text         = "更新";
                }
                else
                {
                    if (!Page.IsPostBack)
                    {
                        this.AccessLevelName.Text = "";
                    }

                    this.SaveBttn.Text = "新建";
                }
            }
            catch (Exception exp)
            {
                Console.Out.WriteLine(exp.ToString());
            }
        }
Example #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                JsonContent = "";
                DztzDataContext dbContext = new DztzDataContext();
                var             id        = Convert.ToInt32(Request["ledgerNodeId"]);
                var             itemId    = Convert.ToInt32(Request["ledgerNodeItemId"]);
                var             node      = dbContext.LedgerNodes.First(ln => ln.Id == id);
                if (node != null)
                {
                    LedgerNodeId = id.ToString();
                    Content      = node.TemplateContent;
                    Global.CurrentSelectedLedger = id;
                }

                var nodeItem = dbContext.LedgerNodeItems.FirstOrDefault <LedgerNodeItem>(ln => ln.LedgerNodeId == id && ln.Id == itemId);
                if (nodeItem != null)
                {
                    LedgerItemId = nodeItem.Id.ToString();
                    JsonContent  = HttpUtility.UrlEncode(nodeItem.TemplateValue, Encoding.UTF8);
                }
                else
                {
                    Response.Redirect("task.aspx?action=1&ledgerNodeId=" + id.ToString());
                }

                Title = node.LedgerNodeType + "  --  " + node.LedgerNodeName + "  --  查看";
            }
            catch (Exception exp)
            {
                Console.Out.WriteLine(exp.ToString());
            }
        }
Example #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DztzDataContext dbContext = new DztzDataContext();

            if (dbContext.Users.Count() == 0)
            {
                RegisterBttn.Enabled = true;
            }
            else
            {
                RegisterBttn.Enabled = false;
            }
        }
Example #7
0
        protected void Save_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.tbPassword.Text != this.tbRePasswird.Text)
                {
                    Response.Write("2次输入的密码不一致");
                    return;
                }

                var             loginName = this.tbLoginName.Text;
                DztzDataContext dbContext = new DztzDataContext();
                string          time      = DateTime.Now.ToString();
                var             node      = dbContext.Users.SingleOrDefault(u => u.LoginName == this.tbLoginName.Text);
                if (node != null)
                {
                    Response.Write("用户已存在,不能新建");
                    return;
                }
                else
                {
                    dbContext.Users.InsertOnSubmit(new User()
                    {
                        LoginName    = this.tbLoginName.Text,
                        UserPassword = this.tbPassword.Text,
                        UserName     = this.tbUserName.Text,
                        MobilePhone  = this.tbMobilePhone.Text,
                        Email        = this.tbEmail.Text,
                        Department   = this.tbDepartment.Text,
                        Occupation   = this.tbOccupation.Text,
                        Description  = this.tbDescription.Text,
                        AccessRight  = Convert.ToInt64(Request.Form["accessRight"].ToString()),
                        Superior     = Convert.ToInt64(this.tbSuperior.Text),
                        CreateTime   = DateTime.Now,
                        LoginCount   = 0
                    });
                }

                dbContext.SubmitChanges();
            }
            catch (Exception exp)
            {
                Console.Out.WriteLine(exp.ToString());
            }

            Response.Redirect("Login.aspx");
        }
Example #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                DztzDataContext dbContext = new DztzDataContext();
                foreach (var n in dbContext.AccessLevels)
                {
                    AccessRight += n.ALValue;
                }

                this.AccessRightContent = AccessLevel.GetUIString(AccessRight);
                this.SaveBttn.Text      = "提交";
            }
            catch (Exception exp)
            {
                Console.Out.WriteLine(exp.ToString());
            }
        }
Example #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Global.CurrentUser != null)
                {
                    SqlDataSource1.SelectParameters["CurrentLoginUser"].DefaultValue = Global.CurrentUser.UserId.ToString();
                }

                DztzDataContext dbContext = new DztzDataContext();
                SelectedUserId = Convert.ToInt64(Request["userId"]);
                var node = dbContext.Users.SingleOrDefault(ln => ln.UserId == SelectedUserId);
                if (node != null)
                {
                    if (!Page.IsPostBack)
                    {
                        AccessRight           = node.AccessRight;
                        this.tbLoginName.Text = node.LoginName;
                        this.tbPassword.Attributes["value"]   = node.UserPassword;
                        this.tbRePasswird.Attributes["value"] = node.UserPassword;
                        this.tbUserName.Text    = node.UserName;
                        this.tbMobilePhone.Text = node.MobilePhone;
                        this.tbEmail.Text       = node.Email;
                        this.tbDepartment.Text  = node.Department;
                        this.tbOccupation.Text  = node.Occupation;
                        this.tbSuperior.Text    = node.Superior.ToString();
                        this.AccessRightContent = AccessLevel.GetUIString(node.AccessRight);
                        this.tbDescription.Text = node.Description;
                    }

                    this.SaveBttn.Text = "更新";
                }
                else
                {
                    AccessRight             = Global.CurrentUser.AccessRight;
                    this.AccessRightContent = AccessLevel.GetUIString(Global.CurrentUser.AccessRight);
                    this.SaveBttn.Text      = "新建";
                }
            }
            catch (Exception exp)
            {
                Console.Out.WriteLine(exp.ToString());
            }
        }
Example #10
0
        protected void LoginBttn_Click(object sender, EventArgs e)
        {
            DztzDataContext dbContext = new DztzDataContext();
            var             node      = dbContext.Users.SingleOrDefault(ln => ln.LoginName == txtName.Text);

            if (node != null && node.UserPassword == txtPassword.Text)
            {
                Global.CurrentUser = node;
                node.LoginCount   += 1;
                node.LastLoginTime = node.LoginTime;
                node.LoginTime     = DateTime.Now;
                dbContext.SubmitChanges();
                Response.Redirect("Index.aspx");
            }
            else
            {
                Response.Redirect("Login.aspx");
            }
        }
Example #11
0
        static public string GetUIString(long accessRight)
        {
            string html = "<tr><td class=\"auto-style1\">访问权限:&nbsp;</td><td><input id=\"accessRight\" name=\"accessRight\" value=\""
                          + accessRight.ToString() + "\"></td></tr><tr><td></td><td><table>";
            DztzDataContext dbContext = new DztzDataContext();

            foreach (var accessLevel in dbContext.AccessLevels)
            {
                if ((accessLevel.ALValue & accessRight) == accessLevel.ALValue)
                {
                    html += "<p><input id=\"al_" + accessLevel.ALValue.ToString()
                            + "\" type=\"checkbox\" Height=\"20px\" Width=\"500px\" checked=\"true\" onclick=\"updateAccessRight(this.id);\"/><label for=\"al_"
                            + accessLevel.ALValue.ToString() + "\">" + accessLevel.ALName + "</label></p>";
                }
            }

            html += "</table></td></tr>";
            return(html);
        }
Example #12
0
        protected void Save_Click(object sender, EventArgs e)
        {
            try
            {
                var             accesslevelName = this.AccessLevelName.Text;
                DztzDataContext dbContext       = new DztzDataContext();
                string          time            = DateTime.Now.ToString();
                var             node            = dbContext.AccessLevels.SingleOrDefault(ln => ln.ALName == accesslevelName);
                if (node != null)
                {
                    Response.Redirect("AccessLevel.aspx?accessLevel=0");
                }
                else
                {
                    if (SaveBttn.Text == "新建")//新建
                    {
                        var q = dbContext.AccessLevels.Max(x => x.ALValue);
                        dbContext.AccessLevels.InsertOnSubmit(new AccessLevel()
                        {
                            ALName  = accesslevelName,
                            ALValue = q * 2
                        });
                    }
                    else//更新
                    {
                        var q = dbContext.AccessLevels.SingleOrDefault(c => c.ALValue == currentSelectedAccessLevel);
                        q.ALName = accesslevelName;
                    }

                    dbContext.SubmitChanges();
                }
            }
            catch (Exception exp)
            {
                Console.Out.WriteLine(exp.ToString());
            }
            Response.Redirect("AccessLevel.aspx?accessLevel=0");
        }
Example #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Global.CurrentUser == null)
            {
                Response.Redirect("login.aspx");
            }

            LeftMenuContent = "<aside class=\"Hui-admin-aside-wrapper\"><div class=\"Hui-admin-logo-wrapper\"><a class=\"logo navbar-logo\" href=\"./\"><i class=\"va-m iconpic global-logo\"></i></a><a href =\"index.aspx?action=1\">电子台账 </a></div>";

            DztzDataContext dbContext = new DztzDataContext();
            var             q         = from ln in dbContext.LedgerNodes
                                        where (ln.AccessRight & Global.CurrentUser.AccessRight) == ln.AccessRight
                                        orderby ln.LedgerNodeType
                                        select
                                        new { id = ln.Id, type = ln.LedgerNodeType, name = ln.LedgerNodeName };
            string type         = "";
            string selectedtype = "";

            foreach (var ledgerNode in q)
            {
                if (Global.CurrentSelectedLedger == ledgerNode.id)
                {
                    selectedtype = ledgerNode.type;
                    break;
                }
            }

            foreach (var ledgerNode in q)
            {
                if (type == "")
                {
                    type = ledgerNode.type;
                    if (Global.CurrentSelectedLedger == ledgerNode.id)
                    {
                        LeftMenuContent += "<div class=\"Hui-admin-menu-dropdown bk_2\"><dl id = \"menu-article\" class=\"Hui-menu\">"
                                           + "<dt class=\"Hui-menu-title selected\">" + ledgerNode.type + "<i class=\"Hui-iconfont Hui-admin-menu-dropdown-arrow\">&#xe6d5;</i></dt>"
                                           + "<dd class=\"Hui-menu-item\" style=\"display: block;\"><ul><li><dl class=\"Hui-menu\">"
                                           + "<dt class=\"Hui-menu-title selected\">" + ledgerNode.name + "<i class=\"Hui-iconfont Hui-admin-menu-dropdown-arrow\">&#xe6d5;</i></dt>"
                                           + "<dd class=\"Hui-menu-item\" style=\"display: block;\"><ul>"
                                           + "<li><a href =\"task.aspx?action=1&ledgerNodeId=" + ledgerNode.id.ToString() + "\">填写 </a></li>"
                                           + "<li><a href=\"task.aspx?action=2&ledgerNodeId=" + ledgerNode.id.ToString() + "&ledgerNodeItemId=0\">修改</a></li>"
                                           + "<li><a href = \"search.aspx?action=1&ledgerNodeId=" + ledgerNode.id.ToString() + "\"> 查询 </a></li>"
                                           + "</ul></dd></dl>";
                    }
                    else
                    {
                        LeftMenuContent += "<div class=\"Hui-admin-menu-dropdown bk_2\"><dl id = \"menu-article\" class=\"Hui-menu\">"
                                           + (selectedtype == ledgerNode.type ? "<dt class=\"Hui-menu-title selected\">" : "<dt class=\"Hui-menu-title\">")
                                           + ledgerNode.type + "<i class=\"Hui-iconfont Hui-admin-menu-dropdown-arrow\">&#xe6d5;</i></dt>"
                                           + "<dd class=\"Hui-menu-item\"" + (selectedtype == ledgerNode.type ? " style=\"display: block;\"" : "") + "><ul><li><dl class=\"Hui-menu\">"
                                           + "<dt class=\"Hui-menu-title\">" + ledgerNode.name + "<i class=\"Hui-iconfont Hui-admin-menu-dropdown-arrow\">&#xe6d5;</i></dt>"
                                           + "<dd class=\"Hui-menu-item\"><ul>"
                                           + "<li><a href =\"task.aspx?action=1&ledgerNodeId=" + ledgerNode.id.ToString() + "\">填写 </a></li>"
                                           + "<li><a href=\"task.aspx?action=2&ledgerNodeId=" + ledgerNode.id.ToString() + "&ledgerNodeItemId=0\">修改</a></li>"
                                           + "<li><a href = \"search.aspx?action=1&ledgerNodeId=" + ledgerNode.id.ToString() + "\"> 查询 </a></li>"
                                           + "</ul></dd></dl>";
                    }
                }
                else if (type != ledgerNode.type)
                {
                    type             = ledgerNode.type;
                    LeftMenuContent += "</li></ul></dd></dl></div>";
                    if (Global.CurrentSelectedLedger == ledgerNode.id)
                    {
                        LeftMenuContent += "<div class=\"Hui-admin-menu-dropdown bk_2\"><dl id = \"menu-article\" class=\"Hui-menu\">"
                                           + "<dt class=\"Hui-menu-title selected\">" + ledgerNode.type + "<i class=\"Hui-iconfont Hui-admin-menu-dropdown-arrow\">&#xe6d5;</i></dt>"
                                           + "<dd class=\"Hui-menu-item\" style=\"display: block;\"><ul><li><dl class=\"Hui-menu\">"
                                           + "<dt class=\"Hui-menu-title selected\">" + ledgerNode.name + "<i class=\"Hui-iconfont Hui-admin-menu-dropdown-arrow\">&#xe6d5;</i></dt>"
                                           + "<dd class=\"Hui-menu-item\" style=\"display: block;\"><ul>"
                                           + "<li><a href =\"task.aspx?action=1&ledgerNodeId=" + ledgerNode.id.ToString() + "\">填写 </a></li>"
                                           + "<li><a href=\"task.aspx?action=2&ledgerNodeId=" + ledgerNode.id.ToString() + "&ledgerNodeItemId=0\">修改</a></li>"
                                           + "<li><a href = \"search.aspx?action=1&ledgerNodeId=" + ledgerNode.id.ToString() + "\"> 查询 </a></li>"
                                           + "</ul></dd></dl>";
                    }
                    else
                    {
                        LeftMenuContent += "<div class=\"Hui-admin-menu-dropdown bk_2\"><dl id = \"menu-article\" class=\"Hui-menu\">"
                                           + (selectedtype == ledgerNode.type ? "<dt class=\"Hui-menu-title selected\">" : "<dt class=\"Hui-menu-title\">")
                                           + ledgerNode.type + "<i class=\"Hui-iconfont Hui-admin-menu-dropdown-arrow\">&#xe6d5;</i></dt>"
                                           + "<dd class=\"Hui-menu-item\"" + (selectedtype == ledgerNode.type ? " style=\"display: block;\"" : "") + "><ul><li><dl class=\"Hui-menu\">"
                                           + "<dt class=\"Hui-menu-title\">" + ledgerNode.name + "<i class=\"Hui-iconfont Hui-admin-menu-dropdown-arrow\">&#xe6d5;</i></dt>"
                                           + "<dd class=\"Hui-menu-item\"><ul>"
                                           + "<li><a href =\"task.aspx?action=1&ledgerNodeId=" + ledgerNode.id.ToString() + "\">填写 </a></li>"
                                           + "<li><a href=\"task.aspx?action=2&ledgerNodeId=" + ledgerNode.id.ToString() + "&ledgerNodeItemId=0\">修改</a></li>"
                                           + "<li><a href = \"search.aspx?action=1&ledgerNodeId=" + ledgerNode.id.ToString() + "\"> 查询 </a></li>"
                                           + "</ul></dd></dl>";
                    }
                }
                else
                {
                    if (Global.CurrentSelectedLedger == ledgerNode.id)
                    {
                        LeftMenuContent += "<dl class=\"Hui-menu\">"
                                           + "<dt class=\"Hui-menu-title selected\">" + ledgerNode.name + "<i class=\"Hui-iconfont Hui-admin-menu-dropdown-arrow\">&#xe6d5;</i></dt>"
                                           + "<dd class=\"Hui-menu-item\" style=\"display: block;\"><ul>"
                                           + "<li><a href =\"task.aspx?action=1&ledgerNodeId=" + ledgerNode.id.ToString() + "\">填写 </a></li>"
                                           + "<li><a href=\"task.aspx?action=2&ledgerNodeId=" + ledgerNode.id.ToString() + "&ledgerNodeItemId=0\">修改</a></li>"
                                           + "<li><a href = \"search.aspx?action=1&ledgerNodeId=" + ledgerNode.id.ToString() + "\"> 查询 </a></li>"
                                           + "</ul></dd></dl>";
                    }
                    else
                    {
                        LeftMenuContent += "<dl class=\"Hui-menu\">"
                                           + "<dt class=\"Hui-menu-title\">" + ledgerNode.name + "<i class=\"Hui-iconfont Hui-admin-menu-dropdown-arrow\">&#xe6d5;</i></dt>"
                                           + "<dd class=\"Hui-menu-item\"><ul>"
                                           + "<li><a href =\"task.aspx?action=1&ledgerNodeId=" + ledgerNode.id.ToString() + "\">填写 </a></li>"
                                           + "<li><a href=\"task.aspx?action=2&ledgerNodeId=" + ledgerNode.id.ToString() + "&ledgerNodeItemId=0\">修改</a></li>"
                                           + "<li><a href = \"search.aspx?action=1&ledgerNodeId=" + ledgerNode.id.ToString() + "\"> 查询 </a></li>"
                                           + "</ul></dd></dl>";
                    }
                }
            }

            if (type != "")
            {
                LeftMenuContent += "</li></ul></dd></dl></div>";
            }

            LeftMenuContent += "<dl id=\"menu-home\" class=\"Hui-menu\"><dd class=\"Hui-menu-item-frist\"><ul><li style=\"margin: 0 0 0 25px; color: #20DA01\"><a href=\"AddNode.aspx\">账簿模板管理</a></li></ul></dd></dl>";
            LeftMenuContent += "<dl id=\"menu-home\" class=\"Hui-menu\"><dd class=\"Hui-menu-item-frist\"><ul><li style=\"margin: 0 0 0 25px; color: #20DA01\"><a href=\"UserManagement.aspx\">属下用户管理</a></li></ul></dd></dl>";
            if (Global.CurrentUser != null && ((Global.CurrentUser.AccessRight & 1) == 1))
            {
                LeftMenuContent += "<dl id=\"menu-home\" class=\"Hui-menu\"><dd class=\"Hui-menu-item-frist\"><ul><li style=\"margin: 0 0 0 25px; color: #20DA01\"><a href=\"AccessLevel.aspx?accessLevel=0\">访问权限管理</a></li></ul></dd></dl>";
            }

            LeftMenuContent += "</aside>";
        }
Example #14
0
        public void ProcessRequest(HttpContext context)
        {
            // Use ajax to get/post/update/delete data.
            //https://api.jquery.com/jQuery.ajax/
            //$.ajax('Server.ashx',)
            if (!string.IsNullOrEmpty(context.Request["ledgerItemId"]))
            {
                try
                {
                    int id = Convert.ToInt32(context.Request["ledgerItemId"]);

                    DztzDataContext dztz = new DztzDataContext();
                    if (id > 0)
                    {
                        var ledgerNodeItem = dztz.LedgerNodeItems.SingleOrDefault <LedgerNodeItem>(s => s.Id == id);
                        if (ledgerNodeItem != null) // update row
                        {
                            if (context.Request["name"] == "save")
                            {
                                ledgerNodeItem.Status = 0;
                                context.Response.Write("save ok");
                            }
                            else if (context.Request["name"] == "finish")
                            {
                                ledgerNodeItem.Status = 1;
                                context.Response.Write("finish ok");
                            }

                            string data = context.Request["content"];
                            ledgerNodeItem.ModifyTime    = DateTime.Now.ToString();
                            ledgerNodeItem.ModifyUser    = Global.CurrentUser.UserName;//current login user
                            ledgerNodeItem.TemplateValue = data;
                            dztz.SubmitChanges();
                        }
                        else
                        {
                            context.Response.Write("找不到需要更新的账簿。");
                        }
                    }
                    else // insert new row
                    {
                        var ledgerNodeItem = new LedgerNodeItem();
                        if (context.Request["name"] == "save")
                        {
                            ledgerNodeItem.Status = 0;
                            context.Response.Write("save ok");
                        }
                        else if (context.Request["name"] == "finish")
                        {
                            ledgerNodeItem.Status = 1;
                            context.Response.Write("finish ok");
                        }

                        string data = context.Request["content"];
                        ledgerNodeItem.LedgerNodeId   = Convert.ToInt32(context.Request["ledgerNodeId"]); //current ledgernode id
                        ledgerNodeItem.LedgerNodeName = dztz.LedgerNodes.SingleOrDefault <LedgerNode>(s => s.Id == ledgerNodeItem.LedgerNodeId).LedgerNodeName;
                        ledgerNodeItem.CreateUser     = Global.CurrentUser.UserName;                      //current login user
                        ledgerNodeItem.CreateTime     = DateTime.Now.ToString();
                        ledgerNodeItem.ModifyTime     = DateTime.Now.ToString();
                        ledgerNodeItem.ModifyUser     = Global.CurrentUser.UserName;//current login user
                        ledgerNodeItem.TemplateValue  = data;
                        dztz.LedgerNodeItems.InsertOnSubmit(ledgerNodeItem);
                        dztz.SubmitChanges();
                        if (ledgerNodeItem.Status == 0)
                        {
                            context.Response.Redirect("task.aspx?action=2&ledgerNodeId=" + ledgerNodeItem.LedgerNodeId.ToString());
                        }
                    }
                }
                catch (Exception e)
                {
                    context.Response.Write(e.ToString());
                }
            }
            else
            {
                context.Response.Write("not processed");
            }

            context.Response.ContentType = "text/plain";
            context.Response.End();
        }