protected void btnDelOK_Click(object sender, System.EventArgs e) { PccMsg myMsg = new PccMsg(Request.Params["Method"].ToString()); string strKey = myMsg.Query("Key"); string strXML = "<PccMsg><user_id>" + Session["UserID"].ToString() + "</user_id><ask_id>" + strKey + "</ask_id></PccMsg>"; PccBsSystemForC.bs_UserManager mybs = new PccBsSystemForC.bs_UserManager(ConfigurationManager.AppSettings["ConnectionType"], ConfigurationManager.AppSettings["ConnectionServer"], ConfigurationManager.AppSettings["ConnectionDB"], ConfigurationManager.AppSettings["ConnectionUser"], ConfigurationManager.AppSettings["ConnectionPwd"], Session["UserIDAndName"].ToString(), ConfigurationManager.AppSettings["EventLogPath"]); DataTable dt; string strReturn = mybs.DoReturnStr("DeleteAskUser", strXML, ""); myMsg.LoadXml(strReturn); if (myMsg.Query("returnValue") == "0") { //要送信給被駁回的申請者 20040418 dt = mybs.DoReturnDataSet("GetAskByAskID", "", strKey).Tables["Ask"]; if (!SendMailToApply(dt.Rows[0]["ap_id"].ToString(), dt.Rows[0]["ap_name"].ToString(), dt.Rows[0]["user_desc"].ToString(), dt.Rows[0]["email"].ToString())) { return; } Response.Redirect(CHECKUSERMANAGE + "?ApID=" + Request.Params["ApID"].ToString()); } else { ClientScript.RegisterClientScriptBlock(this.GetType(),"New", "<script language=javascript>alert('" + myMsg.Query("errmsg") + "');</script>"); } }
private void GenMasterTableData(ref PccErrMsg myLabel) { PccBsSystemForC.bs_UserManager mybs = new PccBsSystemForC.bs_UserManager(ConfigurationManager.AppSettings["ConnectionType"], ConfigurationManager.AppSettings["ConnectionServer"], ConfigurationManager.AppSettings["ConnectionDB"], ConfigurationManager.AppSettings["ConnectionUser"], ConfigurationManager.AppSettings["ConnectionPwd"], Session["UserIDAndName"].ToString(), ConfigurationManager.AppSettings["EventLogPath"]); PccMsg myMsg = new PccMsg(); myMsg.CreateFirstNode("StartRecord", PageControl1.StartRecord.ToString()); myMsg.CreateFirstNode("PageSize", PageControl1.PageSize.ToString()); myMsg.CreateFirstNode("ap_id", m_apid); myMsg.CreateFirstNode("user_desc", user_desc.Text); //string strXML = myMsg.GetXmlStr; GetMenuAuth myAuth = new GetMenuAuth(); //判斷是否要利用事業群來分設權限 20041118 myMsg.CreateFirstNode("user_id", Session["UserID"].ToString()); myMsg.CreateFirstNode("order", ""); if (ConfigurationManager.AppSettings[m_apid + "-FactByGroup"] != null && ConfigurationManager.AppSettings[m_apid + "-FactByGroup"].ToString() == "Y") { //判斷此使用者是否可以分配不同的事業群權限 if (!myAuth.IsReportAuth()) { //表示他必須區分事業群 myMsg.CreateFirstNode("GroupFilter", "Y"); } else { myMsg.CreateFirstNode("GroupFilter", "N"); } } else { myMsg.CreateFirstNode("GroupFilter", "N"); } if (ConfigurationManager.AppSettings[m_apid + "-FactFilter"] != null && ConfigurationManager.AppSettings[m_apid + "-FactFilter"].ToString() == "Y") { //表示他必須區分廠管理 20041118 注意要區別廠管理的先決條件是要區分事業群 myMsg.CreateFirstNode("FactFilter", "Y"); } DataSet myAskDs = mybs.DoReturnDataSet("GetAskByApID", myMsg.GetXmlStr, ""); PccMsg myTempMsg = new PccMsg(); DataTable myAskData = myAskDs.Tables["Ask"]; if (myAskData != null && myAskData.Rows.Count > 0) { int MasterCount = 0; string MasterStyle = ""; PccRow myRow; //取出資料總筆數 PageControl1.TotalSize = myAskDs.Tables["TCounts"].Rows[0]["Counts"].ToString(); PageControl1.BuildPager(); //再利用此Table再取得其每一列的資料,再Gen出主要的Table Row. foreach (DataRow myMasterRow in myAskData.Rows) { if (MasterCount % 2 == 0) MasterStyle = "cssGridRowAlternating"; else MasterStyle = "cssGridRow"; myRow = new PccRow(); myRow.SetRowCss(MasterStyle); //編號 myRow.AddTextCell(PageControl1.ListCount, 5); //姓名 myRow.AddTextCell(myMasterRow["user_desc"].ToString(), 10); //電子郵件帳號 myRow.AddTextCell(myMasterRow["email"].ToString(), 33); //廠別 myRow.AddTextCell(myMasterRow["fact_nm"].ToString(), 22); //Email //myRow.AddTextCell(myMasterRow["email"].ToString(),25); //分機 myRow.AddTextCell(myMasterRow["ext"].ToString(), 5); //群組 myRow.SetDefaultCellData("", HorizontalAlign.Center, 0, 0); myRow.AddControl(GetGroup(myMasterRow["ask_id"].ToString()), 15); //核準 myRow.AddTextCell(GetCheck(myMasterRow["ask_id"].ToString()), 5); //駁回 myTempMsg.LoadXml(); myTempMsg.CreateNode("LinkButton"); myTempMsg.AddToNode("Image", Session["PageLayer"] + "images/del.gif"); myTempMsg.AddToNode("ToolTip", "駁回此使用者之申請"); myTempMsg.AddToNode("href", CHECKUSERMANAGE + "?ApID=" + Request.Params["ApID"].ToString()); myTempMsg.AddToNode("QueryCondition", GetQueryCondition()); myTempMsg.AddToNode("Method", GetMethod("MasterDelFunc", "ask_id", "user_desc", myMasterRow)); myTempMsg.UpdateNode(); myRow.AddMultiLinkCell(myTempMsg.GetXmlStr, 5); tblCheckUser.Rows.Add(myRow.Row); MasterCount += 1; } // end of foreach datarow } // end of if table count is 0 else { PageControl1.TotalSize = "0"; PageControl1.BuildPager(); } }