private void BindFactData(ref PccCommonForC.PccErrMsg myLabel,ref PccBsSystemForC.bs_UserManager mybs) { DataSet ds; DataTable dt; DataRow myRow; ds = mybs.DoReturnDataSet("GetFactDataBySecurity","",""); dt = ds.Tables["Fact"]; myRow = dt.NewRow(); myRow["fact_id"] = 0; myRow["fact_nm"] = "bbb"; myRow["fact_desc"] = myLabel.GetErrMsg("SelectPlease") ; dt.Rows.InsertAt(myRow,0); ddlfact_id.DataSource = dt.DefaultView; ddlfact_id.DataTextField = "fact_desc"; ddlfact_id.DataValueField = "fact_id"; ddlfact_id.DataBind(); }
private void SetddlApplication(ref PccCommonForC.PccErrMsg myLabel, ref PccBsSystemForC.bs_UserManager mybs) { PccMsg myMsg = new PccMsg(); myMsg.CreateFirstNode("vpath", ConfigurationManager.AppSettings["vpath"]); //此為判斷若是這個User是要新增的則user_id輸入0 try { if (Request.Params["Type"] != null && Request.Params["Type"].ToString() == "Update") { myMsg.CreateFirstNode("user_id", Session["UserID"].ToString()); } else { myMsg.CreateFirstNode("user_id", "0"); } } catch { myMsg.CreateFirstNode("user_id", "0"); } DataTable dt = mybs.DoReturnDataSet("GetApplyAp", myMsg.GetXmlStr, "").Tables["ApplyAp"]; DataRow myRow = dt.NewRow(); myRow["ap_id"] = 0; myRow["ap_name"] = myLabel.GetErrMsg("SelectPlease"); dt.Rows.InsertAt(myRow, 0); ddlApplcation.DataSource = dt.DefaultView; ddlApplcation.DataTextField = "ap_name"; ddlApplcation.DataValueField = "ap_id"; ddlApplcation.DataBind(); ddlApplcation.Attributes.Add("onChange", "ApplicationChange()"); }
private void SetddlDept(ref PccCommonForC.PccErrMsg myLabel, ref PccBsSystemForC.bs_UserManager mybs) { DataTable dt = mybs.DoReturnDataSet("GetDeptAllData", "", "").Tables["Dept"]; DataRow myRow = dt.NewRow(); myRow["dept_id"] = 0; myRow["dept_no"] = "aaa"; myRow["dept_nm"] = "bbb"; myRow["dept_desc"] = myLabel.GetErrMsg("SelectPlease"); dt.Rows.InsertAt(myRow, 0); // ddldept_id.DataSource = dt.DefaultView; // ddldept_id.DataTextField = "dept_desc"; // ddldept_id.DataValueField = "dept_id"; // ddldept_id.DataBind(); }
private void GetUserData(ref PccCommonForC.PccErrMsg myLabel, ref PccBsSystemForC.bs_UserManager mybs) { PccCommonForC.PccMsg myMsg = new PccCommonForC.PccMsg(); myMsg.CreateFirstNode("user_id", Session["UserID"].ToString()); myMsg.CreateFirstNode("ap_id", ddlApplcation.SelectedItem.Value); string strXML = myMsg.GetXmlStr; try { myMsg.LoadXml(mybs.DoReturnStr("GetUserData", strXML, "")); txtuser_desc.Text = myMsg.Query("user_desc"); txtuser_nm.Text = myMsg.Query("email"); //password always is 'password' txtusr_pas.Attributes["value"] = myMsg.Query("usr_pas"); txtReusr_pas.Attributes["value"] = myMsg.Query("usr_pas"); //ddldept_id.Items.FindByValue(myMsg.Query("dept_id")).Selected = true; ddlfact_id.Items.FindByValue(myMsg.Query("fact_id")).Selected = true; txtemp_no.Text = myMsg.Query("emp_no"); txtext.Text = myMsg.Query("ext"); SetTextColor(); } catch { lblMsg.Text = myLabel.GetErrMsg("msgLoadDataError"); btnApply.Enabled = false; } }