protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { FactoryID = String.IsNullOrEmpty(Request.QueryString["FID"]) ? 98 : int.Parse(Request.QueryString["FID"]); did = String.IsNullOrEmpty(Request.QueryString["did"]) ? 0 : int.Parse(Request.QueryString["did"]); type = String.IsNullOrEmpty(Request.QueryString["type"]) ? "view" : Request.QueryString["type"]; try { this.UserAD = CurrentUser.UserADAcount; } catch { Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('用户AD丢失!');</script>"); Response.End(); } CARDataBLL dataBll = new CARDataBLL(FactoryID); dataInfo = dataBll.GetByKey(did); if (dataInfo.op_type != 3) { Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('非法访问!');</script>"); Response.End(); } if (type == "view") { if (!HasRight(XmlSource.GetRightIndex("VIEW")) || !HasRight(XmlSource.GetRightIndex("JIAOZHENG"))) { Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('您没有查看此页面的权限!');</script>"); Response.End(); } div_sp.Visible = false; Info_Content.AutoConfigure = CuteEditor.AutoConfigure.None; Info_Content.ActiveTab = CuteEditor.TabType.View; Info_Content.ShowBottomBar = false; Interim_Action.AutoConfigure = CuteEditor.AutoConfigure.None; Interim_Action.ActiveTab = CuteEditor.TabType.View; Interim_Action.ShowBottomBar = false; IPCA.AutoConfigure = CuteEditor.AutoConfigure.None; IPCA.ActiveTab = CuteEditor.TabType.View; IPCA.ShowBottomBar = false; CONF_Content.AutoConfigure = CuteEditor.AutoConfigure.None; CONF_Content.ActiveTab = CuteEditor.TabType.View; CONF_Content.ShowBottomBar = false; InitPage(dataInfo); } else if (type == "approval") { if (dataInfo.status == 0 || dataInfo.status == 1 || dataInfo.status == 14) { Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('此单未在审批中!');</script>"); Response.End(); } Check(); InitPage(dataInfo); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Date_Start.Text = DateTime.Now.AddDays(-10).ToShortDateString(); Date_End.Text = DateTime.Now.ToShortDateString(); if (!HasRight(XmlSource.GetRightIndex("SA")) || !HasRight(XmlSource.GetRightIndex("VIEW"))) { Response.Write("<script>alert('你没有权限进入此页面!');</script>"); Response.End(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { FactoryID = String.IsNullOrEmpty(Request.QueryString["FID"]) ? 98 : int.Parse(Request.QueryString["FID"]); did = String.IsNullOrEmpty(Request.QueryString["did"]) ? 0 : int.Parse(Request.QueryString["did"]); type = String.IsNullOrEmpty(Request.QueryString["type"]) ? "view" : Request.QueryString["type"]; try { this.UserAD = CurrentUser.UserADAcount; } catch { Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('用户AD丢失!');</script>"); Response.End(); } QSMBLL qsmbll = new QSMBLL(FactoryID); qsminfo = qsmbll.getQSMInfoByrkey(did); if (type == "view") { if (!HasRight(XmlSource.GetRightIndex("VIEW")) || !HasRight(XmlSource.GetRightIndex("QSM"))) { Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('您没有查看此页面的权限!');</script>"); Response.End(); } div_sp.Visible = false; CAR_Content.AutoConfigure = CuteEditor.AutoConfigure.None; CAR_Content.ActiveTab = CuteEditor.TabType.View; CAR_Content.ShowBottomBar = false; Info_Content.AutoConfigure = CuteEditor.AutoConfigure.None; Info_Content.ActiveTab = CuteEditor.TabType.View; Info_Content.ShowBottomBar = false; CONF_Content.AutoConfigure = CuteEditor.AutoConfigure.None; CONF_Content.ActiveTab = CuteEditor.TabType.View; CONF_Content.ShowBottomBar = false; InitPage(qsminfo); } else if (type == "approval") { if (qsminfo.STATUS == 0 || qsminfo.STATUS == 1 || qsminfo.STATUS == 14) { Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('此单未在审批中!');</script>"); Response.End(); } Check(); InitPage(qsminfo); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (!HasRight(XmlSource.GetRightIndex("SA")) || !HasRight(XmlSource.GetRightIndex("VIEW"))) { Response.Clear(); Response.Write("<script>alert('你没有权限进入此页面!');</script>"); Response.End(); } InitWebElement(); BindData(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (!HasRight(XmlSource.GetRightIndex("VIEW"))) { Response.Write("<script>alert('你没有权限进入此页面!');</script>"); Response.End(); return; } did = String.IsNullOrEmpty(Request.QueryString["did"]) ? 0 : int.Parse(Request.QueryString["did"]); type = string.IsNullOrEmpty(Request.QueryString["type"]) ? "" : Request.QueryString["type"].ToString(); BindData(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { FactoryID = String.IsNullOrEmpty(Request.QueryString["FID"]) ? 98 : int.Parse(Request.QueryString["FID"]); did = String.IsNullOrEmpty(Request.QueryString["did"]) ? 0 : int.Parse(Request.QueryString["did"]); type = String.IsNullOrEmpty(Request.QueryString["type"]) ? "view" : Request.QueryString["type"]; try { this.UserAD = CurrentUser.UserADAcount; } catch { Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('用户AD丢失!');</script>"); Response.End(); } SABLL saBLL = new SABLL(FactoryID); saInfo = saBLL.getSAInfoByrkey(did); if (type == "view") { if (!HasRight(XmlSource.GetRightIndex("VIEW")) || !HasRight(XmlSource.GetRightIndex("SA"))) { Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('您没有查看此页面的权限!');</script>"); Response.End(); } div_sp.Visible = false; InitPage(saInfo); } else if (type == "approval") { Check(); InitPage(saInfo); } } }
protected void Initialize() { #region 判断用户权限 if (!HasRight(XmlSource.GetRightIndex("BD"))) { Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('你没有权限进入此页面!');</script>"); Response.End(); return; } #endregion #region 初始化界面 Init_Company(1); did = String.IsNullOrEmpty(Request.QueryString["did"]) ? 0 : int.Parse(Request.QueryString["did"]); if (did > 0) { dataInfo = new CARDataBLL(CurrentFactoryID).GetByKey(did); if (dataInfo.op_type != 1) { Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('非法访问!');</script>"); Response.End(); return; } if (dataInfo.status == 0 || dataInfo.status == 14) //未审批、未发启 { div_AppListEdit.Style.Remove("display"); div_AppListShow.Style.Add("display", "none"); //div_AppListEdit.Visible = true; //div_AppListShow.Visible = false; #region 审批信息 ApprovalTable = new CARLogBLL(CurrentFactoryID).GetDataSet("select sp_step as 步骤,'' as 审批人,sp_user as 帐号 from CAR_Table_LOG where sn_type='' and SN_PTR=" + dataInfo.rkey.ToString() + " order by sp_step"); GridView1.DataSource = ApprovalTable; GridView1.DataBind(); #endregion } else //已经发送审批,不可更改 { sendApproval.Enabled = false; ibtn_Save.Enabled = false; //ibtn_Cancel.Enabled = false; 取消按钮不实现任何功能 div_AppListShow.Style.Remove("display"); div_AppListEdit.Style.Add("display", "none"); //div_AppListEdit.Visible = false; //div_AppListShow.Visible = true; #region 审批信息 tb_ApprovalInfo = new CARLogBLL(CurrentFactoryID).GetDataSet("select sp_step,sp_user,sp_end_date,status,sp_content from CAR_Table_LOG where SN_PTR=" + dataInfo.rkey.ToString() + " order by sp_step"); for (int i = 0; i < tb_ApprovalInfo.Rows.Count; i++) { tb_ApprovalInfo.Rows[i][1] = GetUserName(tb_ApprovalInfo.Rows[i][1].ToString()); } GridView2.DataSource = tb_ApprovalInfo; GridView2.DataBind(); #endregion } #region 申请信息 Required_Date.Text = dataInfo.required_date.ToString(); try { Serial_No.Items.FindByText(dataInfo.serial_no).Selected = true; } catch { } Happen_Date.Text = dataInfo.happen_date.ToString(); From_Comp.Items.FindByText(dataInfo.from_comp).Selected = true; CAR_Comp.Items.FindByText(dataInfo.car_comp).Selected = true; Issued_User.Text = dataInfo.issued_user; Issued_APP.Text = dataInfo.issued_app; Received_User.Text = dataInfo.received_user; CAR_Content.Text = Server.HtmlDecode(dataInfo.car_content); #endregion } #endregion #region 根据权限来控制页面功能 if (!HasRight(XmlSource.GetRightIndex("EDIT"))) { sendApproval.Enabled = false; ibtn_Save.Enabled = false; } if (did > 0) { if (dataInfo.nowuser != CurrentUser.UserADAcount && !CurrentUser.RightIsAdmin)//如果当前用户不是发启人,就只能查看 { sendApproval.Enabled = false; ibtn_Save.Enabled = false; } } #endregion #region 文件路径 string id = System.Web.HttpContext.Current.User.Identity.Name.Replace("FOUNDERPCB\\", ""); id = id + @"/" + System.DateTime.Now.Date.ToShortDateString(); //Response.Write("id" + id); //建立用户目录 string path = Server.MapPath(@"uploads/" + id); if (!System.IO.Directory.Exists(path)) { System.IO.Directory.CreateDirectory(path);//在指定路径下新建一个文件夹 } CAR_Content.SetSecurityImageGalleryPath(path); CAR_Content.SetSecurityImageGalleryPath(path); CAR_Content.SetSecurityMediaGalleryPath(path); CAR_Content.SetSecurityFlashGalleryPath(path); CAR_Content.SetSecurityFilesGalleryPath(path); #endregion }
protected void Initialize() { lnk_CSS.Href = Request.Path.Substring(0, Request.Path.LastIndexOf('/')) + "/CSS/GV.css"; #region 判断用户权限 if (!HasRight(XmlSource.GetRightIndex("SA"))) { Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('你没有权限进入此页面!');</script>"); Response.End(); return; } #endregion #region 初始化界面 did = String.IsNullOrEmpty(Request.QueryString["did"]) ? 0 : int.Parse(Request.QueryString["did"]); #region gridview3数据绑定 tb_SA = new CARDataBLL(CurrentFactoryID).GetDataSet("select * from CAR_Table_SAList where sn_ptr = " + did.ToString()); if (tb_SA.Rows.Count < row_Number) { for (int i = 0; i < row_Number - tb_SA.Rows.Count;) { DataRow row = tb_SA.NewRow(); for (int j = 0; j < tb_SA.Columns.Count; j++) { row[j] = DBNull.Value; } tb_SA.Rows.Add(row); } } GridView3.DataSource = tb_SA; GridView3.DataBind(); #endregion if (did > 0) { saInfo = new SABLL(CurrentFactoryID).getSAInfoByrkey(did); CAR_Content.Text = Server.HtmlDecode(saInfo.CAR_CONTENT); CAR_Content.ActiveTab = CuteEditor.TabType.View; if (saInfo.STATUS != 0 && saInfo.STATUS != 14)//审批中或审批完成 { CAR_Content.AutoConfigure = CuteEditor.AutoConfigure.None; CAR_Content.ShowBottomBar = false; } if (saInfo.STATUS == 0 || saInfo.STATUS == 14) //未审批、未发启或审批拒绝 { div_AppListEdit.Visible = true; #region 审批信息 ApprovalTable = new CARLogBLL(CurrentFactoryID).GetDataSet("select sp_step as 步骤,'' as 审批人,sp_user as 帐号 from CAR_Table_LOG where sn_type = 'SA' and SN_PTR=" + saInfo.RKEY.ToString() + " order by sp_step"); for (int i = 0; i < ApprovalTable.Rows.Count; i++) { ApprovalTable.Rows[i][1] = GetUserName(ApprovalTable.Rows[i][2].ToString()); } GridView1.DataSource = ApprovalTable; GridView1.DataBind(); #endregion } else //已经发送审批,不可更改 { sendApproval.Enabled = false; ibtn_Save.Enabled = false; div_AppListEdit.Visible = false; } #region 申请信息 #endregion } #endregion #region 根据权限来控制页面功能 if (!HasRight(XmlSource.GetRightIndex("EDIT"))) { sendApproval.Enabled = false; ibtn_Save.Enabled = false; } if (did > 0) { if (saInfo.ENT_USER != CurrentUser.UserADAcount && !CurrentUser.RightIsAdmin)//如果当前用户不是发启人,就只能查看 { sendApproval.Enabled = false; ibtn_Save.Enabled = false; } } #endregion #region 文件路径 string id = System.Web.HttpContext.Current.User.Identity.Name.Replace("FOUNDERPCB\\", ""); id = id + @"/" + System.DateTime.Now.Date.ToShortDateString(); //Response.Write("id" + id); //建立用户目录 string path = Server.MapPath(@"uploads/" + id); if (!System.IO.Directory.Exists(path)) { System.IO.Directory.CreateDirectory(path);//在指定路径下新建一个文件夹 } CAR_Content.SetSecurityImageGalleryPath(path); CAR_Content.SetSecurityImageGalleryPath(path); CAR_Content.SetSecurityMediaGalleryPath(path); CAR_Content.SetSecurityFlashGalleryPath(path); CAR_Content.SetSecurityFilesGalleryPath(path); #endregion }
protected void Initialize() { #region 判断用户权限 if (!HasRight(XmlSource.GetRightIndex("QSM"))) { Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('对不起,你没有权限访问此页面!');</script>"); Response.End(); return; } #endregion #region 初始化界面 did = String.IsNullOrEmpty(Request.QueryString["did"]) ? 0 : int.Parse(Request.QueryString["did"]); if (did > 0) { QSMInfo qsminfo = new QSMBLL(CurrentFactoryID).getQSMInfoByrkey(did); if (qsminfo.STATUS == 0 || qsminfo.STATUS == 14) //未审批、未发启 注意:不显示gridview2(审批记录) { div_AppListEdit.Visible = true; div_AppListShow.Visible = false; #region 审批信息 ApprovalTable = new CARLogBLL(CurrentFactoryID).GetDataSet("select sp_step as 步骤,'' as 审批人,sp_user as 帐号 from CAR_Table_LOG where SN_PTR=" + qsminfo.RKEY.ToString() + " and sn_type = 'QSM' order by sp_step"); for (int i = 0; i < ApprovalTable.Rows.Count; i++) { ApprovalTable.Rows[i][1] = GetUserName(ApprovalTable.Rows[i][2].ToString()); } GridView1.DataSource = ApprovalTable; GridView1.DataBind(); #endregion } else //已经发送审批,不可更改 { sendApproval.Enabled = false; ibtn_Save.Enabled = false; //ibtn_Cancel.Enabled = false; 取消按钮不实现任何功能 div_AppListEdit.Visible = false; div_AppListShow.Visible = false; #region 审批信息 tb_ApprovalInfo = new CARLogBLL(CurrentFactoryID).GetDataSet("select sp_step,sp_user,sp_end_date,status,sp_content from CAR_Table_LOG where SN_PTR=" + qsminfo.RKEY.ToString() + " and sn_type = 'QSM' order by sp_step"); GridView2.DataSource = tb_ApprovalInfo; GridView2.DataBind(); #endregion } #region 申请信息 Serial_No.Text = qsminfo.SERIALNO; CustName.Text = qsminfo.CUST_NAME; CustCode.Value = qsminfo.CUST_CODE; factoryList.Items.FindByText(qsminfo.FACTORY_NAME).Selected = true; Happen_Date.Text = qsminfo.HAPPEN_DATE.ToString(); cust_MaterialNo.Text = qsminfo.CUST_MATERIALNO; interalNo.Text = qsminfo.INTERALNO; require_Date.Text = qsminfo.REQUIRE_DATE.ToString(); CAR_Content.Text = Server.HtmlDecode(qsminfo.CAR_CONTENT); chuhuo_qty.Text = qsminfo.CHUHUO_QTY.ToString(); jiancha_qty.Text = qsminfo.JIANCHA_QTY.ToString(); buliang_qty.Text = qsminfo.BULIANG_QTY.ToString(); buliangbili.Text = qsminfo.BULIANGBILI.ToString() + "%"; buliangDC.Text = qsminfo.BULIANGDC; zaixian_qty.Text = qsminfo.ZAITU_QTY.ToString(); kucun_qty.Text = qsminfo.KUCUN_QTY.ToString(); try { tousu_level.Items.FindByText(qsminfo.TOUSU_LEVEL).Selected = true; } catch { } try { tousu_type.Items.FindByText(qsminfo.TOUSU_TYPE).Selected = true; } catch { } if (Convert.ToInt32(qsminfo.TUIHUO_STATUS) == 0) { tuihuo_status_ck1.Checked = true; tuihuo_status_ck2.Checked = false; tuihuo_qty.Text = "0"; } else if (Convert.ToInt32(qsminfo.TUIHUO_STATUS) == 1) { tuihuo_status_ck1.Checked = false; tuihuo_status_ck2.Checked = true; tuihuo_qty.Text = qsminfo.TUIHUO_QTY.ToString(); } try { happen_address.Items.FindByValue(qsminfo.HAPPEN_ADDRESS.ToString()).Selected = true; } catch { } if (Convert.ToInt32(qsminfo.TIJIAO_STATUS) == 0) { tijiao_status_ck1.Checked = true; tijiao_status_ck2.Checked = false; } else if (Convert.ToInt32(qsminfo.TIJIAO_STATUS) == 1) { tijiao_status_ck1.Checked = false; tijiao_status_ck2.Checked = true; if (Convert.ToInt32(qsminfo.TIJIAO_TYPE) == 1) { tijiao_type_ck1.Checked = true; tijiao_type_ck2.Checked = false; tijiao_type_ck3.Checked = false; } else if (Convert.ToInt32(qsminfo.TIJIAO_TYPE) == 2) { tijiao_type_ck1.Checked = false; tijiao_type_ck2.Checked = true; tijiao_type_ck3.Checked = false; } else if (Convert.ToInt32(qsminfo.TIJIAO_TYPE) == 3) { tijiao_type_ck1.Checked = false; tijiao_type_ck2.Checked = false; tijiao_type_ck3.Checked = true; } } notes.Text = qsminfo.NOTES; #endregion } else //新建QSM { tuihuo_status_ck2.Checked = true; happen_address.Items[0].Selected = true; tijiao_status_ck2.Checked = true; tijiao_type_ck1.Checked = true; } #endregion #region 根据权限来控制页面功能 if (!HasRight(XmlSource.GetRightIndex("EDIT"))) { sendApproval.Enabled = false; ibtn_Save.Enabled = false; } if (did > 0) { if (qsminfo.ENT_USER != CurrentUser.UserADAcount && !CurrentUser.RightIsAdmin)//如果当前用户不是发启人,就只能查看 { sendApproval.Enabled = false; ibtn_Save.Enabled = false; } } #endregion #region 文件路径 string id = System.Web.HttpContext.Current.User.Identity.Name.Replace("FOUNDERPCB\\", ""); id = id + @"/" + System.DateTime.Now.Date.ToShortDateString(); //Response.Write("id" + id); //建立用户目录 string path = Server.MapPath(@"uploads/" + id); if (!System.IO.Directory.Exists(path)) { System.IO.Directory.CreateDirectory(path);//在指定路径下新建一个文件夹 } CAR_Content.SetSecurityImageGalleryPath(path); CAR_Content.SetSecurityImageGalleryPath(path); CAR_Content.SetSecurityMediaGalleryPath(path); CAR_Content.SetSecurityFlashGalleryPath(path); CAR_Content.SetSecurityFilesGalleryPath(path); #endregion }