protected void btnDelOK_Click(object sender, System.EventArgs e) { plMain.Visible = true; plDelete.Visible = false; PccMsg myMsg = new PccMsg(CheckRequestQueryString("Method")); PccMsg myReturnMsg = new PccMsg(); string strUserID = myMsg.Query("Key"); myMsg.LoadXml(); myMsg.CreateFirstNode("user_id", strUserID); myMsg.CreateFirstNode("ap_id", CheckRequestQueryString("ApID")); //增加一個刪除e_userfact的關連 20040924 myMsg.CreateFirstNode("upd_id", Session["UserID"].ToString()); myMsg.CreateFirstNode("fact_id", "0"); myMsg.CreateFirstNode("uf_id", "0"); bs_UserFactManage mybs1 = new bs_UserFactManage(ConfigurationManager.AppSettings["ConnectionType"], ConfigurationManager.AppSettings["ConnectionServer"], ConfigurationManager.AppSettings["ConnectionDB"], ConfigurationManager.AppSettings["ConnectionUser"], ConfigurationManager.AppSettings["ConnectionPwd"], Session["UserIDAndName"].ToString(), ConfigurationManager.AppSettings["EventLogPath"]); string strReturn = mybs1.DoReturnStr("DeleteUserFactByUser", myMsg.GetXmlStr, ""); myReturnMsg.LoadXml(strReturn); if (myReturnMsg.Query("returnValue") != "0") { ClientScript.RegisterClientScriptBlock(this.GetType(),"New", "<script language=javascript>alert('" + myMsg.Query("errmsg") + "');</script>"); return; } bs_UserManager mybs = new bs_UserManager(ConfigurationManager.AppSettings["ConnectionType"], ConfigurationManager.AppSettings["ConnectionServer"], ConfigurationManager.AppSettings["ConnectionDB"], ConfigurationManager.AppSettings["ConnectionUser"], ConfigurationManager.AppSettings["ConnectionPwd"], Session["UserIDAndName"].ToString(), ConfigurationManager.AppSettings["EventLogPath"]); strReturn = mybs.DoReturnStr("DeleteUserByApID", myMsg.GetXmlStr, ""); myReturnMsg.LoadXml(strReturn); if (myReturnMsg.Query("returnValue") == "0") { GenMasterTable(); } else { ClientScript.RegisterClientScriptBlock(this.GetType(),"New", "<script language=javascript>alert('" + myMsg.Query("errmsg") + "');</script>"); } }
protected void btnApply_Click(object sender, System.EventArgs e) { if (!CheckVerifyNumber()) return; bs_UserManager mybs = new bs_UserManager(ConfigurationManager.AppSettings["ConnectionType"], ConfigurationManager.AppSettings["ConnectionServer"], ConfigurationManager.AppSettings["ConnectionDB"], ConfigurationManager.AppSettings["ConnectionUser"], ConfigurationManager.AppSettings["ConnectionPwd"], Session["UserIDAndName"].ToString(), ConfigurationManager.AppSettings["EventLogPath"]); string strReturn = GetSendXML(); strReturn = mybs.DoReturnStr("InsertAskUser", strReturn, ""); PccMsg myMsg = new PccMsg(strReturn); if (myMsg.Query("returnValue") == "0") { lblMsg.Font.Size = FontUnit.Medium; lblMsg.Text = "申請成功,請等待管理者Mail通知!"; txtusr_pas.Attributes["value"] = txtusr_pas.Text; txtReusr_pas.Attributes["value"] = txtusr_pas.Text; SetTextColor(); ddlApplcation.Enabled = false; btnApply.Enabled = false; //20050630新增可以給多個管理者 string ap_id = ddlApplcation.SelectedItem.Value; string[] arrEmail = System.Configuration.ConfigurationManager.AppSettings[ap_id + "-Email"].ToString().Split(';'); string[] arrName = System.Configuration.ConfigurationManager.AppSettings[ap_id + "-Name"].ToString().Split(';'); for (int i = 0; i < arrEmail.Length; i++) { if (!SendMailToManager(arrEmail[i], arrName[i])) { ClientScript.RegisterClientScriptBlock(this.GetType(),"new", "<script language=javascript>alert('寄送郵件失敗!');</script>"); } } //------------------------------- } else { lblMsg.Font.Size = FontUnit.Medium; lblMsg.Text = myMsg.Query("errmsg"); } }
protected void btnAddComeOn_Click(object sender, System.EventArgs e) { bs_UserManager mybs = new bs_UserManager(ConfigurationSettings.AppSettings["ConnectionType"] , ConfigurationSettings.AppSettings["ConnectionServer"], ConfigurationSettings.AppSettings["ConnectionDB"], ConfigurationSettings.AppSettings["ConnectionUser"], ConfigurationSettings.AppSettings["ConnectionPwd"],Session["UserIDAndName"].ToString(),ConfigurationSettings.AppSettings["EventLogPath"]); PccMsg myMsg = new PccMsg(); string strUserID,strReturn,errormsg = "",strXML = ""; bool bSelect = false; for (int i = 0; i < DataGrid1.Items.Count ; i++) { if (((CheckBox)DataGrid1.Items[i].Cells[6].Controls[1]).Checked) { strUserID = DataGrid1.Items[i].Cells[1].Text; myMsg.LoadXml(); myMsg.CreateFirstNode("ap_id",Request.QueryString["ApID"]); myMsg.CreateFirstNode("user_id",strUserID); myMsg.CreateFirstNode("mana_mk","N"); myMsg.CreateFirstNode("upd_id",Session["UserID"].ToString()); //strXML = GetUserXML(strUserID); strReturn = mybs.DoReturnStr("JoinUserToAp",myMsg.GetXmlStr,""); myMsg.LoadXml(strReturn); if (myMsg.Query("returnValue") != "0") { lblMsg.Font.Size = FontUnit.Large; lblMsg.Text = myMsg.Query("errmsg"); break; } bSelect = true; } } if (bSelect) { if (myMsg.Query("returnValue") == "0") { Response.Redirect(USERMANAGE + "?ApID=" + Request.QueryString["ApID"] + "&QueryCondition=" + Request.QueryString["QueryCondition"]); } else { lblMsg.Font.Size = FontUnit.Large; if (errormsg == "") lblMsg.Text = myMsg.Query("errmsg"); else lblMsg.Text = errormsg; } } else { PccErrMsg myLabel = new PccErrMsg(Server.MapPath(Session["PageLayer"] + "XmlDoc"),Session["CodePage"].ToString() ,"Label"); lblMsg.Font.Size = FontUnit.Large; if (errormsg == "") lblMsg.Text = myLabel.GetErrMsg("lbl0014","SysManager/UserManager"); else lblMsg.Text = errormsg; } }
private void AddCheckUser() { string[] tempAsk_id, tempGroup_id; string ask_str = Request.Params["CheckAsk"].ToString(); tempAsk_id = ask_str.Split(','); tempGroup_id = Request.Params["ddlGroup"].ToString().Split(','); string check_str = ""; int i = 0; for (i = 0; i < tempAsk_id.Length; i++) { check_str += "Y,"; } check_str = check_str.Substring(0, check_str.Length - 1); string group_str = ""; for (i = 0; i < tempGroup_id.Length; i++) { if (tempGroup_id[i] != "0") { group_str += tempGroup_id[i] + ","; } } group_str = group_str.Substring(0, group_str.Length - 1); PccMsg myMsg = new PccMsg(); myMsg.CreateFirstNode("ask_str", ask_str); myMsg.CreateFirstNode("check_str", check_str); myMsg.CreateFirstNode("group_str", group_str); myMsg.CreateFirstNode("check_id", Session["UserID"].ToString()); bs_UserManager mybs = new bs_UserManager(ConfigurationManager.AppSettings["ConnectionType"], ConfigurationManager.AppSettings["ConnectionServer"], ConfigurationManager.AppSettings["ConnectionDB"], ConfigurationManager.AppSettings["ConnectionUser"], ConfigurationManager.AppSettings["ConnectionPwd"], Session["UserIDAndName"].ToString(), ConfigurationManager.AppSettings["EventLogPath"]); string strReturn = mybs.DoReturnStr("AuditUser", myMsg.GetXmlStr, ""); myMsg.LoadXml(strReturn); DataTable dt; if (myMsg.Query("returnValue") == "0") { //要送信給每位申請者 20040418 for (i = 0; i < tempAsk_id.Length; i++) { dt = mybs.DoReturnDataSet("GetAskByAskID", "", tempAsk_id[i]).Tables["Ask"]; if (!SendMailToManager(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 UpdateMenuByUser(string strXML) { string menu_id = ""; int i; m_menuIDArray = (string[])ViewState["MenuID"]; for (i = 0; i < m_menuIDArray.Length; i++) { menu_id += m_menuIDArray[i] + ","; } if (menu_id == "") { GenMasterTable(); return; } else { menu_id = menu_id.Substring(0, menu_id.Length - 1); } PccMsg myMsg = new PccMsg(strXML); string strRequestFormName = myMsg.Query("btnID").Split('-')[1]; string strShow = CheckRequestForm("show_mk" + strRequestFormName); string strAdd = CheckRequestForm("add_mk" + strRequestFormName); string strUpd = CheckRequestForm("upd_mk" + strRequestFormName); string strDel = CheckRequestForm("del_mk" + strRequestFormName); string strRpt = CheckRequestForm("rpt_mk" + strRequestFormName); string strSend = CheckRequestForm("send_mk" + strRequestFormName); string show_mk, add_mk, upd_mk, del_mk, rpt_mk, send_mk; string user_id; user_id = strRequestFormName.Substring(3); show_mk = CompareTwoStrArray(m_menuIDArray, strShow, "Y,", "N,"); add_mk = CompareTwoStrArray(m_menuIDArray, strAdd, "Y,", "N,"); upd_mk = CompareTwoStrArray(m_menuIDArray, strUpd, "Y,", "N,"); del_mk = CompareTwoStrArray(m_menuIDArray, strDel, "Y,", "N,"); rpt_mk = CompareTwoStrArray(m_menuIDArray, strRpt, "Y,", "N,"); send_mk = CompareTwoStrArray(m_menuIDArray, strSend, "Y,", "N,"); myMsg.LoadXml(); myMsg.CreateFirstNode("user_id", user_id); myMsg.CreateFirstNode("menu_str", menu_id); myMsg.CreateFirstNode("show_str", show_mk); myMsg.CreateFirstNode("add_str", add_mk); myMsg.CreateFirstNode("upd_str", upd_mk); myMsg.CreateFirstNode("del_str", del_mk); myMsg.CreateFirstNode("rpt_str", rpt_mk); myMsg.CreateFirstNode("send_str", send_mk); bs_UserManager mybs = new bs_UserManager(ConfigurationManager.AppSettings["ConnectionType"], ConfigurationManager.AppSettings["ConnectionServer"], ConfigurationManager.AppSettings["ConnectionDB"], ConfigurationManager.AppSettings["ConnectionUser"], ConfigurationManager.AppSettings["ConnectionPwd"], Session["UserIDAndName"].ToString(), ConfigurationManager.AppSettings["EventLogPath"]); string strReturn = mybs.DoReturnStr("UpdateMenudByUserID", myMsg.GetXmlStr, ""); myMsg.LoadXml(strReturn); if (myMsg.Query("returnValue") == "0") { GenMasterTable(); } else { ClientScript.RegisterClientScriptBlock(this.GetType(),"New", "<script language=javascript>alert('" + myMsg.Query("errmsg") + "');</script>"); } }