This commit is contained in:
parent
74ed6ce38d
commit
5030ef836e
|
@ -18,10 +18,25 @@ namespace BLL
|
||||||
public const string sysglyId = "AF17168B-87BD-4GLY-1111-F0A0A1158F9B";
|
public const string sysglyId = "AF17168B-87BD-4GLY-1111-F0A0A1158F9B";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 系统管理员ID
|
/// 系统管理员ID——JT
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const string hfnbdId = "C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0";
|
public const string hfnbdId = "C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 施工部——付伟
|
||||||
|
/// </summary>
|
||||||
|
public const string fuweiId = "dd72a950-8a8e-4958-ba8c-954c58a9beea";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 施工部——申银行
|
||||||
|
/// </summary>
|
||||||
|
public const string shenyinhangId = "fb3b3171-f2f3-40b1-b40b-9424cc14ecfe";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 施工部——张慧敏
|
||||||
|
/// </summary>
|
||||||
|
public const string zhanghuiminId = "fb3b3171-f2f3-40b1-b40b-9424cc14ecfe";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 公共临时账户ID
|
/// 公共临时账户ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -11,26 +11,26 @@ using AspNet = System.Web.UI.WebControls;
|
||||||
namespace FineUIPro.Web.ProjectData
|
namespace FineUIPro.Web.ProjectData
|
||||||
{
|
{
|
||||||
public partial class ProjectSet : PageBase
|
public partial class ProjectSet : PageBase
|
||||||
{
|
{
|
||||||
public string URLToken
|
public string URLToken
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return (string)ViewState["URLToken"];
|
return (string)ViewState["URLToken"];
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
ViewState["URLToken"] = value;
|
ViewState["URLToken"] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 加载
|
#region 加载
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 加载页面
|
/// 加载页面
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sender"></param>
|
/// <param name="sender"></param>
|
||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
protected void Page_Load(object sender, EventArgs e)
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (!IsPostBack)
|
if (!IsPostBack)
|
||||||
{
|
{
|
||||||
|
@ -229,68 +229,68 @@ namespace FineUIPro.Web.ProjectData
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 关联摄像头
|
/// 关联摄像头
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sender"></param>
|
/// <param name="sender"></param>
|
||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
protected void btnMonitor_Click(object sender, EventArgs e)
|
protected void btnMonitor_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var sysSet16 = (from x in Funs.DB.Sys_Set where x.SetName == "视频监控地址" select x).ToList().FirstOrDefault();
|
var sysSet16 = (from x in Funs.DB.Sys_Set where x.SetName == "视频监控地址" select x).ToList().FirstOrDefault();
|
||||||
var sysSet17 = (from x in Funs.DB.Sys_Set where x.SetName == "视频监控密码" select x).ToList().FirstOrDefault();
|
var sysSet17 = (from x in Funs.DB.Sys_Set where x.SetName == "视频监控密码" select x).ToList().FirstOrDefault();
|
||||||
if (sysSet16 == null)
|
if (sysSet16 == null)
|
||||||
{
|
{
|
||||||
ShowNotify("视频监控地址未设置!", MessageBoxIcon.Warning);
|
ShowNotify("视频监控地址未设置!", MessageBoxIcon.Warning);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (sysSet17 == null)
|
if (sysSet17 == null)
|
||||||
{
|
{
|
||||||
ShowNotify("视频监控密码未设置!", MessageBoxIcon.Warning);
|
ShowNotify("视频监控密码未设置!", MessageBoxIcon.Warning);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(Grid1.SelectedRowID))
|
if (!string.IsNullOrEmpty(Grid1.SelectedRowID))
|
||||||
{
|
{
|
||||||
string url = sysSet16.SetValue;
|
string url = sysSet16.SetValue;
|
||||||
string username = "admin";
|
string username = "admin";
|
||||||
string password = sysSet17.SetValue;
|
string password = sysSet17.SetValue;
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(URLToken))
|
if (string.IsNullOrEmpty(URLToken))
|
||||||
{
|
{
|
||||||
String res = BLL.CommonService.CreateGetHttpResponse(url + "api/v1/login?username=" + username + "&password=" + Funs.EncryptionPassword(password));
|
String res = BLL.CommonService.CreateGetHttpResponse(url + "api/v1/login?username=" + username + "&password=" + Funs.EncryptionPassword(password));
|
||||||
Dictionary<string, string> dicres = JsonConvert.DeserializeObject<Dictionary<string, string>>(res);
|
Dictionary<string, string> dicres = JsonConvert.DeserializeObject<Dictionary<string, string>>(res);
|
||||||
URLToken = dicres["URLToken"];
|
URLToken = dicres["URLToken"];
|
||||||
}
|
}
|
||||||
var project = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == Grid1.SelectedRowID);
|
var project = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == Grid1.SelectedRowID);
|
||||||
|
|
||||||
string resUserInfor = BLL.CommonService.CreateGetHttpResponse(url + "api/v1/user/info?token=" + URLToken + "&username=" + project.ProjectCode);
|
string resUserInfor = BLL.CommonService.CreateGetHttpResponse(url + "api/v1/user/info?token=" + URLToken + "&username=" + project.ProjectCode);
|
||||||
if ("user not found".Equals(resUserInfor) || "远程服务器返回错误: (400) 错误的请求。".Equals(resUserInfor))
|
if ("user not found".Equals(resUserInfor) || "远程服务器返回错误: (400) 错误的请求。".Equals(resUserInfor))
|
||||||
{
|
{
|
||||||
string resUserSave = BLL.CommonService.CreateGetHttpResponse(url + "api/v1/user/save?token=" + URLToken + "&ID=0&Username=" + project.ProjectCode + "&Role=操作员,观众&Enable=true");
|
string resUserSave = BLL.CommonService.CreateGetHttpResponse(url + "api/v1/user/save?token=" + URLToken + "&ID=0&Username=" + project.ProjectCode + "&Role=操作员,观众&Enable=true");
|
||||||
Dictionary<string, string> dicUserSave = JsonConvert.DeserializeObject<Dictionary<string, string>>(resUserSave);
|
Dictionary<string, string> dicUserSave = JsonConvert.DeserializeObject<Dictionary<string, string>>(resUserSave);
|
||||||
project.MonitorId = dicUserSave["ID"];
|
project.MonitorId = dicUserSave["ID"];
|
||||||
string newPassWord = Funs.EncryptionPassword(DateTime.Now.Ticks.ToString());
|
string newPassWord = Funs.EncryptionPassword(DateTime.Now.Ticks.ToString());
|
||||||
newPassWord = newPassWord.Substring(newPassWord.Length - 9, 8);
|
newPassWord = newPassWord.Substring(newPassWord.Length - 9, 8);
|
||||||
string resResPS = BLL.CommonService.CreateGetHttpResponse(url + "api/v1/user/resetpassword?token=" + URLToken + "&id=" + dicUserSave["ID"] + "&password=" + newPassWord);
|
string resResPS = BLL.CommonService.CreateGetHttpResponse(url + "api/v1/user/resetpassword?token=" + URLToken + "&id=" + dicUserSave["ID"] + "&password=" + newPassWord);
|
||||||
project.MonitorPW = newPassWord;
|
project.MonitorPW = newPassWord;
|
||||||
|
|
||||||
Funs.DB.SubmitChanges();
|
Funs.DB.SubmitChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectMonitorList.aspx?ProjectCode={0}&Id={1}&URLToken={2}", project.ProjectCode, project.MonitorId, URLToken, "查看 - ")));
|
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectMonitorList.aspx?ProjectCode={0}&Id={1}&URLToken={2}", project.ProjectCode, project.MonitorId, URLToken, "查看 - ")));
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ShowNotify("请选择项目进入!", MessageBoxIcon.Warning);
|
ShowNotify("请选择项目进入!", MessageBoxIcon.Warning);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查看
|
/// 查看
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sender"></param>
|
/// <param name="sender"></param>
|
||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
protected void btnView_Click(object sender, EventArgs e)
|
protected void btnView_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(Grid1.SelectedRowID))
|
if (!string.IsNullOrEmpty(Grid1.SelectedRowID))
|
||||||
{ PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectSetMap.aspx?projectId={0}&value=0", Grid1.SelectedRowID, "查看 - "))); }
|
{ PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectSetMap.aspx?projectId={0}&value=0", Grid1.SelectedRowID, "查看 - "))); }
|
||||||
|
@ -316,11 +316,11 @@ namespace FineUIPro.Web.ProjectData
|
||||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, menuId);
|
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, menuId);
|
||||||
if (buttonList.Count() > 0)
|
if (buttonList.Count() > 0)
|
||||||
{
|
{
|
||||||
if (buttonList.Contains(BLL.Const.BtnAdd))
|
//if (buttonList.Contains(BLL.Const.BtnAdd))
|
||||||
{
|
//{
|
||||||
btnUpdata.Hidden = false;
|
// btnUpdata.Hidden = false;
|
||||||
this.btnNew.Hidden = false;
|
// this.btnNew.Hidden = false;
|
||||||
}
|
//}
|
||||||
if (buttonList.Contains(BLL.Const.BtnModify) || buttonList.Contains(BLL.Const.BtnSave))
|
if (buttonList.Contains(BLL.Const.BtnModify) || buttonList.Contains(BLL.Const.BtnSave))
|
||||||
{
|
{
|
||||||
this.btnMenuEdit.Hidden = false;
|
this.btnMenuEdit.Hidden = false;
|
||||||
|
@ -330,6 +330,13 @@ namespace FineUIPro.Web.ProjectData
|
||||||
this.btnMenuDelete.Hidden = false;
|
this.btnMenuDelete.Hidden = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string curruserId = this.CurrUser.UserId;
|
||||||
|
if (curruserId == Const.sysglyId || curruserId == Const.hfnbdId || curruserId == Const.fuweiId || curruserId == Const.shenyinhangId || curruserId == Const.zhanghuiminId)
|
||||||
|
{//只有管理员、JT、付伟、申银行、张慧敏的账号可以新增和维护项目数据
|
||||||
|
btnUpdata.Hidden = false;
|
||||||
|
this.btnNew.Hidden = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
@ -178,8 +178,8 @@
|
||||||
</f:FormRow>
|
</f:FormRow>
|
||||||
<f:FormRow>
|
<f:FormRow>
|
||||||
<Items>
|
<Items>
|
||||||
<f:TextArea ID="txtWorkRange" runat="server" Label="工作范围" MaxLength="500" Height="100px"></f:TextArea>
|
<f:TextArea ID="txtWorkRange" runat="server" Label="工作范围" MaxLength="500" Height="120px"></f:TextArea>
|
||||||
<f:TextArea ID="txtRemark" runat="server" Label="项目概况" MaxLength="500" Height="100px" LabelWidth="150px"></f:TextArea>
|
<f:TextArea ID="txtRemark" runat="server" Label="项目概况" MaxLength="500" Height="120px" LabelWidth="150px"></f:TextArea>
|
||||||
</Items>
|
</Items>
|
||||||
</f:FormRow>
|
</f:FormRow>
|
||||||
<f:FormRow>
|
<f:FormRow>
|
||||||
|
|
|
@ -35,6 +35,18 @@ namespace FineUIPro.Web.ProjectData
|
||||||
{
|
{
|
||||||
if (!IsPostBack)
|
if (!IsPostBack)
|
||||||
{
|
{
|
||||||
|
string curruserId = this.CurrUser.UserId;
|
||||||
|
if (curruserId == Const.sysglyId || curruserId == Const.hfnbdId || curruserId == Const.fuweiId || curruserId == Const.shenyinhangId || curruserId == Const.zhanghuiminId)
|
||||||
|
{//只有管理员、JT、付伟、申银行、张慧敏的账号可以新增和维护项目数据
|
||||||
|
btnSave.Hidden = false;
|
||||||
|
this.btnSave.Hidden = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
btnSave.Hidden = true;
|
||||||
|
this.btnSave.Hidden = true;
|
||||||
|
}
|
||||||
|
|
||||||
BindGrid();
|
BindGrid();
|
||||||
BindGrid2();
|
BindGrid2();
|
||||||
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||||
|
|
Loading…
Reference in New Issue