0316-002-gaofei

This commit is contained in:
gaofei 2022-03-16 15:27:47 +08:00
parent ab09cf21d2
commit 1ca2236fc9
1 changed files with 85 additions and 85 deletions

View File

@ -57,8 +57,8 @@ namespace FineUIPro.Web.PZHGL.GJSX
} }
} }
public static DataTable Table=new DataTable (); public static DataTable Table = new DataTable();
private static List<Model.GJSX_detail> GJSX_detail = new List<Model.GJSX_detail>(); private static List<Model.GJSX_detail> GJSX_detail = new List<Model.GJSX_detail>();
#endregion #endregion
@ -72,7 +72,7 @@ namespace FineUIPro.Web.PZHGL.GJSX
if (!IsPostBack) if (!IsPostBack)
{ {
string EditType = Request.Params["EditType"]; string EditType = Request.Params["EditType"];
string ID= Request.Params["ID"]; string ID = Request.Params["ID"];
Table = null; Table = null;
UnitService.InitUnitDropDownList(this.DropUnitId, this.CurrUser.LoginProjectId, false); UnitService.InitUnitDropDownList(this.DropUnitId, this.CurrUser.LoginProjectId, false);
//专业 //专业
@ -90,7 +90,7 @@ namespace FineUIPro.Web.PZHGL.GJSX
UserService.InitUserDropDownList(DropNextRecipient, CurrUser.LoginProjectId, false, string.Empty); UserService.InitUserDropDownList(DropNextRecipient, CurrUser.LoginProjectId, false, string.Empty);
this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
if (EditType=="add") if (EditType == "add")
{ {
txtGJSXID.Readonly = true; txtGJSXID.Readonly = true;
txtUserID.Readonly = true; txtUserID.Readonly = true;
@ -99,11 +99,11 @@ namespace FineUIPro.Web.PZHGL.GJSX
this.nextProgress.Visible = false; this.nextProgress.Visible = false;
//编号 //编号
string projectCode = BLL.ProjectService.GetProjectCodeByProjectId(this.CurrUser.LoginProjectId); string projectCode = BLL.ProjectService.GetProjectCodeByProjectId(this.CurrUser.LoginProjectId);
this.txtGJSXID.Text = BLL.SQLHelper.RunProcNewId("Sp_GJSXGetNewCode", "GJSX", "GJSXID", projectCode); this.txtGJSXID.Text = BLL.SQLHelper.RunProcNewId("Sp_GJSXGetNewCode", "GJSX", "GJSXID", projectCode);
//当前时间 //当前时间
this.Date_CreateDate.Text = string.Format("{0:yyyy-MM-dd HH:mm:ss}", DateTime.Now); this.Date_CreateDate.Text = string.Format("{0:yyyy-MM-dd HH:mm:ss}", DateTime.Now);
///权限 ///权限
@ -142,8 +142,8 @@ namespace FineUIPro.Web.PZHGL.GJSX
btnSave.Visible = false; btnSave.Visible = false;
TextIsEnable(false); //使文本不可编辑 TextIsEnable(false); //使文本不可编辑
Model.GJSX gjsx= BLL.GJSXService.GetGJSXById(ID); Model.GJSX gjsx = BLL.GJSXService.GetGJSXById(ID);
List<SqlParameter> listStr = new List<SqlParameter>(); List<SqlParameter> listStr = new List<SqlParameter>();
string projectId = this.CurrUser.LoginProjectId; string projectId = this.CurrUser.LoginProjectId;
if (gjsx != null) if (gjsx != null)
@ -155,10 +155,10 @@ namespace FineUIPro.Web.PZHGL.GJSX
listStr.Add(new SqlParameter("@sql_where", sql)); listStr.Add(new SqlParameter("@sql_where", sql));
SqlParameter[] parameter = listStr.ToArray(); SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunProc("Sp_GJSX_getlist", parameter); DataTable tb = SQLHelper.GetDataTableRunProc("Sp_GJSX_getlist", parameter);
if (tb != null && tb.Rows.Count > 0) if (tb != null && tb.Rows.Count > 0)
{ {
txtGJSXID.Text = gjsx.GJSXID; txtGJSXID.Text = gjsx.GJSXID;
DropUnitId.SelectedValue = gjsx.UnitId; DropUnitId.SelectedValue = gjsx.UnitId;
if (!string.IsNullOrEmpty(gjsx.CNProfessional_ID)) if (!string.IsNullOrEmpty(gjsx.CNProfessional_ID))
{ {
@ -180,28 +180,28 @@ namespace FineUIPro.Web.PZHGL.GJSX
List<string> list_User_ReceiveID = gjsx.User_ReceiveID.Split(',').ToList(); List<string> list_User_ReceiveID = gjsx.User_ReceiveID.Split(',').ToList();
DropUser_ReceiveID.SelectedValueArray = list_User_ReceiveID.ToArray(); DropUser_ReceiveID.SelectedValueArray = list_User_ReceiveID.ToArray();
} }
// Date_CloseDate.Text = tb.Rows[0]["CloseDate"].ToString(); // Date_CloseDate.Text = tb.Rows[0]["CloseDate"].ToString();
txtDetail.Text = tb.Rows[0]["detail"].ToString(); txtDetail.Text = tb.Rows[0]["detail"].ToString();
txtUserID.Text = tb.Rows[0]["username"].ToString().Trim(); txtUserID.Text = tb.Rows[0]["username"].ToString().Trim();
Date_CreateDate.Text = tb.Rows[0]["createDate"].ToString(); Date_CreateDate.Text = tb.Rows[0]["createDate"].ToString();
Date_CompleteDate.Text = tb.Rows[0]["CompleteDate"].ToString(); Date_CompleteDate.Text = tb.Rows[0]["CompleteDate"].ToString();
rblState.SelectedValue = gjsx.State.ToString().Trim(); rblState.SelectedValue = gjsx.State.ToString().Trim();
} }
if (this.CurrUser.UserId==BLL.Const.sysglyId||this.CurrUser.UserId==BLL.Const.SystemManager)//如果当前登录人是管理员 if (this.CurrUser.UserId == BLL.Const.sysglyId || this.CurrUser.UserId == BLL.Const.SystemManager)//如果当前登录人是管理员
{ {
TextIsEnable(true); TextIsEnable(true);
txtGJSXID.Readonly = true; txtGJSXID.Readonly = true;
this.Progress_detail.Visible = false; this.Progress_detail.Visible = false;
this.nextProgress.Visible = false; this.nextProgress.Visible = false;
Grid2Binging(); Grid2Binging();
} }
if (gjsx.UserID == this.CurrUser.UserId) //如果当前登录人是提出人 if (gjsx.UserID == this.CurrUser.UserId) //如果当前登录人是提出人
{ {
rblIsClosed.Visible = false; rblIsClosed.Visible = false;
if (BLL.GJSXService.GetGJSXById(txtGJSXID.Text).State.Trim()=="1") if (BLL.GJSXService.GetGJSXById(txtGJSXID.Text).State.Trim() == "1")
{ {
TextIsEnable(true); TextIsEnable(true);
txtGJSXID.Readonly = true; txtGJSXID.Readonly = true;
@ -214,7 +214,7 @@ namespace FineUIPro.Web.PZHGL.GJSX
Grid2Binging(); Grid2Binging();
} }
} }
else if(gjsx.User_ReceiveID.Contains(this.CurrUser.UserId)) //接收者 else if (!string.IsNullOrEmpty(gjsx.User_ReceiveID) && gjsx.User_ReceiveID.Contains(this.CurrUser.UserId)) //接收者
{ {
rblIsClosed.Visible = false; rblIsClosed.Visible = false;
btnSave.Visible = false; btnSave.Visible = false;
@ -231,7 +231,7 @@ namespace FineUIPro.Web.PZHGL.GJSX
btnSave.Visible = false; btnSave.Visible = false;
btnsubmit.Visible = false; btnsubmit.Visible = false;
} }
if (gjsx.User_Acceptance.Contains(this.CurrUser.UserId)) //如果当前登录人为验收人 if (!string.IsNullOrEmpty(gjsx.User_Acceptance) && gjsx.User_Acceptance.Contains(this.CurrUser.UserId)) //如果当前登录人为验收人
{ {
rblIsClosed.Visible = true; rblIsClosed.Visible = true;
btnSave.Visible = false; btnSave.Visible = false;
@ -272,16 +272,16 @@ namespace FineUIPro.Web.PZHGL.GJSX
//} //}
if (IsClosed_ManyPeople()) if (IsClosed_ManyPeople())
{ {
this.nextProgress.Visible = true; this.nextProgress.Visible = true;
this.rblIsClosed.Visible = true; this.rblIsClosed.Visible = true;
} }
else else
{ {
this.rblIsClosed.Visible = false; this.rblIsClosed.Visible = false;
} }
} }
if (BLL.GJSXService.GetGJSXById(this.txtGJSXID.Text).State.Trim()=="0") if (BLL.GJSXService.GetGJSXById(this.txtGJSXID.Text).State.Trim() == "0")
{ {
Progress_detail.Enabled = false; Progress_detail.Enabled = false;
nextProgress.Visible = false; nextProgress.Visible = false;
@ -289,33 +289,33 @@ namespace FineUIPro.Web.PZHGL.GJSX
} }
} }
} }
} }
/// <summary> /// <summary>
/// 文本框控件是否启用 /// 文本框控件是否启用
/// </summary> /// </summary>
private void TextIsEnable( bool isStart ) private void TextIsEnable(bool isStart)
{ {
txtGJSXID.Enabled = isStart; txtGJSXID.Enabled = isStart;
DropUnitId.Enabled = isStart; DropUnitId.Enabled = isStart;
DropCNProfessional_ID.Enabled = isStart; DropCNProfessional_ID.Enabled = isStart;
txtUserID.Enabled = isStart; txtUserID.Enabled = isStart;
Date_CreateDate.Enabled = isStart; Date_CreateDate.Enabled = isStart;
DropQuestionTypeID.Enabled = isStart; DropQuestionTypeID.Enabled = isStart;
DropUser_Acceptance.Enabled = isStart; DropUser_Acceptance.Enabled = isStart;
Date_CompleteDate.Enabled = isStart; Date_CompleteDate.Enabled = isStart;
DropUser_ReceiveID.Enabled = isStart; DropUser_ReceiveID.Enabled = isStart;
// Date_CloseDate.Enabled = isStart; // Date_CloseDate.Enabled = isStart;
txtDetail.Enabled = isStart; txtDetail.Enabled = isStart;
} }
private void Grid2Binging() private void Grid2Binging()
{ {
GJSX_detail = BLL.GJSXItemService.GetGJSXDetailByGJSXID(txtGJSXID.Text ); GJSX_detail = BLL.GJSXItemService.GetGJSXDetailByGJSXID(txtGJSXID.Text);
if (rblState.SelectedValue.Trim()=="2") if (rblState.SelectedValue.Trim() == "2")
{ {
Model.GJSX_detail detail = new Model.GJSX_detail Model.GJSX_detail detail = new Model.GJSX_detail
{ {
@ -329,8 +329,8 @@ namespace FineUIPro.Web.PZHGL.GJSX
GJSX_detail.Add(detail); GJSX_detail.Add(detail);
} }
Grid2.RecordCount = GJSX_detail.Count; Grid2.RecordCount = GJSX_detail.Count;
var table = this.GetPagedDataTable(Grid2, GJSX_detail); var table = this.GetPagedDataTable(Grid2, GJSX_detail);
Table = table; Table = table;
@ -354,9 +354,9 @@ namespace FineUIPro.Web.PZHGL.GJSX
// 性别 // 性别
UpdateDataRow("FilePath", rowDict, rowData); UpdateDataRow("FilePath", rowDict, rowData);
} }
private DataRow FindRowByID(string rowID) private DataRow FindRowByID(string rowID)
{ {
DataTable table = Table; DataTable table = Table;
foreach (DataRow row in table.Rows) foreach (DataRow row in table.Rows)
@ -371,7 +371,7 @@ namespace FineUIPro.Web.PZHGL.GJSX
private void Grid2Save(Grid grid) private void Grid2Save(Grid grid)
{ {
Dictionary<int, Dictionary<string, object>> modifiedDict = Grid2.GetModifiedDict(); Dictionary<int, Dictionary<string, object>> modifiedDict = Grid2.GetModifiedDict();
if (modifiedDict!=null) if (modifiedDict != null)
{ {
foreach (int rowIndex in modifiedDict.Keys) foreach (int rowIndex in modifiedDict.Keys)
{ {
@ -380,17 +380,17 @@ namespace FineUIPro.Web.PZHGL.GJSX
UpdateDataRow(modifiedDict[rowIndex], row); UpdateDataRow(modifiedDict[rowIndex], row);
} }
} }
Model.GJSX_detail _Detail = new Model.GJSX_detail(); Model.GJSX_detail _Detail = new Model.GJSX_detail();
for (int i = 0; i < Table.Rows.Count; i++) for (int i = 0; i < Table.Rows.Count; i++)
{ {
_Detail.Cuid = Table.Rows[i]["Cuid"].ToString(); _Detail.Cuid = Table.Rows[i]["Cuid"].ToString();
_Detail.GJSXID = Table.Rows[i]["GJSXID"].ToString(); _Detail.GJSXID = Table.Rows[i]["GJSXID"].ToString();
_Detail.Progress_user = Table.Rows[i]["Progress_user"].ToString(); _Detail.Progress_user = Table.Rows[i]["Progress_user"].ToString();
_Detail.Date = DateTime.Parse(Table.Rows[i]["Date"].ToString()); _Detail.Date = DateTime.Parse(Table.Rows[i]["Date"].ToString());
_Detail.Progress_detail = Table.Rows[i]["Progress_detail"].ToString(); _Detail.Progress_detail = Table.Rows[i]["Progress_detail"].ToString();
_Detail.FilePath = Table.Rows[i]["FilePath"].ToString(); _Detail.FilePath = Table.Rows[i]["FilePath"].ToString();
Model.GJSX_detail isExit_detail = BLL.GJSXItemService.GetGJSXMXById(_Detail.Cuid); Model.GJSX_detail isExit_detail = BLL.GJSXItemService.GetGJSXMXById(_Detail.Cuid);
if (isExit_detail == null) if (isExit_detail == null)
{ {
@ -402,11 +402,11 @@ namespace FineUIPro.Web.PZHGL.GJSX
BLL.GJSXItemService.UpdateGJSXdetail(_Detail); BLL.GJSXItemService.UpdateGJSXdetail(_Detail);
} }
} }
} }
private void save(string state) private void save(string state)
{ {
if (this.DropUnitId.SelectedValue == Const._Null) if (this.DropUnitId.SelectedValue == Const._Null)
{ {
@ -513,7 +513,7 @@ namespace FineUIPro.Web.PZHGL.GJSX
} }
} }
if (rblIsClosed.SelectedValue== "true") if (rblIsClosed.SelectedValue == "true")
{ {
gjsx.CloseDate = DateTime.Now; gjsx.CloseDate = DateTime.Now;
} }
@ -532,28 +532,28 @@ namespace FineUIPro.Web.PZHGL.GJSX
} }
protected void DropUser_ReceiveID_TextChanged(object sender, EventArgs e) protected void DropUser_ReceiveID_TextChanged(object sender, EventArgs e)
{ {
if (DropUser_ReceiveID.SelectedItemArray.Length>1) if (DropUser_ReceiveID.SelectedItemArray.Length > 1)
{ {
lblIsManyPeople.Hidden = false; lblIsManyPeople.Hidden = false;
} }
} }
private bool IsClosed_ManyPeople() private bool IsClosed_ManyPeople()
{ {
bool IsClosed_ManyPeople=true; bool IsClosed_ManyPeople = true;
List<string > gJSX_Process = BLL.GJSXProcessService.GetProcessListByGJSXID(txtGJSXID.Text); List<string> gJSX_Process = BLL.GJSXProcessService.GetProcessListByGJSXID(txtGJSXID.Text);
foreach (var item in gJSX_Process) foreach (var item in gJSX_Process)
{ {
Model.GJSX_detail gJSX_Detail = BLL.GJSXItemService.GetGJSXItemByGJSXID(txtGJSXID.Text,item); Model.GJSX_detail gJSX_Detail = BLL.GJSXItemService.GetGJSXItemByGJSXID(txtGJSXID.Text, item);
if (gJSX_Detail==null) if (gJSX_Detail == null)
{ {
IsClosed_ManyPeople= false; IsClosed_ManyPeople = false;
} }
} }
return IsClosed_ManyPeople; return IsClosed_ManyPeople;
} }
/// <summary> /// <summary>
/// 提交 /// 提交
@ -562,7 +562,7 @@ namespace FineUIPro.Web.PZHGL.GJSX
/// <param name="e"></param> /// <param name="e"></param>
protected void btnsubmit_Click(object sender, EventArgs e) protected void btnsubmit_Click(object sender, EventArgs e)
{ {
if (rblIsClosed.SelectedValue== "true") if (rblIsClosed.SelectedValue == "true")
{ {
save("0"); save("0");
} }
@ -570,14 +570,14 @@ namespace FineUIPro.Web.PZHGL.GJSX
{ {
save("2"); save("2");
} }
string nextreceuserid = DropNextRecipient.SelectedValue; string nextreceuserid = DropNextRecipient.SelectedValue;
BLL.GJSXProcessService.DeleteProcess(this.txtGJSXID.Text); //先删除 BLL.GJSXProcessService.DeleteProcess(this.txtGJSXID.Text); //先删除
List<string> List_GJSXProcess = BLL.GJSXProcessService.GetProcessListByGJSXID(this.txtGJSXID.Text); List<string> List_GJSXProcess = BLL.GJSXProcessService.GetProcessListByGJSXID(this.txtGJSXID.Text);
foreach (var item in this.DropUser_ReceiveID.SelectedValueArray) foreach (var item in this.DropUser_ReceiveID.SelectedValueArray)
{ {
if (item != BLL.Const._Null) if (item != BLL.Const._Null)
{ {
if (!List_GJSXProcess.Contains(item)) //不存在接收记录 if (!List_GJSXProcess.Contains(item)) //不存在接收记录
@ -585,21 +585,21 @@ namespace FineUIPro.Web.PZHGL.GJSX
Model.GJSX_Process gJSX_Process = new Model.GJSX_Process() Model.GJSX_Process gJSX_Process = new Model.GJSX_Process()
{ {
ProcessID = Guid.NewGuid().ToString(), ProcessID = Guid.NewGuid().ToString(),
GJSXID= txtGJSXID.Text, GJSXID = txtGJSXID.Text,
UserId =item UserId = item
}; };
BLL.GJSXProcessService.AddProcess(gJSX_Process); //后添加 BLL.GJSXProcessService.AddProcess(gJSX_Process); //后添加
} }
}
}
if (Table !=null) }
}
if (Table != null)
{ {
Grid2.GetModifiedDict(); Grid2.GetModifiedDict();
Grid2Save(Grid2); Grid2Save(Grid2);
} }
if (nextreceuserid != null) if (nextreceuserid != null)
{ {
Model.GJSX gJSX = BLL.GJSXService.GetGJSXById(txtGJSXID.Text); Model.GJSX gJSX = BLL.GJSXService.GetGJSXById(txtGJSXID.Text);
@ -688,6 +688,6 @@ namespace FineUIPro.Web.PZHGL.GJSX
} }
#endregion #endregion
} }
} }