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);
|
}
|
}
|
|
|
}
|
}
|