public static DataSet GetDataBySql(Socket sktX, bool bIsSaveDataxml, string sSql, string sTbName, int nPageSize, int nPageIndex, string sFldsDate, out string sErr) { sErr = ""; if (sSql.Trim().Length == 0) { sErr = "SQL语句不能为空!"; return(null); } string str = "data"; if (sTbName.Trim() != "") { str = sTbName.Trim(); } DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo { SqlText = sSql, SqlType = SqlCommandType.sctSql, PageIndex = nPageIndex, PageSize = nPageSize, FromSysType = "dotnet", DataTableName = str, FldsData = sFldsDate.Trim() }; SeDBClient client = new SeDBClient(); return(client.GetDataSet(sktX, cmdInfo, bIsSaveDataxml, out sErr)); }
public void DoMDelete() { if (UserInformation.UType == UserType.utNormal) { MessageBox.Show("对不起,您无权限删除部门信息!"); return; } int iX = -1; iX = (int)optMain; DataRowView drv = (DataRowView)bdsMain.Current; if (drv == null) { MessageBox.Show("对不起,无数据可删除!", "", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } //if (drv.IsNew || drv.IsEdit) if ((0 < iX) && (iX < 3)) { MessageBox.Show("对不起,当前正处于编辑/新建状态,请先保存或取消操作!", "", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (MessageBox.Show("系统将永久删除此数据,不能恢复,您确定要删除此数据吗?", "WMS", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No) { return; } DBCommInfo.DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo(); //执行命令的对象 cmdInfo.SqlText = "delete " + strTbNameMain + " where " + strKeyFld + "='" + drv[strKeyFld].ToString() + "'"; //SQL语句 或 存储过程名 若有参数,另外在参数集里增加 cmdInfo.SqlType = SqlCommandType.sctSql; //SQL命令类型 SqlCommandType.sctSql SQL 语句 SqlCommandType.sctProcedure 表存储过程 cmdInfo.PageIndex = 0; //需要分页时的页号 cmdInfo.PageSize = 0; //需要分页时的每页记录条数 cmdInfo.FromSysType = "dotnet"; //采用处理结果数据的方式:php 表按照<tr><td></td></tr> xml 否则 直接采用ado 的记录集方式 cmdInfo.DataTableName = strTbNameMain; //指定结果数据记录集表名 默认为 "data" SunEast.SeDBClient sdcX = new SeDBClient(); //获取服务器数据的类型对象 //sdcX.DBSTServer = DBSocketServerType.dbsstNormal; //自动根据配置文件读 string sErr = ""; DataSet dsX = null; dsX = sdcX.GetDataSet(cmdInfo, out sErr); //通过获取服务器数据对象的GetDataSet方法获取数据 bool bX = dsX != null; //DataMainToObjInfo(drv); //bX = BI.BasicPubInfo.BasicPubInfoBI.DoCompanyInfo(AppInformation.dbtApp, AppInformation.AppConn, UserInformation, drv, true); if (bX) { optMain = OperateType.optDelete; OpenMainDataSet(sbConndition.ToString()); //控制录入问题 CtrlOptButtons(this.tlbMain, pnlEdit, optMain, DBDataSet.Tables[strTbNameMain]); optMain = OperateType.optNone; DisplayState(stbState, optMain); CtrlControlReadOnly(pnlEdit, false); } else { MessageBox.Show("对不起,删除操作失败!", "", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } }
public bool OpenMainDataSet(string sCon) { bool bIsOK = false; string strX = ""; grdList.AutoGenerateColumns = false; grdList.SelectionMode = DataGridViewSelectionMode.FullRowSelect; DBDataSet.Clear(); DBCommInfo.DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo(); //执行命令的对象 cmdInfo.SqlText = "select * from " + strTbNameMain + sCon; //SQL语句 或 存储过程名 若有参数,另外在参数集里增加 //if (UserInformation.UType != UserType.utSupervisor) //{ // cmdInfo.SqlText = cmdInfo.SqlText + " where "+strKeyFld+"='"+ UserInformation.UnitId +"'"; //仅显示当前用户的单位 //} cmdInfo.SqlType = SqlCommandType.sctSql; //SQL命令类型 SqlCommandType.sctSql SQL 语句 SqlCommandType.sctProcedure 表存储过程 cmdInfo.PageIndex = 0; //需要分页时的页号 cmdInfo.PageSize = 0; //需要分页时的每页记录条数 cmdInfo.FromSysType = "dotnet"; //采用处理结果数据的方式:php 表按照<tr><td></td></tr> xml 否则 直接采用ado 的记录集方式 cmdInfo.DataTableName = strTbNameMain; //指定结果数据记录集表名 SunEast.SeDBClient sdcX = new SeDBClient(); //获取服务器数据的类型对象 //sdcX.DBSTServer = DBSocketServerType.dbsstNormal; //自动根据配置文件读 string sErr = ""; //DataSet dsX = null; //DataTable tbX= null ; DBDataSet = sdcX.GetDataSet(cmdInfo, out sErr); //通过获取服务器数据对象的GetDataSet方法获取数据 bIsOK = DBDataSet != null; //if (bIsOK) //{ // DBDataSet.Clear(); // tbX = new DataTable(strTbNameMain); // tbX = dsX.Tables["data"].Copy(); // DBDataSet.Tables.Add(tbX); //} if (!bIsOK) { MessageBox.Show(sErr); } else { try { //DBDataSet.Tables["data"].TableName = strTbNameMain; DataSetUnBind(pnlEdit); this.bdsMain.DataSource = DBDataSet.Tables[strTbNameMain]; if (bdsMain != null && bdsMain.Count > 0) { BindDataSetToCtrls(); } bIsOK = true; optMain = OperateType.optNone; } catch (Exception e) { MessageBox.Show(e.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error); bIsOK = false; } } return(bIsOK); }
public DataSet GetDataSet() { try { DBCommInfo.DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo(); //执行命令的对象 cmdInfo.SqlText = "SP_GETMATERIALUNKEEPDAYLIST :pWHId,:pMNo,:pDay"; //SQL语句 或 存储过程名 若有参数,另外在参数集里增加 cmdInfo.SqlType = SqlCommandType.sctProcedure; //SQL命令类型 SqlCommandType.sctSql SQL 语句 SqlCommandType.sctProcedure 表存储过程 cmdInfo.PageIndex = 0; //需要分页时的页号 cmdInfo.PageSize = 0; //需要分页时的每页记录条数 cmdInfo.FromSysType = "dotnet"; //采用处理结果数据的方式:php 表按照<tr><td></td></tr> xml 否则 直接采用ado 的记录集方式 //cmdInfo.DataTableName = strTbNameMain; //指定结果数据记录集表名 默认为 data //定义参数 ZqmParamter par = null; //参数对象 变量 //------ par = new ZqmParamter(); //参数对象实例 par.ParameterName = "pWHId"; //参数名称 和实际定义的一致 if (cmbWHId.SelectedValue != null) { par.ParameterValue = cmbWHId.SelectedValue.ToString(); //参数值 可以为""空 } par.DataType = ZqmDataType.String; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); par = new ZqmParamter(); //参数对象实例 par.ParameterName = "pMNo"; //参数名称 和实际定义的一致 par.ParameterValue = txtMNo.Text.ToString(); //参数值 可以为""空 par.DataType = ZqmDataType.String; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); par = new ZqmParamter(); //参数对象实例 par.ParameterName = "pDay"; //参数名称 和实际定义的一致 par.ParameterValue = txt_Day.Text.ToString().Trim(); //参数值 可以为""空 par.DataType = ZqmDataType.Int; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); //------ //------ //执行命令 SunEast.SeDBClient sdcX = new SeDBClient(); //获取服务器数据的类型对象 //sdcX.DBSTServer = DBSocketServerType.dbsstNormal; //自动根据配置文件读 string sErr = ""; DataSet dsY = null; cmdInfo.DataTableName = "UnkeepList"; dsY = sdcX.GetDataSet(AppInformation.SvrSocket, cmdInfo, false, out sErr);; //sdcX.GetDataSet(cmdInfo, out sErr); //通过获取服务器数据对象的GetDataSet方法获取数据 FrmStockDtlRpt.dsRpt = dsY; return(dsY); } catch (Exception e) { MessageBox.Show(e.ToString()); return(null); } }
private void tlb_M_New_Click(object sender, EventArgs e) { DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo { SqlText = "sp_CreateBoxNo :pQty ,:pNoLength,:pHeader,:pBoxType", SqlType = SqlCommandType.sctProcedure, PageIndex = 0, PageSize = 0, FromSysType = "dotnet" }; ZqmParamter paramter = null; paramter = new ZqmParamter { ParameterName = "pQty", ParameterValue = "1", DataType = ZqmDataType.Int, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pNoLength", ParameterValue = "7", DataType = ZqmDataType.Int, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pHeader", ParameterValue = "", DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pBoxType", ParameterValue = " ", DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); SeDBClient client = new SeDBClient(); string sErr = ""; DataSet dataSet = null; DataTable table = null; dataSet = client.GetDataSet(cmdInfo, out sErr); if (dataSet != null) { table = dataSet.Tables["data"]; if (table != null) { sErr = table.Rows[0]["cResult"].ToString(); } } if (sErr.Length > 0) { MessageBox.Show(sErr); } dataSet.Clear(); }
public void DoMSave() { string str = ""; this.txt_cUnitId.Focus(); DataRowView current = (DataRowView)this.bdsMain.Current; if (current.IsEdit || current.IsNew) { this.UIToDataRowView(current, this.pnlEdit); if ((current[this.strKeyFld].ToString() == "") || (current[this.strKeyFld].ToString() == "-1")) { current[this.strKeyFld] = PubDBCommFuns.GetNewId(this.strTbNameMain, this.strKeyFld, base.UserInformation.UnitId.Trim().Length + 4, base.UserInformation.UnitId.Trim()); str = DBSQLCommandInfo.GetSQLByDataRow(current, this.strTbNameMain, this.strKeyFld, true); } else { str = DBSQLCommandInfo.GetSQLByDataRow(current, this.strTbNameMain, this.strKeyFld, false); } if (current.IsEdit) { current.EndEdit(); } DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo { SqlText = str, FldsData = DBSQLCommandInfo.GetFieldsForDate(current), SqlType = SqlCommandType.sctSql, PageIndex = 0, PageSize = 0, FromSysType = "dotnet" }; SeDBClient client = new SeDBClient(); string sErr = ""; if (client.GetDataSet(cmdInfo, out sErr).Tables[0].Rows[0][0].ToString() == "0") { this.optMain = OperateType.optSave; MessageBox.Show("保存数据成功!", "", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); this.OpenMainDataSet(); this.CtrlOptButtons(this.tlbMain, this.pnlEdit, this.optMain, base.DBDataSet.Tables[this.strTbNameMain]); this.optMain = OperateType.optNone; this.DisplayState(this.stbState, this.optMain); this.CtrlControlReadOnly(this.pnlEdit, false); } else { MessageBox.Show("保存数据失败!", "", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } } else { MessageBox.Show("对不起,当前没有处于编辑状态!", "", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } }
private void btnDel2_Click(object sender, EventArgs e) { try { DataRowView current = (DataRowView)this.bdsMain.Current; DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo { SqlText = "sp_pack_DelWKTskDtl :pnWorkId,:pBNo,:pItem", SqlType = SqlCommandType.sctProcedure, PageIndex = 0, PageSize = 0, FromSysType = "dotnet" }; ZqmParamter paramter = null; paramter = new ZqmParamter { ParameterName = "pnWorkId", ParameterValue = current["nWorkId"].ToString().Trim(), DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pBNo", ParameterValue = current["cBNo"].ToString().Trim(), DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pItem", ParameterValue = current["nItem"].ToString().Trim(), DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); SeDBClient client = new SeDBClient(); string sErr = ""; DataSet dataSet = null; DataTable table = null; dataSet = client.GetDataSet(cmdInfo, out sErr); if (dataSet != null) { table = dataSet.Tables["data"]; } MessageBox.Show(table.Rows[0]["cResult"].ToString()); dataSet.Clear(); } catch (Exception exception) { MessageBox.Show(exception.Message); } }
public static DataSet GetDataSetbySql(WMSAppInfo objApp, string select) { DBCommInfo.DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo(); //执行命令的对象 cmdInfo.SqlText = select; cmdInfo.SqlType = SqlCommandType.sctSql; //SQL命令类型 SqlCommandType.sctSql SQL 语句 SqlCommandType.sctProcedure 表存储过程 cmdInfo.PageIndex = 0; //需要分页时的页号 cmdInfo.PageSize = 0; //需要分页时的每页记录条数 cmdInfo.FromSysType = "dotnet"; SunEast.SeDBClient sdcX = new SeDBClient(); string sErr = ""; DataSet ds = sdcX.GetDataSet(objApp.SvrSocket, cmdInfo, false, out sErr); //sdcX.GetDataSet(cmdInfo, out sErr); return(ds); }
private DataSet GetDataTable(string sSql) { DataSet tbResult = null; try { DBCommInfo.DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo(); //执行命令的对象 cmdInfo.SqlText = sSql; //SQL语句 或 存储过程名 若有参数,另外在参数集里增加 cmdInfo.SqlType = SqlCommandType.sctSql; //SQL命令类型 SqlCommandType.sctSql SQL 语句 SqlCommandType.sctProcedure 表存储过程 cmdInfo.PageIndex = 0; //需要分页时的页号 cmdInfo.PageSize = 0; //需要分页时的每页记录条数 cmdInfo.FromSysType = "dotnet"; #region 定义参数 //采用处理结果数据的方式:php 表按照<tr><td></td></tr> xml 否则 直接采用ado 的记录集方式 //cmdInfo.DataTableName = strTbNameMain; //指定结果数据记录集表名 默认为 data //定义参数 //ZqmParamter par = null; //参数对象 变量 ////------ //par = new ZqmParamter(); //参数对象实例 //par.ParameterName = "pWHId"; //参数名称 和实际定义的一致 //par.ParameterValue = cmbWHId.SelectedValue.ToString(); //参数值 可以为""空 //par.DataType = ZqmDataType.String; //参数的数据类型 //par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 ////添加参数 //cmdInfo.Parameters.Add(par); ////------ ////------ #endregion //执行命令 SunEast.SeDBClient sdcX = new SeDBClient(); //获取服务器数据的类型对象 //sdcX.DBSTServer = DBSocketServerType.dbsstNormal; //自动根据配置文件读 string sErr = ""; DataSet dsY = null; cmdInfo.DataTableName = "WareCellCount"; dsY = sdcX.GetDataSet(AppInformation.SvrSocket, cmdInfo, false, out sErr); //通过获取服务器数据对象的GetDataSet方法获取数据 tbResult = dsY; //return dsY; } catch (Exception e) { MessageBox.Show(e.ToString()); return(tbResult); } return(tbResult); }
public void InitDataSet() { try { DBCommInfo.DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo(); //执行命令的对象 cmdInfo.SqlText = "SP_GETSYSLOG :pDateFrom,:pDateTo"; //SQL语句 或 存储过程名 若有参数,另外在参数集里增加 cmdInfo.SqlType = SqlCommandType.sctProcedure; //SQL命令类型 SqlCommandType.sctSql SQL 语句 SqlCommandType.sctProcedure 表存储过程 cmdInfo.PageIndex = 0; //需要分页时的页号 cmdInfo.PageSize = 0; //需要分页时的每页记录条数 cmdInfo.FromSysType = "dotnet"; //采用处理结果数据的方式:php 表按照<tr><td></td></tr> xml 否则 直接采用ado 的记录集方式 //cmdInfo.DataTableName = strTbNameMain; //指定结果数据记录集表名 默认为 data //定义参数 ZqmParamter par = null; //参数对象 变量 par = new ZqmParamter(); //参数对象实例 par.ParameterName = "pDateFrom"; //参数名称 和实际定义的一致 par.ParameterValue = dateTimePicker1.Value.ToString("yyyy-MM-dd 00:00:00"); //参数值 可以为""空 par.DataType = ZqmDataType.String; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); //------ par = new ZqmParamter(); //参数对象实例 par.ParameterName = "pDateTo"; //参数名称 和实际定义的一致 par.ParameterValue = dateTimePicker2.Value.ToString("yyyy-MM-dd 23:59:59"); //参数值 可以为""空 par.DataType = ZqmDataType.String; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); //------ //------ //执行命令 SunEast.SeDBClient sdcX = new SeDBClient(); //获取服务器数据的类型对象 //sdcX.DBSTServer = DBSocketServerType.dbsstNormal; //自动根据配置文件读 string sErr = ""; cmdInfo.DataTableName = "SysLog"; dsX.Clear(); dsX = sdcX.GetDataSet(AppInformation.SvrSocket, cmdInfo, false, out sErr);; //sdcX.GetDataSet(cmdInfo, out sErr); //通过获取服务器数据对象的GetDataSet方法获取数据 dataGridView1.DataSource = dsX.Tables["SysLog"]; } catch (Exception e) { MessageBox.Show(e.ToString()); } }
public bool OpenMainDataSet() { bool flag = false; this.grdList.AutoGenerateColumns = false; this.grdList.SelectionMode = DataGridViewSelectionMode.FullRowSelect; base.DBDataSet.Clear(); DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo { SqlText = "select * from " + this.strTbNameMain + " where 1=1 ", SqlType = SqlCommandType.sctSql, PageIndex = 0, PageSize = 0, FromSysType = "dotnet", DataTableName = this.strTbNameMain }; SeDBClient client = new SeDBClient(); string sErr = ""; base.DBDataSet = client.GetDataSet(cmdInfo, out sErr); flag = base.DBDataSet != null; if (!flag) { MessageBox.Show(sErr); return(flag); } try { this.ClearUIValues(this.pnlEdit); this.bIsMainOpened = false; this.bdsMain.DataSource = base.DBDataSet.Tables[this.strTbNameMain]; this.bIsMainOpened = true; this.BindDataSetToCtrls(); this.grdList.DataSource = this.bdsMain; flag = true; this.optMain = OperateType.optNone; } catch (Exception exception) { MessageBox.Show(exception.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Hand); flag = false; } return(flag); }
public void DoMDelete() { int optMain = -1; optMain = (int)this.optMain; DataRowView current = (DataRowView)this.bdsMain.Current; if (current == null) { MessageBox.Show("对不起,无数据可删除!", "", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else if ((0 < optMain) && (optMain < 3)) { MessageBox.Show("对不起,当前正处于编辑/新建状态,请先保存或取消操作!", "", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else if (MessageBox.Show("系统将永久删除此数据,不能恢复,您确定要删除此数据吗?", "WMS", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) != DialogResult.No) { DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo { SqlText = "delete " + this.strTbNameMain + " where " + this.strKeyFld + "='" + current[this.strKeyFld].ToString() + "'", SqlType = SqlCommandType.sctSql, PageIndex = 0, PageSize = 0, FromSysType = "dotnet", DataTableName = this.strTbNameMain }; SeDBClient client = new SeDBClient(); string sErr = ""; if (client.GetDataSet(cmdInfo, out sErr) != null) { this.optMain = OperateType.optDelete; this.OpenMainDataSet(); this.CtrlOptButtons(this.tlbMain, this.pnlEdit, this.optMain, base.DBDataSet.Tables[this.strTbNameMain]); this.optMain = OperateType.optNone; this.DisplayState(this.stbState, this.optMain); this.CtrlControlReadOnly(this.pnlEdit, false); } else { MessageBox.Show("对不起,删除操作失败!", "", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } } }
public static string SP_Ajust_UpdateStoreQty(Socket sktX, string pUserId, string pCmptId, string pSysFrom, string pPalletId, string pBoxId, string pMNo, double pRealQty, string pBNoIn, string pItemIn, string pAjustBNo, out string sErr) { string str = ""; DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo { SqlText = "SP_Ajust_UpdateStoreQty :pUserId, :pCmptId, :pSysFrom , :pPalletId, :pBoxId, :pMNo, :pRealQty,:pBNoIn,:pItemIn,:pAjustBNo", SqlType = SqlCommandType.sctProcedure, PageIndex = 0, PageSize = 0, FromSysType = "rf" }; ZqmParamter paramter = null; paramter = new ZqmParamter { ParameterName = "pUserId", ParameterValue = pUserId, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pCmptId", ParameterValue = pCmptId, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pSysFrom", ParameterValue = pSysFrom, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pPalletId", ParameterValue = pPalletId, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pBoxId", ParameterValue = pBoxId, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pMNo", ParameterValue = pMNo, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pRealQty", ParameterValue = pRealQty.ToString(), DataType = ZqmDataType.Double, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pBNoIn", ParameterValue = pBNoIn, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pItemIn", ParameterValue = pItemIn, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pAjustBNo", ParameterValue = pAjustBNo, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); SeDBClient client = new SeDBClient(); sErr = ""; DataSet set = null; DataTable table = null; set = client.GetDataSet(sktX, cmdInfo, false, out sErr); if (set != null) { table = set.Tables["result"]; if (table != null) { object obj2 = null; obj2 = table.Rows[0]["returncode"]; if (obj2 != null) { if (obj2.ToString() != "0") { sErr = table.Rows[0]["returndesc"].ToString(); } else { table = set.Tables[1]; obj2 = table.Rows[0]["cResultId"]; if (obj2 != null) { str = obj2.ToString(); } obj2 = table.Rows[0]["cResult"]; if (obj2 != null) { sErr = obj2.ToString(); } } } } set.Clear(); set.Dispose(); } return(str); }
public int GetNewItem(string billNo) { string str = "TWB_BillInDtl"; string str2 = "nItem"; DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo { SqlText = "sp_GetDtlSeq :TbName,:PFld,:SeqFld,:PValue", SqlType = SqlCommandType.sctProcedure, PageIndex = 0, PageSize = 0, FromSysType = "dotnet" }; ZqmParamter paramter = null; paramter = new ZqmParamter { ParameterName = "TbName", ParameterValue = str, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "PFld", ParameterValue = "cBNo", DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "SeqFld", ParameterValue = str2, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "PValue", ParameterValue = billNo, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); SeDBClient client = new SeDBClient(); string sErr = ""; DataSet dataSet = null; DataTable table = null; dataSet = client.GetDataSet(cmdInfo, out sErr); table = dataSet.Tables["data"]; if (table == null) { dataSet.Clear(); MessageBox.Show(sErr); return(-1); } if (table.Rows.Count == 0) { dataSet.Clear(); MessageBox.Show(" 获取明细序号无结果数据:" + sErr); return(-1); } object obj2 = table.Rows[0][0]; dataSet.Clear(); return(int.Parse(obj2.ToString())); }
public DataSet GetDataSet() { if (cmbWHId.Text != "") { WHId = cmbWHId.SelectedValue.ToString(); } else { //MessageBox.Show("对不起,仓库不能为空!"); WHId = ""; } Pallet = txtPalletId.Text.ToString(); MNo = txtMNo.Text.ToString(); BatchNo = txtBatchNo.Text.ToString(); if (cmbQCStatus.Text != "") { Qc = cmbQCStatus.SelectedValue.ToString(); } else { Qc = ""; } try { DBCommInfo.DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo(); //执行命令的对象 cmdInfo.SqlText = "sp_GetWareHouseItemList :nCountType,:pWHId,:pPalletId,:pMNo,:pBatchNo,:pQCStatus"; //SQL语句 或 存储过程名 若有参数,另外在参数集里增加 cmdInfo.SqlType = SqlCommandType.sctProcedure; //SQL命令类型 SqlCommandType.sctSql SQL 语句 SqlCommandType.sctProcedure 表存储过程 cmdInfo.PageIndex = 0; //需要分页时的页号 cmdInfo.PageSize = 0; //需要分页时的每页记录条数 cmdInfo.FromSysType = "dotnet"; //采用处理结果数据的方式:php 表按照<tr><td></td></tr> xml 否则 直接采用ado 的记录集方式 //cmdInfo.DataTableName = strTbNameMain; //指定结果数据记录集表名 默认为 data //定义参数 ZqmParamter par = null; //参数对象 变量 par = new ZqmParamter(); //参数对象实例 par.ParameterName = "nCountType"; //参数名称 和实际定义的一致 par.ParameterValue = CountType.ToString(); //参数值 可以为""空 par.DataType = ZqmDataType.Int; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); //------ par = new ZqmParamter(); //参数对象实例 par.ParameterName = "pWHId"; //参数名称 和实际定义的一致 par.ParameterValue = WHId; //参数值 可以为""空 par.DataType = ZqmDataType.String; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); //------ par = new ZqmParamter(); //参数对象实例 par.ParameterName = "pPalletId"; //参数名称 和实际定义的一致 par.ParameterValue = Pallet; //参数值 可以为""空 par.DataType = ZqmDataType.String; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); //------ par = new ZqmParamter(); //参数对象实例 par.ParameterName = "pMNo"; //参数名称 和实际定义的一致 par.ParameterValue = MNo; //参数值 可以为""空 par.DataType = ZqmDataType.String; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); //------ par = new ZqmParamter(); //参数对象实例 par.ParameterName = "pBatchNo"; //参数名称 和实际定义的一致 par.ParameterValue = BatchNo; //参数值 可以为""空 par.DataType = ZqmDataType.String; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); //------ par = new ZqmParamter(); //参数对象实例 par.ParameterName = "pQCStatus"; //参数名称 和实际定义的一致 par.ParameterValue = Qc; //参数值 可以为""空 par.DataType = ZqmDataType.Int; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); //------ //执行命令 SunEast.SeDBClient sdcX = new SeDBClient(); //获取服务器数据的类型对象 //sdcX.DBSTServer = DBSocketServerType.dbsstNormal; //自动根据配置文件读 string sErr = ""; DataSet dsY = null; cmdInfo.DataTableName = "StockDtl" + CountType; dsY = sdcX.GetDataSet(AppInformation.SvrSocket, cmdInfo, false, out sErr);; //sdcX.GetDataSet(cmdInfo, out sErr); //通过获取服务器数据对象的GetDataSet方法获取数据 FrmStockDtlRpt.dsRpt = dsY; return(dsY); } catch (Exception e) { MessageBox.Show(e.ToString()); return(null); } }
// public string GetNewId() { string sTbName = strTbNameMain; string sFldKey = "cBNo"; string sHead = "BMP" + DateTime.Now.ToString("yyMMdd"); int iNoLen = 12; DBCommInfo.DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo(); //执行命令的对象 cmdInfo.SqlText = "sp_GetNewId :pTbName,:pFldKey,:pLen,:pReplaceChar,:pHeader,:pFldCon,:pValueCon"; //SQL语句 或 存储过程名 若有参数,另外在参数集里增加 cmdInfo.SqlType = SqlCommandType.sctProcedure; //SQL命令类型 SqlCommandType.sctSql SQL 语句 SqlCommandType.sctProcedure 表存储过程 cmdInfo.PageIndex = 0; //需要分页时的页号 cmdInfo.PageSize = 0; //需要分页时的每页记录条数 cmdInfo.FromSysType = "dotnet"; //采用处理结果数据的方式:php 表按照<tr><td></td></tr> xml 否则 直接采用ado 的记录集方式 //cmdInfo.DataTableName = strTbNameMain; //指定结果数据记录集表名 默认为 data //定义参数 ZqmParamter par = null; //参数对象 变量 par = new ZqmParamter(); //参数对象实例 par.ParameterName = "pTbName"; //参数名称 和实际定义的一致 par.ParameterValue = sTbName; //参数值 可以为""空 par.DataType = ZqmDataType.String; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); //------ par = new ZqmParamter(); //参数对象实例 par.ParameterName = "pFldKey"; //参数名称 和实际定义的一致 par.ParameterValue = sFldKey; //参数值 可以为""空 par.DataType = ZqmDataType.String; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); //--- par = new ZqmParamter(); //参数对象实例 par.ParameterName = "pLen"; //参数名称 和实际定义的一致 par.ParameterValue = iNoLen.ToString(); //参数值 可以为""空 par.DataType = ZqmDataType.Int; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); //--- par = new ZqmParamter(); //参数对象实例 par.ParameterName = "pReplaceChar"; //参数名称 和实际定义的一致 par.ParameterValue = "0"; //参数值 可以为""空 par.DataType = ZqmDataType.String; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); //--- par = new ZqmParamter(); //参数对象实例 par.ParameterName = "pHeader"; //参数名称 和实际定义的一致 par.ParameterValue = sHead; //参数值 可以为""空 par.DataType = ZqmDataType.String; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); //--- par = new ZqmParamter(); //参数对象实例 par.ParameterName = "pFldCon"; //参数名称 和实际定义的一致 par.ParameterValue = ""; //参数值 可以为""空 par.DataType = ZqmDataType.String; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); //--- par = new ZqmParamter(); //参数对象实例 par.ParameterName = "pValueCon"; //参数名称 和实际定义的一致 par.ParameterValue = ""; //参数值 可以为""空 par.DataType = ZqmDataType.String; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); //--- //执行命令 SunEast.SeDBClient sdcX = new SeDBClient(); //获取服务器数据的类型对象 //sdcX.DBSTServer = DBSocketServerType.dbsstNormal; //自动根据配置文件读 string sErr = ""; DataSet dsX = null; DataTable tbX = null; dsX = sdcX.GetDataSet(AppInformation.SvrSocket, cmdInfo, false, out sErr); //通过获取服务器数据对象的GetDataSet方法获取数据 return(dsX.Tables["data"].Rows[0][0].ToString()); }
public void DoMDelete() { int optMain = -1; optMain = (int)this.optMain; DataRowView current = (DataRowView)this.bdsMain.Current; if (current == null) { MessageBox.Show("对不起,无数据可删除!", "", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else if ((0 < optMain) && (optMain < 3)) { MessageBox.Show("对不起,当前正处于编辑/新建状态,请先保存或取消操作!", "", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else if (MessageBox.Show("系统将永久删除此数据,不能恢复,您确定要删除此数据吗?", "WMS", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) != DialogResult.No) { try { DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo { SqlText = "sp_Pack_DelPWHWKTskDtl :pBNo,:pBClass,:pItem,:pPosId,:pPalletId,:pBoxId,:pMNo,:pBatchNo", SqlType = SqlCommandType.sctProcedure, PageIndex = 0, PageSize = 0, FromSysType = "dotnet" }; ZqmParamter paramter = null; paramter = new ZqmParamter { ParameterName = "pBNo", ParameterValue = current["cBNo"].ToString(), DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pBClass", ParameterValue = current["nBClass"].ToString(), DataType = ZqmDataType.Int, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pItem", ParameterValue = current["nItem"].ToString(), DataType = ZqmDataType.Int, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pPosId", ParameterValue = current["cPosId"].ToString(), DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pPalletId", ParameterValue = current["nPalletId"].ToString(), DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pBoxId", ParameterValue = current["cBoxId"].ToString(), DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pMNo", ParameterValue = current["cMNo"].ToString(), DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pBatchNo", ParameterValue = current["cBatchNo"].ToString(), DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); SeDBClient client = new SeDBClient(); string sErr = ""; DataSet dataSet = null; DataTable table = null; dataSet = client.GetDataSet(cmdInfo, out sErr); if (dataSet != null) { table = dataSet.Tables["data"]; if (table.Rows.Count > 0) { DataRow row = table.Rows[0]; if (row != null) { if (row["cResultId"].ToString() == "0") { MessageBox.Show("指令删除成功"); } else { MessageBox.Show(row["cResult"].ToString()); } } } } dataSet.Clear(); if (dataSet != null) { this.optMain = OperateType.optDelete; this.OpenMainDataSet(); this.optMain = OperateType.optNone; } else { MessageBox.Show("对不起,删除操作失败!", "", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } } catch (Exception exception) { MessageBox.Show(exception.Message); } } }
private void button1_Click(object sender, EventArgs e) { DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo { SqlText = "sp_Chk_WriteChkDtl :cUser,:cCheckNo,:cWHId,:cPalletId,:cBoxId,:cMNo,:cBatchNo,:nQCStatus,:fQty,:fRQty,:cUnit", SqlType = SqlCommandType.sctProcedure, PageIndex = 0, PageSize = 0, FromSysType = "dotnet" }; ZqmParamter paramter = null; paramter = new ZqmParamter { ParameterName = "cUser", ParameterValue = this.textBox_cUser.Text.ToString(), DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "cCheckNo", ParameterValue = this.textBox_cCheckNo.Text.ToString(), DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "cWHId", ParameterValue = this.textBox_cWHId.Text.ToString(), DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "cPalletId", ParameterValue = this.textBox_cPalletId.Text.ToString(), DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "cBoxId", ParameterValue = this.textBox_cBoxId.Text.ToString(), DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "cMNo", ParameterValue = this.textBox_cMNo.Text.ToString(), DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "cBatchNo", ParameterValue = this.textBox_cBatchNo.Text.ToString(), DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "nQCStatus", ParameterValue = this.textBox_nQCStatus.Text.ToString(), DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "fQty", ParameterValue = this.textBox_fQty.Text.ToString(), DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "fRQty", ParameterValue = this.textBox_fRQty.Text.ToString(), DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "cUnit", ParameterValue = this.textBox_cUnit.Text.ToString(), DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); SeDBClient client = new SeDBClient(); string sErr = ""; DataSet dataSet = null; DataTable table = null; dataSet = client.GetDataSet(cmdInfo, out sErr); if (dataSet != null) { table = dataSet.Tables["data"]; } if (table.Rows[0]["cResult"].ToString() == "0") { MessageBox.Show("实盘登记成功"); } dataSet.Clear(); base.Close(); }
private void button1_Click(object sender, EventArgs e) { if (this.cmb_cWHId.Text.Trim() == "") { MessageBox.Show("不好意思,仓库不能为空!"); this.cmb_cWHId.Focus(); } else if (this.cmb_cWHId.SelectedValue == null) { MessageBox.Show("不好意思,仓库不能为空,请选择"); this.cmb_cWHId.Focus(); } else { try { string str = ""; DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo { SqlText = "sp_CreatePosId :pWHId,:pRowFrom,:pRowTo,:pColFrom,:pColTo,:pLayerFrom,:pLayerTo,:pRowLen,:pColLen,:pLayerLen,:pAreaId,:pPalletSpec,:pL,:pW,:pH,:pHeight,:pMAreaId,pWeight", SqlType = SqlCommandType.sctProcedure, PageIndex = 0, PageSize = 0, FromSysType = "dotnet" }; ZqmParamter paramter = null; paramter = new ZqmParamter { ParameterName = "pWHId", ParameterValue = this.cmb_cWHId.SelectedValue.ToString(), DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pRowFrom", ParameterValue = this.textBox_RowFrom.Text.ToString(), DataType = ZqmDataType.Int, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pRowTo", ParameterValue = this.textBox_RowTo.Text.ToString(), DataType = ZqmDataType.Int, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pColFrom", ParameterValue = this.textBox_ColFrom.Text.ToString(), DataType = ZqmDataType.Int, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pColTo", ParameterValue = this.textBox_ColTo.Text.ToString(), DataType = ZqmDataType.Int, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pLayerFrom", ParameterValue = this.textBox_LayerFrom.Text.ToString(), DataType = ZqmDataType.Int, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pLayerTo", ParameterValue = this.textBox_LayerTo.Text.ToString(), DataType = ZqmDataType.Int, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pRowLen", ParameterValue = "2", DataType = ZqmDataType.Int, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pColLen", ParameterValue = "3", DataType = ZqmDataType.Int, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pLayerLen", ParameterValue = "2", DataType = ZqmDataType.Int, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); str = ""; if (this.cmb_cAreaId.SelectedValue != null) { str = this.cmb_cAreaId.SelectedValue.ToString().Trim(); } paramter = new ZqmParamter { ParameterName = "pAreaId", ParameterValue = str, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); str = ""; if (this.cmb_cPalletSpec.SelectedValue != null) { str = this.cmb_cPalletSpec.SelectedValue.ToString().Trim(); } paramter = new ZqmParamter { ParameterName = "pPalletSpec", ParameterValue = str, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pL", ParameterValue = this.txt_nL.Text.ToString(), DataType = ZqmDataType.Int, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pW", ParameterValue = this.txt_nW.Text.ToString(), DataType = ZqmDataType.Int, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pH", ParameterValue = this.txt_nH.Text.ToString(), DataType = ZqmDataType.Int, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pHeight", ParameterValue = this.cmb_Height.SelectedValue.ToString(), DataType = ZqmDataType.Int, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pMAreaId" }; str = ""; if ((this.cmb_cMAreaId.Text.Trim() != "") && (this.cmb_cMAreaId.SelectedValue != null)) { str = this.cmb_cMAreaId.SelectedValue.ToString().Trim(); } paramter.ParameterValue = str; paramter.DataType = ZqmDataType.String; paramter.ParameterDir = ZqmParameterDirction.Input; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pWeight", ParameterValue = this.cmb_Weight.SelectedValue.ToString(), DataType = ZqmDataType.Int, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); SeDBClient client = new SeDBClient(); string sErr = ""; DataSet dataSet = null; DataTable table = null; dataSet = client.GetDataSet(cmdInfo, out sErr); if (dataSet != null) { table = dataSet.Tables["data"]; this.bIsOK = true; if (table != null) { MessageBox.Show(table.Rows[0]["cResult"].ToString()); } dataSet.Clear(); } } catch (Exception exception) { this.bIsOK = false; MessageBox.Show(exception.Message); } } }
private void button1_Click(object sender, EventArgs e) { try { string str = this.textBox_cBNo.Text.ToString().Trim(); string str2 = this.textBox_nItem.Text.ToString().Trim(); string str3 = this.textBox_nWorkId.Text.ToString().Trim(); string str4 = this.textBox_fQty.Text.ToString().Trim(); DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo { SqlText = "sp_Pack_UpdtExceptQty :pWorkId,:pBNo,:pItem,:pQty", SqlType = SqlCommandType.sctProcedure, PageIndex = 0, PageSize = 0, FromSysType = "dotnet" }; ZqmParamter paramter = null; paramter = new ZqmParamter { ParameterName = "pWorkId", ParameterValue = str3, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pBNo", ParameterValue = str, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pItem", ParameterValue = str2, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pQty", ParameterValue = str4, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); SeDBClient client = new SeDBClient(); string sErr = ""; DataSet dataSet = null; DataTable table = null; dataSet = client.GetDataSet(cmdInfo, out sErr); if (dataSet != null) { table = dataSet.Tables["data"]; } MessageBox.Show(table.Rows[0]["cResult"].ToString()); dataSet.Clear(); } catch (Exception exception) { MessageBox.Show(exception.Message); } }
public static string sp_Chk_CreateDataFromMID(Socket sktX, string pUser, string pCmptId, string pChkNo, out string sErr) { string str = ""; DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo { SqlText = "sp_Chk_CreateDataFromMID :pUser ,:pCmptId,:pChkNo ", SqlType = SqlCommandType.sctProcedure, PageIndex = 0, PageSize = 0, FromSysType = "dotnet" }; ZqmParamter paramter = null; paramter = new ZqmParamter { ParameterName = "pUser", ParameterValue = pUser, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pCmptId", ParameterValue = "pCmptId", DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pChkNo", ParameterValue = "pChkNo", DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); SeDBClient client = new SeDBClient(); sErr = ""; DataSet set = null; DataTable table = null; try { set = client.GetDataSet(sktX, cmdInfo, false, out sErr); } catch (Exception exception) { sErr = exception.Message; return("-1"); } if (set != null) { table = set.Tables["result"]; if (table != null) { object obj2 = null; obj2 = table.Rows[0]["returncode"]; if (obj2 != null) { if (obj2.ToString() != "0") { sErr = table.Rows[0]["returndesc"].ToString(); } else { table = set.Tables[1]; obj2 = table.Rows[0]["cResultId"]; if (obj2 != null) { str = obj2.ToString(); sErr = table.Rows[0]["cResult"].ToString(); } } } } } set.Clear(); set.Dispose(); return(str); }
private void button1_Click(object sender, EventArgs e) { string sId = ""; DBCommInfo.DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo(); //执行命令的对象 cmdInfo.SqlText = "sp_Chk_WriteChkDtl :cUser,:cCheckNo,:cWHId,:cPalletId,:cBoxId,:cMNo,:cBatchNo,:nQCStatus,:fQty,:fRQty,:cUnit"; //SQL语句 或 存储过程名 若有参数,另外在参数集里增加 cmdInfo.SqlType = SqlCommandType.sctProcedure; //SQL命令类型 SqlCommandType.sctSql SQL 语句 SqlCommandType.sctProcedure 表存储过程 cmdInfo.PageIndex = 0; //需要分页时的页号 cmdInfo.PageSize = 0; //需要分页时的每页记录条数 cmdInfo.FromSysType = "dotnet"; //采用处理结果数据的方式:php 表按照<tr><td></td></tr> xml 否则 直接采用ado 的记录集方式 //cmdInfo.DataTableName = strTbNameMain; //指定结果数据记录集表名 默认为 data //定义参数 ZqmParamter par = null; //参数对象 变量 par = new ZqmParamter(); //参数对象实例 par.ParameterName = "cUser"; //参数名称 和实际定义的一致 par.ParameterValue = textBox_cUser.Text.ToString(); //参数值 可以为""空 par.DataType = ZqmDataType.String; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); //------ par = new ZqmParamter(); //参数对象实例 par.ParameterName = "cCheckNo"; //参数名称 和实际定义的一致 par.ParameterValue = textBox_cCheckNo.Text.ToString(); //参数值 可以为""空 par.DataType = ZqmDataType.String; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); //--- //------ par = new ZqmParamter(); //参数对象实例 par.ParameterName = "cWHId"; //参数名称 和实际定义的一致 par.ParameterValue = textBox_cWHId.Text.ToString(); //参数值 可以为""空 par.DataType = ZqmDataType.String; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); //--- //------ par = new ZqmParamter(); //参数对象实例 par.ParameterName = "cPalletId"; //参数名称 和实际定义的一致 par.ParameterValue = textBox_cPalletId.Text.ToString(); //参数值 可以为""空 par.DataType = ZqmDataType.String; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); //--- //------ par = new ZqmParamter(); //参数对象实例 par.ParameterName = "cBoxId"; //参数名称 和实际定义的一致 par.ParameterValue = textBox_cBoxId.Text.ToString(); //参数值 可以为""空 par.DataType = ZqmDataType.String; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); //--- //------ par = new ZqmParamter(); //参数对象实例 par.ParameterName = "cMNo"; //参数名称 和实际定义的一致 par.ParameterValue = textBox_cMNo.Text.ToString(); //参数值 可以为""空 par.DataType = ZqmDataType.String; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); //--- //------ par = new ZqmParamter(); //参数对象实例 par.ParameterName = "cBatchNo"; //参数名称 和实际定义的一致 par.ParameterValue = textBox_cBatchNo.Text.ToString(); //参数值 可以为""空 par.DataType = ZqmDataType.String; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); //--- //------ par = new ZqmParamter(); //参数对象实例 par.ParameterName = "nQCStatus"; //参数名称 和实际定义的一致 par.ParameterValue = textBox_nQCStatus.Text.ToString(); //参数值 可以为""空 par.DataType = ZqmDataType.String; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); //--- //------ par = new ZqmParamter(); //参数对象实例 par.ParameterName = "fQty"; //参数名称 和实际定义的一致 par.ParameterValue = textBox_fQty.Text.ToString(); //参数值 可以为""空 par.DataType = ZqmDataType.String; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); //--- //------ par = new ZqmParamter(); //参数对象实例 par.ParameterName = "fRQty"; //参数名称 和实际定义的一致 par.ParameterValue = textBox_fRQty.Text.ToString(); //参数值 可以为""空 par.DataType = ZqmDataType.String; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); //--- //------ par = new ZqmParamter(); //参数对象实例 par.ParameterName = "cUnit"; //参数名称 和实际定义的一致 par.ParameterValue = textBox_cUnit.Text.ToString(); //参数值 可以为""空 par.DataType = ZqmDataType.String; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); //--- //执行命令 SunEast.SeDBClient sdcX = new SeDBClient(); //获取服务器数据的类型对象 //sdcX.DBSTServer = DBSocketServerType.dbsstNormal; //自动根据配置文件读 string sErr = ""; DataSet dsX = null; DataTable tbX = null; dsX = sdcX.GetDataSet(cmdInfo, out sErr); //通过获取服务器数据对象的GetDataSet方法获取数据 if (dsX != null) { tbX = dsX.Tables["data"]; // if (tbX != null) // sId = tbX.Rows[0]["cNewId"].ToString(); } if ((tbX.Rows[0]["cResult"].ToString()) == "0") { MessageBox.Show("实盘登记成功"); } dsX.Clear(); Close(); }
public int GetNewItem(string billNo) { string sTbName = "TWB_BillInDtl"; if (_BClass == 11) { sTbName = "TWB_BillChkAcceptDtl"; } string sFldKey = "nItem"; //string sHead = "BI" + DateTime.Now.ToString("yyMMdd"); //int iNoLen = 12; DBCommInfo.DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo(); //执行命令的对象 cmdInfo.SqlText = "sp_GetDtlSeq :TbName,:PFld,:SeqFld,:PValue"; //SQL语句 或 存储过程名 若有参数,另外在参数集里增加 cmdInfo.SqlType = SqlCommandType.sctProcedure; //SQL命令类型 SqlCommandType.sctSql SQL 语句 SqlCommandType.sctProcedure 表存储过程 cmdInfo.PageIndex = 0; //需要分页时的页号 cmdInfo.PageSize = 0; //需要分页时的每页记录条数 cmdInfo.FromSysType = "dotnet"; //采用处理结果数据的方式:php 表按照<tr><td></td></tr> xml 否则 直接采用ado 的记录集方式 //cmdInfo.DataTableName = strTbNameMain; //指定结果数据记录集表名 默认为 data //定义参数 ZqmParamter par = null; //参数对象 变量 par = new ZqmParamter(); //参数对象实例 par.ParameterName = "TbName"; //参数名称 和实际定义的一致 par.ParameterValue = sTbName; //参数值 可以为""空 par.DataType = ZqmDataType.String; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); //------ par = new ZqmParamter(); //参数对象实例 par.ParameterName = "PFld"; //参数名称 和实际定义的一致 par.ParameterValue = "cBNo"; //参数值 可以为""空 par.DataType = ZqmDataType.String; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); //--- par = new ZqmParamter(); //参数对象实例 par.ParameterName = "SeqFld"; //参数名称 和实际定义的一致 par.ParameterValue = sFldKey; //参数值 可以为""空 par.DataType = ZqmDataType.String; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); //--- par = new ZqmParamter(); //参数对象实例 par.ParameterName = "PValue"; //参数名称 和实际定义的一致 par.ParameterValue = billNo; //参数值 可以为""空 par.DataType = ZqmDataType.String; //参数的数据类型 par.ParameterDir = ZqmParameterDirction.Input; //指定参数 为输入、输出类型 //添加参数 cmdInfo.Parameters.Add(par); //--- //执行命令 SunEast.SeDBClient sdcX = new SeDBClient(); //获取服务器数据的类型对象 //sdcX.DBSTServer = DBSocketServerType.dbsstNormal; //自动根据配置文件读 string sErr = ""; DataSet dsX = null; DataTable tbX = null; dsX = sdcX.GetDataSet(cmdInfo, out sErr); //通过获取服务器数据对象的GetDataSet方法获取数据 tbX = dsX.Tables["data"]; if (tbX == null) { dsX.Clear(); MessageBox.Show(sErr); return(-1); } if (tbX.Rows.Count == 0) { dsX.Clear(); MessageBox.Show(" 获取明细序号无结果数据:" + sErr); return(-1); } object objX = tbX.Rows[0][0]; dsX.Clear(); return(int.Parse(objX.ToString())); }
public static string sp_Chk_WriteAjustDtl(Socket sktX, string pUser, string pCmptId, string pSysFrom, string pAjustNo, string pWHId, string pPosId, string pPalletId, string pBoxId, string pMNo, double pDiff, string pBNoIn, int pItemIn, string pCheckNo, out string sErr) { string str = ""; DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo { SqlText = "SP_CHK_WRITEAJUSTDTL :pUser,:pCmptId,:pSysFrom,:pAjustNo,:pWHId,:pPosId,:pPalletId,:pBoxId ,:pMNo,:pDiff,:pBNoIn,:pItemIn,:pCheckNo ", SqlType = SqlCommandType.sctProcedure, PageIndex = 0, PageSize = 0, FromSysType = "dotnet" }; ZqmParamter paramter = null; paramter = new ZqmParamter { ParameterName = "pUser", ParameterValue = pUser, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pCmptId", ParameterValue = pCmptId, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pSysFrom", ParameterValue = pSysFrom, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pAjustNo", ParameterValue = pAjustNo, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pWHId", ParameterValue = pWHId, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pPosId", ParameterValue = pPosId, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pPalletId", ParameterValue = pPalletId, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pBoxId", ParameterValue = pBoxId, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pMNo", ParameterValue = pMNo, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pDiff", ParameterValue = pDiff.ToString(), DataType = ZqmDataType.Double, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pBNoIn", ParameterValue = pBNoIn, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pItemIn", ParameterValue = pItemIn.ToString(), DataType = ZqmDataType.Int, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pCheckNo", ParameterValue = pCheckNo, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); SeDBClient client = new SeDBClient(); sErr = ""; DataSet set = null; DataTable table = null; set = client.GetDataSet(sktX, cmdInfo, false, out sErr); if (set != null) { table = set.Tables["result"]; if (table != null) { object obj2 = null; obj2 = table.Rows[0]["returncode"]; if (obj2 != null) { if (obj2.ToString() != "0") { sErr = table.Rows[0]["returndesc"].ToString(); } else { table = set.Tables[1]; obj2 = table.Rows[0]["cResult"]; if (obj2 != null) { str = obj2.ToString(); if (str != "0") { sErr = str; } else { sErr = ""; } } } } } } set.Clear(); set.Dispose(); return(str); }
public void DoMSave() { string sSql = ""; txt_cComptId.Focus();//使其焦点移开,修改数据能及时更新 DataRowView drvX = (DataRowView)bdsMain.Current; if (drvX.IsEdit || drvX.IsNew) { UIToDataRowView(drvX, pnlEdit); if (drvX[strKeyFld].ToString() == "" || drvX[strKeyFld].ToString() == "-1") //新增,需要产生新的号码 { drvX[strKeyFld] = SunEast.App.PubDBCommFuns.GetNewId(strTbNameMain, strKeyFld, 3, "1"); sSql = DBCommInfo.DBSQLCommandInfo.GetSQLByDataRow(drvX, strTbNameMain, strKeyFld, true);//产生 insert 语句 } else { sSql = DBCommInfo.DBSQLCommandInfo.GetSQLByDataRow(drvX, strTbNameMain, strKeyFld, false);//产生UPDATE 语句 } bool bX = false; if (drvX.IsEdit) { drvX.EndEdit(); } DBCommInfo.DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo(); //执行命令的对象 cmdInfo.SqlText = sSql; //SQL语句 或 存储过程名 若有参数,另外在参数集里增加 cmdInfo.FldsData = DBCommInfo.DBSQLCommandInfo.GetFieldsForDate(drvX); cmdInfo.SqlType = SqlCommandType.sctSql; //SQL命令类型 SqlCommandType.sctSql SQL 语句 SqlCommandType.sctProcedure 表存储过程 cmdInfo.PageIndex = 0; //需要分页时的页号 cmdInfo.PageSize = 0; //需要分页时的每页记录条数 cmdInfo.FromSysType = "dotnet"; //采用处理结果数据的方式:php 表按照<tr><td></td></tr> xml 否则 直接采用ado 的记录集方式 //cmdInfo.DataTableName = strTbNameMain; //指定结果数据记录集表名 SunEast.SeDBClient sdcX = new SeDBClient(); //获取服务器数据的类型对象 //sdcX.DBSTServer = DBSocketServerType.dbsstNormal; //自动根据配置文件读 string sErr = ""; DataSet dsX = null; DataTable tbX = null; dsX = sdcX.GetDataSet(cmdInfo, out sErr); //通过获取服务器数据对象的GetDataSet方法获取数据 bX = dsX.Tables[0].Rows[0][0].ToString() == "0"; if (bX) { optMain = OperateType.optSave; MessageBox.Show("保存数据成功!", "", MessageBoxButtons.OK, MessageBoxIcon.Information); //重新刷新数据 OpenMainDataSet(sbConndition.ToString()); //控制录入问题 CtrlOptButtons(this.tlbMain, pnlEdit, optMain, DBDataSet.Tables[strTbNameMain]); optMain = OperateType.optNone; DisplayState(stbState, optMain); CtrlControlReadOnly(pnlEdit, false); } else { MessageBox.Show("保存数据失败!", "", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show("对不起,当前没有处于编辑状态!", "", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public static string GetNewId(Socket sktX, string sTbName, string sKeyFld, int nLength, string sHeader, string sFldCon, string sValueCon, out string sErr) { string str = ""; DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo { SqlText = "sp_GetNewId :pTbName, :pFldKey, :pLen , :pReplaceChar, :pHeader, :pFldCon, :pValueCon ", SqlType = SqlCommandType.sctProcedure, PageIndex = 0, PageSize = 0, FromSysType = "dotnet" }; ZqmParamter paramter = null; paramter = new ZqmParamter { ParameterName = "pTbName", ParameterValue = sTbName, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pFldKey", ParameterValue = sKeyFld, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pLen", ParameterValue = nLength.ToString(), DataType = ZqmDataType.Int, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pReplaceChar", ParameterValue = "0", DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pHeader", ParameterValue = sHeader, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pFldCon", ParameterValue = "", DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pValueCon", ParameterValue = "", DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); SeDBClient client = new SeDBClient(); sErr = ""; DataSet set = null; DataTable table = null; set = client.GetDataSet(sktX, cmdInfo, false, out sErr); if (set != null) { table = set.Tables["data"]; if (table != null) { str = table.Rows[0]["cNewId"].ToString(); } } set.Clear(); return(str); }
public static DataTable sp_GetSlackMatDtlList(Socket sktX, string pWHId, string pDateFrom, string pDateTo, out string sErr) { DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo { SqlText = "sp_GetSlackMatDtlList :pWHId ,:pDateFrom,:pDateTo ", SqlType = SqlCommandType.sctProcedure, PageIndex = 0, PageSize = 0, FromSysType = "dotnet" }; ZqmParamter paramter = null; paramter = new ZqmParamter { ParameterName = "pWHId", ParameterValue = pWHId, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pDateFrom", ParameterValue = pDateFrom, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pDateTo", ParameterValue = pDateTo, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); SeDBClient client = new SeDBClient(); sErr = ""; DataSet set = null; DataTable table = null; DataTable table2 = null; set = client.GetDataSet(sktX, cmdInfo, false, out sErr); if (set != null) { table = set.Tables["result"]; if (table != null) { object obj2 = null; obj2 = table.Rows[0]["returncode"]; if (obj2 != null) { if (obj2.ToString() != "0") { sErr = table.Rows[0]["returndesc"].ToString(); } else { table2 = set.Tables[1]; table2.TableName = "SlackMatDtlList"; } } } } table.Clear(); return(table2); }
public bool GetUserRights(WMSUserInfo uinfo) { StringBuilder builder = new StringBuilder(""); ToolStripMenuItem item = null; this.mmMain.Items.Clear(); if (uinfo != null) { if (uinfo.UType == UserType.utSupervisor) { builder.Append("select * from tpb_rights where cRType <= 2"); } else { builder.Append("select * from tpb_rights where ( cRType <= 2) and cRId in (select cRId from tpb_Urts where cUserId='" + uinfo.UserId + "')"); } builder.Append(" order by nSort,cRId"); DataSet set = null; SeDBClient client = new SeDBClient(DBSocketServerType.dbsstDotNet); DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo { FromSysType = "DotNet", PageIndex = 0, PageSize = 0, SqlText = builder.ToString(), SqlType = SqlCommandType.sctSql, MyEncoding = Encoding.UTF8 }; string sErr = ""; set = client.GetDataSet(this.ainfo.SvrSocket, cmdInfo, false, out sErr); if (sErr.Length > 0) { MessageBox.Show(sErr); } if (set != null) { DataTable tbX = set.Tables["data"]; if ((tbX != null) && (tbX.Rows.Count > 0)) { DataRow[] rowArray = tbX.Select("cPRId='0'"); if ((rowArray != null) && (rowArray.Length > 0)) { foreach (DataRow row in rowArray) { item = null; item = new ToolStripMenuItem { Name = row["cRId"].ToString(), Text = row["cName"].ToString(), Tag = row["cRId"].ToString(), ShowShortcutKeys = false }; int num = 0; if (row["cRType"] != null) { num = int.Parse(row["cRType"].ToString()); } if (num == 1) { item.Click += new EventHandler(this.DoMenuItemClick); item.ToolTipText = item.Text; } this.mmMain.Items.Add(item); this.LoadUserMenuItem(item, tbX); } } } } } ToolStripMenuItem item2 = null; item = new ToolStripMenuItem { Name = "mnHelp", Text = "帮助" }; this.mmMain.Items.Add(item); item2 = new ToolStripMenuItem { Name = "mnHelp_Help", Text = "帮助", ToolTipText = item.Text }; item2.Click += new EventHandler(this.DoHelpClick); item.DropDownItems.Add(item2); item2 = null; item.DropDownItems.Add(this.mi_Help_Abot); //item = null; item = new ToolStripMenuItem { Name = "mnExit", Text = "退出", ToolTipText = item.Text }; item.Click += new EventHandler(this.DoExitClick); this.mmMain.Items.Add(item); return(false); }
public static string sp_UpdatePalletStatus(Socket sktX, string pPalletId, out string sErr) { string str = ""; DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo { SqlText = "sp_UpdatePalletStatus :pPalletId ,:pPalletLevel ", SqlType = SqlCommandType.sctProcedure, PageIndex = 0, PageSize = 0, FromSysType = "dotnet" }; ZqmParamter paramter = null; paramter = new ZqmParamter { ParameterName = "pPalletId", ParameterValue = pPalletId, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pPalletLevel", ParameterValue = "9", DataType = ZqmDataType.Int, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); SeDBClient client = new SeDBClient(); sErr = ""; DataSet set = null; DataTable table = null; set = client.GetDataSet(sktX, cmdInfo, false, out sErr); if (set != null) { table = set.Tables["result"]; if (table != null) { object obj2 = null; obj2 = table.Rows[0]["returncode"]; if (obj2 != null) { if (obj2.ToString() != "0") { sErr = table.Rows[0]["returndesc"].ToString(); } else { table = set.Tables[1]; obj2 = table.Rows[0]["cResult"]; if (obj2 != null) { str = obj2.ToString(); } } } } } set.Clear(); set.Dispose(); return(str); }
public static string sp_Pack_DoWareCellMove(Socket sktX, string pSysType, string pPosIdFrom, string pPosIdTo, string pUser, string pCmptId, int pIsDoNow, out string sErr) { string str = ""; DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo { SqlText = "sp_Pack_DoWareCellMove :pSysType, :pPosIdFrom,:pPosIdTo,:pUser,:pCmptId,pIsDoNow ", SqlType = SqlCommandType.sctProcedure, PageIndex = 0, PageSize = 0, FromSysType = "dotnet" }; ZqmParamter paramter = null; paramter = new ZqmParamter { ParameterName = "pSysType", ParameterValue = pSysType, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pPosIdFrom", ParameterValue = pPosIdFrom, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pPosIdTo", ParameterValue = pPosIdTo, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pUser", ParameterValue = pUser, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pCmptId", ParameterValue = pCmptId, DataType = ZqmDataType.String, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); paramter = new ZqmParamter { ParameterName = "pIsDoNow", ParameterValue = pIsDoNow.ToString(), DataType = ZqmDataType.Int, ParameterDir = ZqmParameterDirction.Input }; cmdInfo.Parameters.Add(paramter); SeDBClient client = new SeDBClient(); sErr = ""; DataSet set = null; DataTable table = null; set = client.GetDataSet(sktX, cmdInfo, false, out sErr); if (set != null) { table = set.Tables["result"]; if (table != null) { object obj2 = null; obj2 = table.Rows[0]["returncode"]; if (obj2 != null) { if (obj2.ToString() != "0") { sErr = table.Rows[0]["returndesc"].ToString(); } else { table = set.Tables[1]; obj2 = table.Rows[0]["cResult"]; if (obj2 != null) { str = obj2.ToString(); if (str != "0") { sErr = str; } else { sErr = ""; } } } } } } set.Clear(); set.Dispose(); return(str); }