本文整理汇总了C#中PccMsg.ClearContext方法的典型用法代码示例。如果您正苦于以下问题:C# PccMsg.ClearContext方法的具体用法?C# PccMsg.ClearContext怎么用?C# PccMsg.ClearContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PccMsg
的用法示例。
在下文中一共展示了PccMsg.ClearContext方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnOK_Click
protected void btnOK_Click(object sender, System.EventArgs e)
{
if (txtGroupName.Text == "")
{
PccErrMsg myLabel = new PccErrMsg(Server.MapPath(Session["PageLayer"] + "XmlDoc"), Session["CodePage"].ToString(), "Label");
lblMsg.Text = myLabel.GetErrMsg("lbl0010", "ADTPurDoc/GroupManage");
return;
}
//先判斷是Insert or Update
bool bUpdate = false;
string group_id = "";
PccMsg myMsg = new PccMsg();
if (Request.Params["Method"] != null)
{
bUpdate = true;
myMsg.LoadXml(Request.Params["Method"].ToString());
group_id = myMsg.Query("Key");
}
myMsg.ClearContext();
myMsg.CreateFirstNode("group_id", group_id);
myMsg.CreateFirstNode("ap_id", CheckQueryString("ApID"));
myMsg.CreateFirstNode("group_nm", txtGroupName.Text);
myMsg.CreateFirstNode("group_type", ddlGroupType.SelectedItem.Value);
bs_GroupManage mybs = new bs_GroupManage(ConfigurationManager.AppSettings["ConnectionType"], ConfigurationManager.AppSettings["ConnectionServer"], ConfigurationManager.AppSettings["ConnectionDB"], ConfigurationManager.AppSettings["ConnectionUser"], ConfigurationManager.AppSettings["ConnectionPwd"], Session["UserIDAndName"].ToString(), ConfigurationManager.AppSettings["EventLogPath"]);
string strReturn = "";
if (bUpdate)
{
myMsg.CreateFirstNode("upd_id", Session["UserID"].ToString());
strReturn = mybs.DoReturnStr("UpdateGroupByGroupID", myMsg.GetXmlStr, "");
}
else
{
myMsg.CreateFirstNode("add_id", Session["UserID"].ToString());
strReturn = mybs.DoReturnStr("InsertGroupByApID", myMsg.GetXmlStr, "");
}
myMsg.LoadXml(strReturn);
if (myMsg.Query("returnValue") == "0")
{
Response.Redirect(GROUPMANAGE + "?ApID=" + CheckQueryString("ApID"));
}
else
{
lblMsg.Font.Size = FontUnit.Large;
lblMsg.Text = myMsg.Query("errmsg");
}
}
示例2: db_InsUpdApplyCheck
public string db_InsUpdApplyCheck(string strXML)
{
PccMsg myMsg = new PccMsg(strXML);
string ac_id = myMsg.Query("ac_id").ToString().Trim();
string fact_no = myMsg.Query("fact_no").ToString().Trim();
string dept_no = myMsg.Query("dept_no").ToString().Trim();
string sec_no = myMsg.Query("sec_no").ToString().Trim();
string type_check = myMsg.Query("type_check").ToString().Trim();
string vou_no = myMsg.Query("vou_no").ToString().Trim();
string total = myMsg.Query("total").ToString().Trim();
string floor = myMsg.Query("floor").ToString().Trim();
string build_no = myMsg.Query("build_no").ToString().Trim();
string myType = myMsg.Query("Type").ToString().Trim();
if (ac_id == "")
ac_id = "0";
if (total == "")
total = "0";
SqlParameter[] parameters = {
new SqlParameter("@ac_id",SqlDbType.Int),
new SqlParameter("@fact_no",SqlDbType.Char,4),
new SqlParameter("@dept_no",SqlDbType.Char,10),
new SqlParameter("@sec_no",SqlDbType.Char,10),
new SqlParameter("@type_check",SqlDbType.Char,1),
new SqlParameter("@vou_no",SqlDbType.VarChar,50),
new SqlParameter("@total",SqlDbType.Int),
new SqlParameter("@floor",SqlDbType.Char,1),
new SqlParameter("@build_no",SqlDbType.Char,2),
new SqlParameter("@Type",SqlDbType.Char,1),
new SqlParameter("@Err",SqlDbType.NVarChar,100)
};
parameters[0].Direction = ParameterDirection.Output;
parameters[1].Value = fact_no;
parameters[2].Value = dept_no;
parameters[3].Value = sec_no;
parameters[4].Value = type_check;
parameters[5].Value = vou_no;
parameters[6].Value = total;
parameters[7].Value = floor;
parameters[8].Value = build_no;
parameters[9].Value = myType;
parameters[10].Direction = ParameterDirection.Output;
try
{
int iReturn = 0, rowsAffected = 0;
iReturn = RunProcedure("Pro_InsUpdApplyCheck", parameters, ref rowsAffected);
myMsg.ClearContext();
myMsg.CreateFirstNode("ReturnValue", iReturn.ToString());
myMsg.CreateFirstNode("RowsAffected", rowsAffected.ToString());
myMsg.CreateFirstNode("Err", parameters[10].Value.ToString());
myMsg.CreateFirstNode("ac_id", parameters[0].Value.ToString());
}
catch (Exception e)
{
myMsg.ClearContext();
myMsg.CreateFirstNode("Err", e.Message.ToString());
}
return myMsg.GetXmlStr;
}
示例3: db_InsUpdApplyRatingDetail
public string db_InsUpdApplyRatingDetail(string strXML)
{
PccMsg myMsg = new PccMsg(strXML);
string id = myMsg.Query("id").ToString().Trim();
string AcRat_id = myMsg.Query("AcRat_id").ToString().Trim();
string bad_no = myMsg.Query("bad_no").ToString().Trim();
string bad_desc = myMsg.Query("bad_desc").ToString().Trim();
string bad_descVN = myMsg.Query("bad_descVN").ToString().Trim();
string qty = myMsg.Query("qty").ToString().Trim();
string qtyOKitem = myMsg.Query("qtyOKitem").ToString().Trim();
string add_id = myMsg.Query("add_id").ToString().Trim();
string myType = myMsg.Query("Type").ToString().Trim();
if (id == "")
id = "0";
if (AcRat_id == "")
AcRat_id = "0";
if (qty == "")
qty = "0";
if (qtyOKitem == "")
qtyOKitem = "0";
if (add_id == "")
add_id = "0";
SqlParameter[] parameters = {
new SqlParameter("@id",SqlDbType.Decimal,18),
new SqlParameter("@AcRat_id",SqlDbType.Int),
new SqlParameter("@bad_no",SqlDbType.Char,10),
new SqlParameter("@bad_desc",SqlDbType.NVarChar,100),
new SqlParameter("@bad_descVN",SqlDbType.NVarChar,100),
new SqlParameter("@qty",SqlDbType.Int),
new SqlParameter("@qtyOKitem",SqlDbType.Int),
new SqlParameter("@add_id",SqlDbType.Decimal,18),
new SqlParameter("@Type",SqlDbType.Char,1),
new SqlParameter("@Err",SqlDbType.NVarChar,100)
};
parameters[0].Value = id;
parameters[1].Value = AcRat_id;
parameters[2].Value = bad_no;
parameters[3].Value = bad_desc;
parameters[4].Value = bad_descVN;
parameters[5].Value = qty;
parameters[6].Value = qtyOKitem;
parameters[7].Value = add_id;
parameters[8].Value = myType;
parameters[9].Direction = ParameterDirection.Output;
try
{
int iReturn = 0, rowsAffected = 0;
iReturn = RunProcedure("Pro_InsUpdApplyRatingDetail", parameters, ref rowsAffected);
myMsg.ClearContext();
myMsg.CreateFirstNode("ReturnValue", iReturn.ToString());
myMsg.CreateFirstNode("RowsAffected", rowsAffected.ToString());
myMsg.CreateFirstNode("Err", parameters[9].Value.ToString());
}
catch (Exception e)
{
myMsg.ClearContext();
myMsg.CreateFirstNode("Err", e.Message.ToString());
}
return myMsg.GetXmlStr;
}
示例4: DeleteUserByGroup
private void DeleteUserByGroup(string strXML)
{
PccMsg myMsg = new PccMsg(strXML);
string strRequestFormName = myMsg.Query("btnID");
strRequestFormName = strRequestFormName.Split('-')[1];
string strUserID = CheckForm(strRequestFormName);
if (strUserID != "")
{
string group_id = strRequestFormName.Substring(3);
myMsg.ClearContext();
myMsg.CreateFirstNode("group_id", group_id);
myMsg.CreateFirstNode("user_str", strUserID);
bs_GroupManage mybs = new bs_GroupManage(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("DeleteUGrp", 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>");
}
}
else
{
GenMasterTable();
}
}
示例5: GetUserInfo
private string GetUserInfo(string strXML, string strOther)
{
string xmlStr = "";
PccMsg msg = new PccMsg("", "Big5");
try
{
msg.LoadXml(strXML);
string userName = msg.Query("UserName");
string password = msg.Query("Password");
string vpath = msg.Query("vpath");
string superAdmin = msg.Query("superAdmin");
xmlStr = new db_Security(ConfigurationSettings.AppSettings["ConnectionType"], ConfigurationSettings.AppSettings["ConnectionServer"], ConfigurationSettings.AppSettings["ConnectionDB"], ConfigurationSettings.AppSettings["ConnectionUser"], ConfigurationSettings.AppSettings["ConnectionPwd"]).GetUserInfo(userName, password, vpath, superAdmin);
}
catch (Exception exception)
{
msg.ClearContext();
msg.CreateFirstNode("Exist", "N");
msg.CreateFirstNode("Return", exception.Message);
xmlStr = msg.GetXmlStr;
}
return xmlStr;
}
示例6: GenMasterTableData
private void GenMasterTableData(ref PccErrMsg myLabel)
{
PccErrMsg myErrMsg = new PccErrMsg(Server.MapPath(Session["PageLayer"] + "XmlDoc"), Session["CodePage"].ToString(), "Error");
bs_FactGroupManage mybs = new bs_FactGroupManage(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();
PccMsg myTempMsg = new PccMsg();
myMsg.CreateFirstNode("Ap_Id", Request.QueryString["ApID"]);
myMsg.CreateFirstNode("Upd_Id", Session["UserID"].ToString());
myMsg.CreateFirstNode("Fact_No", txtfactno.Text);
myMsg.CreateFirstNode("User_Desc", txtusernm.Text);
myMsg.CreateFirstNode("OrderBy", "a.user_desc");
myMsg.CreateFirstNode("StartRecord", PageControl1.StartRecord.ToString());
myMsg.CreateFirstNode("PageSize", PageControl1.PageSize.ToString());
GetMenuAuth myAuth = new GetMenuAuth();
myAuth.AspxFile = FACTGROUPMANAGE;
string strXML = myMsg.GetXmlStr;
DataSet myUserDs = mybs.DoReturnDataSet("getAllUserInFgrp", strXML, "");
DataTable myUserData = myUserDs.Tables["UserInFgrp"];
DataTable myFgrpData, myFactData;
Table myFgrpTable, myFactTable;
PccRow myRow;
if (myUserData.Rows.Count > 0)
{
int MasterCount = 0;
string MasterStyle = "";
//取出資料總筆數
PageControl1.TotalSize = myUserDs.Tables["TCounts"].Rows[0]["Counts"].ToString();
PageControl1.BuildPager();
//再利用此Table再取得其每一列的資料,再Gen出主要的Table Row.
foreach (DataRow myMasterRow in myUserData.Rows)
{
if (MasterCount % 2 == 0) MasterStyle = "eee000"; else MasterStyle = "fff000";
myRow = new PccRow(MasterStyle, HorizontalAlign.Center, VerticalAlign.Middle, 0);
//編號
myRow.AddTextCell(PageControl1.ListCount, 5);
//電子郵件帳號
myRow.AddTextCell(myMasterRow["email"].ToString(), 40);
//廠別
myRow.AddTextCell(myMasterRow["fact_no"].ToString(), 10);
//姓名
if (myAuth.IsAddAuth())
{
myTempMsg.CreateFirstNode("Href", PICKFGRP + "?ApID=" + m_ap_id + "&UserID=" + myMasterRow["user_id"] + "&UserDesc=" + myMasterRow["user_desc"].ToString().Trim() + "&QueryCondition=" + GetQueryCondition());
myTempMsg.CreateFirstNode("Text", myMasterRow["user_desc"].ToString().Trim());
myRow.AddLinkHrefCell(myTempMsg.GetXmlStr, 30);
}
else
{
myRow.AddTextCell(myMasterRow["user_desc"].ToString(), 30);
}
//事業群
myRow.AddTextCell(myMasterRow["fgrp_nm"].ToString(), 15);
//檢視
myTempMsg = new PccMsg();
myTempMsg.CreateFirstNode("ToolTip", "檢視所屬的廠群組");
myTempMsg.CreateFirstNode("LinkID", "HLinkView" + myMasterRow["user_id"].ToString());
myTempMsg.CreateFirstNode("Image", Session["PageLayer"] + "images/detal.gif");
myTempMsg.CreateFirstNode("ClickFun", "doSection(view_" + MasterCount.ToString() + ")");
myRow.AddLinkCell(myTempMsg.GetXmlStr, 10);
tblUser.Rows.Add(myRow.Row);
//要取得明細資料的Table變數
myTempMsg.ClearContext();
myTempMsg.CreateFirstNode("Ap_Id", m_ap_id);
myTempMsg.CreateFirstNode("User_Id", myMasterRow["user_id"].ToString());
myTempMsg.CreateFirstNode("LoginUser_Id", Session["UserID"].ToString());
myFgrpData = mybs.DoReturnDataSet("get_DS_FGRPByUserID", myTempMsg.GetXmlStr, string.Empty).Tables["FgrpInUser"];
myFgrpTable = new Table();
GenFgrpTableHeader(ref myFgrpTable);
int DetailCount = 1;
foreach (DataRow myDetailRow in myFgrpData.Rows)
{
if (DetailCount % 2 == 0) MasterStyle = "eee000"; else MasterStyle = "ffd000";
myRow = new PccRow(MasterStyle, HorizontalAlign.Center, VerticalAlign.Middle, 0);
//編號
myRow.AddTextCell(DetailCount.ToString(), 10);
//廠群組名稱
myRow.AddTextCell(myDetailRow["Fgrp_Nm"].ToString(), 70);
//檢視
myTempMsg = new PccMsg();
myTempMsg.CreateFirstNode("ToolTip", "檢視所屬廠別");
myTempMsg.CreateFirstNode("LinkID", "HLinkView" + myDetailRow["Fgrp_Id"].ToString());
myTempMsg.CreateFirstNode("Image", Session["PageLayer"] + "images/detal.gif");
myTempMsg.CreateFirstNode("ClickFun", "doSection(view_D" + MasterCount.ToString() + "_" + DetailCount.ToString() + ")");
myRow.AddLinkCell(myTempMsg.GetXmlStr, 10);
//管理
myTempMsg = new PccMsg();
//.........这里部分代码省略.........