username@email.com
2025-05-20 10cada58c5ea2aa95b8eaaa1731b543582d618dc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CY.BLL;
using CY.Model;
using CY.Infrastructure.Query;
using CY.Infrastructure.Common;
 
namespace CY.WebForm.Pages.work
{
    //吴辉
    //公文基础数据列表
    public partial class OA_DocumentJuese : BasePage
    {
        OA_DocumentDicBLL bll_OA_DocumentDicBLL = null;
        OA_DocumentBLL bll_OA_DocumentBLL = null;
        OA_FirmRoleBLL oA_FirmRoleBLL = null;
        public string keyid = "";
 
        //初始化
        public OA_DocumentJuese()
        {
            bll_OA_DocumentDicBLL = new OA_DocumentDicBLL();
            bll_OA_DocumentBLL = new OA_DocumentBLL();
            oA_FirmRoleBLL = new OA_FirmRoleBLL();
        }
 
        //页面加载
        protected void Page_Load(object sender, EventArgs e)
        {
            
            if (!IsPostBack)
            {
                BindList();
            }
            if (Request["delete"] != null)
            {
                OA_DocumentDic model = bll_OA_DocumentDicBLL.GetModelByKeyid(Request["delete"].ToInt32());
                if (model != null && model.Keyid != null)
                {
                    bll_OA_DocumentDicBLL.DeleteModel(model);
                    JavaScript.MessageBox("删除成功", this);
                    Response.Redirect("/Pages/work/OA_DocumentJuese.aspx");
                }
                else
                    JavaScript.MessageBox("删除失败", this);
            }
 
            if (Request["deleteKeyIdsfsdfdsfsdfd"] != null)
            {
                var orderkeyid = Request["orderkeyid"];
                OA_Document m_OA_Document = bll_OA_DocumentBLL.GetModelByKeyid(Request["orderkeyid"].ToInt32());
                m_OA_Document.Jusequanxian = Request["deleteKeyIds"].ToString();
               if(bll_OA_DocumentBLL.UpdateModel(m_OA_Document))
                {
                    JavaScript.MessageBox("保存成功", this, true, false);
                }
                else
                {
                    JavaScript.MessageBox("保存失败", this);
                    return;
                }
 
                //List<int> deleteKeyIdList = new List<int>();
                //string deleteKeyIds = Request["deleteKeyIds"].ToString().Trim(',');
                //string[] keyIdArry = deleteKeyIds.Split(',');
                //foreach (string keyId in keyIdArry)
                //{
                //    OA_DocumentDic model = bll_OA_DocumentDicBLL.GetModelByKeyid(keyId.ToInt32());
                //    if (model.Keyid != null && model != null)
                //        bll_OA_DocumentDicBLL.DeleteModel(model);
                //    else
                //    {
                //        JavaScript.MessageBox("删除失败", this);
                //        return;
                //    }
                //}
 
                //Response.Redirect("/Pages/work/OA_DocumentJuese.aspx");
            }
        }
 
        //绑定数据
        private void BindList()
        {
            keyid = Request["keyid"];
            if (!string.IsNullOrEmpty(Request["keyid"]))
            {
                OA_Document m_OA_Document = bll_OA_DocumentBLL.GetModelByKeyid(Request["keyid"].ToInt32());
                if (m_OA_Document != null)
                {
                 var Jusequanxian =   m_OA_Document.Jusequanxian;
                    var oA_FirmRoles = oA_FirmRoleBLL.SelectList(CurrentUser.MemberId).Where(x=>x.IsUsed == true);
                    foreach(var oA_FirmRole in oA_FirmRoles)
                    {
                        if (!string.IsNullOrEmpty(Jusequanxian))
                        {
                           var  Jusequanxians = Jusequanxian.Split(',');
                           if(Jusequanxians.Count(x => x == oA_FirmRole.Keyid.Value.ToString()) > 0)
                            {
                                oA_FirmRole.ShifouCheck = "checked=\"checked\"";
                            }
                        }
                        
 
 
                    }
                    this.RepClientList.DataSource = oA_FirmRoles;
                    this.RepClientList.DataBind();
                }
            }
 
 
               
        }
 
 
        //表单提交
        protected void btn_submit_form(object sender, EventArgs e)
        {
            try
            {
                
                OA_Document m_OA_Document = bll_OA_DocumentBLL.GetModelByKeyid(Request["keyid"].ToInt32());
                m_OA_Document.Jusequanxian = deleteKeyIds.Value;
                if (bll_OA_DocumentBLL.UpdateModel(m_OA_Document))
                {
                    JavaScript.MessageBox("保存成功", this, true, false);
                }
                else
                {
                    JavaScript.MessageBox("保存失败", this);
                    return;
                }
            }
            catch (Exception ex)
            {
                PAGEHandleException(ex);
                JavaScript.MessageBox("保存失败", this);
            }
        }
 
 
    }
}