public static string PurRejectJudge(string pur_pcode) { string retValue = "0"; if (pur_pcode.Contains("/BOM_")) { System.Data.DataTable dt; try { SqlConnection sqlConn = new SqlConnection(); SqlCommand sqlCmd = new SqlCommand(); sqlConn.ConnectionString = DBCallCommon.GetStringValue("connectionStrings"); DBCallCommon.PrepareStoredProc(sqlConn, sqlCmd, "[PRO_PurPlanRejectJudge]"); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@PT_CODE", pur_pcode, SqlDbType.Text, 1000); sqlConn.Open(); dt = DBCallCommon.GetDataTableUsingCmd(sqlCmd); sqlConn.Close(); } catch (Exception) { throw; } retValue = dt.Rows[0][0].ToString(); } return(retValue); }
/// <summary> /// 执行存储过程验证序号(保存时) /// </summary> /// <param name="psv"></param> private void ExecSpareParts(ParamsBj pbj) { try { SqlConnection sqlConn = new SqlConnection(); SqlCommand sqlCmd = new SqlCommand(); sqlConn.ConnectionString = DBCallCommon.GetStringValue("connectionStrings"); DBCallCommon.PrepareStoredProc(sqlConn, sqlCmd, "[PRO_TM_SparePartsGen]"); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@TableName", pbj.TableName, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@EngID", pbj.EngID, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@BjType", pbj.BjType, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@CalType", pbj.CalType, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@BjFather", pbj.BjFather, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@UserID", pbj.UserID, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@Xishu", pbj.Xishu, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@WaitFor", pbj.WaitFor, SqlDbType.Text, 3000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@BiaoShi", pbj.BiaoShi, SqlDbType.Text, 3000); sqlConn.Open(); sqlCmd.ExecuteNonQuery(); sqlConn.Close(); } catch (Exception) { throw; } }
/// <summary> /// 执行存储过程 /// </summary> /// <param name="psv"></param> private System.Data.DataTable ExecMarCheck(ParamsCheckMarNotBelongToMar psv) { System.Data.DataTable dt; try { SqlConnection sqlConn = new SqlConnection(); SqlCommand sqlCmd = new SqlCommand(); sqlConn.ConnectionString = DBCallCommon.GetStringValue("connectionStrings"); DBCallCommon.PrepareStoredProc(sqlConn, sqlCmd, "PRO_TM_CheckMarNotBelongToMarBOM"); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@StrTable", psv.StrTabeleName, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@ENG_ID", psv.TaskID, SqlDbType.Text, 1000); sqlConn.Open(); dt = DBCallCommon.GetDataTableUsingCmd(sqlCmd); sqlConn.Close(); } catch (Exception) { throw; } return(dt); //SqlParameter[] pms = new SqlParameter[] { //new SqlParameter("@StrTable",psv.StrTabeleName), //new SqlParameter("@ENG_ID",psv.TaskID) //} //return SqlHelper.ExecuteDataTable("PRO_TM_CheckMarNotBelongToMarBOM", CommandType.StoredProcedure, pms); }
/// <summary> /// 执行存储过生成材料计划 /// </summary> /// <param name="psv"></param> protected DataTable ExecMpCreate(ParamsMpCreate pmc) { DataTable dt; try { SqlConnection sqlConn = new SqlConnection(); SqlCommand sqlCmd = new SqlCommand(); sqlConn.ConnectionString = DBCallCommon.GetStringValue("connectionStrings"); DBCallCommon.PrepareStoredProc(sqlConn, sqlCmd, "[PRO_TM_OutCreate]"); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@Engid", pmc.Engid, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@Engtype", pmc.Engtype, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@MpChange", pmc.MpChange, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@Mpno", pmc.Mpno, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@MpType", pmc.MpType, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@Pjid", pmc.Pjid, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@StrWhere", pmc.StrWhere, SqlDbType.Text, 3000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@TableName", pmc.TableName, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@OrgTable", pmc.OrgTable, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@Userid", pmc.Userid, SqlDbType.Text, 1000); sqlConn.Open(); sqlCmd.CommandTimeout = 1000; ////sqlCmd.ExecuteNonQuery(); dt = DBCallCommon.GetDataTableUsingCmd(sqlCmd); sqlConn.Close(); } catch (Exception) { throw; } return(dt); }
/// <summary> /// 执行存储过程验证序号(保存时) /// </summary> /// <param name="psv"></param> private void ExecImport(ParamsImport psv) { try { SqlConnection sqlConn = new SqlConnection(); SqlCommand sqlCmd = new SqlCommand(); sqlConn.ConnectionString = DBCallCommon.GetStringValue("connectionStrings"); DBCallCommon.PrepareStoredProc(sqlConn, sqlCmd, "[PRO_TM_ImportDataAll_Modify]"); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@Tg_TableName", psv.Tg_TableName, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@Tg_Engid", psv.Tg_Engid, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@Tg_FatherIndex", psv.Tg_FatherIndex, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@Tg_TotalTaishu", psv.Tg_TotalTaishu, SqlDbType.Int, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@Src_TableName", psv.Src_TableName, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@Src_Engid", psv.Src_Engid, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@Src_FatherIndex", psv.Src_FatherIndex, SqlDbType.Text, 1000); //////DBCallCommon.AddParameterToStoredProc(sqlCmd, "@Sc_TotalTaishu", psv.Sc_TotalTaishu, SqlDbType.Int, 1000); // DBCallCommon.AddParameterToStoredProc(sqlCmd, "@Coype_Type", psv.Coype_Type, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@Bef_RepTuhao_1", psv.Bef_RepTuhao_1, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@Aft_RepTuhao_1", psv.Aft_RepTuhao_1, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@Bef_RepTuhao_2", psv.Bef_RepTuhao_2, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@Aft_RepTuhao_2", psv.Aft_RepTuhao_2, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@NotImport", psv.NotImport, SqlDbType.Text, 4000); sqlConn.Open(); sqlCmd.CommandTimeout = 0; sqlCmd.ExecuteNonQuery(); sqlConn.Close(); } catch (Exception) { throw; } }
private string ExecMsCreate(MSCreate mscreate) { DataTable dt; try { SqlConnection sqlConn = new SqlConnection(); SqlCommand sqlCmd = new SqlCommand(); sqlConn.ConnectionString = DBCallCommon.GetStringValue("connectionStrings"); DBCallCommon.PrepareStoredProc(sqlConn, sqlCmd, "[PRO_TM_MS_NorCreate]"); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@StrTabeleName", mscreate.StrTabeleName, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@ViewTabelName", mscreate.ViewTabelName, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@TaskID", mscreate.TaskID, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@MS_PID", mscreate.MS_PID, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@MsTableName", mscreate.MsTableName, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@MsRewTabelName", mscreate.MsRewTabelName, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@SubmitID", mscreate.SubmitID, SqlDbType.Text, 1000); sqlConn.Open(); dt = DBCallCommon.GetDataTableUsingCmd(sqlCmd); sqlConn.Close(); } catch (Exception) { return("1"); } return(dt.Rows[0][0].ToString()); }
/// <summary> /// 绑定汇总后数据(页面上汇总) /// </summary> private void GetCollList(string ddlselectedType) { this.InitList(); string sql_select_type = "select MP_MASHAPE from " + mptable + " where MP_ID='" + mp_no.Value + "' "; string matype = "";//提交的该批材料计划类别:非定尺板、定尺板、型材、标(发运)、标(组装) SqlDataReader dr = DBCallCommon.GetDRUsingSqlText(sql_select_type); if (dr.HasRows) { dr.Read(); matype = dr["MP_MASHAPE"].ToString(); dr.Close(); } DataTable dt = new DataTable(); if (viewtable == "View_TM_MPCHANGE") //变更 { } else //正常 { try { SqlConnection sqlConn = new SqlConnection(); SqlCommand sqlCmd = new SqlCommand(); sqlConn.ConnectionString = DBCallCommon.GetStringValue("connectionStrings"); DBCallCommon.PrepareStoredProc(sqlConn, sqlCmd, "TM_MP_COLLECT"); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@Table_Name", viewtable, SqlDbType.VarChar, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@PiHao", mp_no.Value, SqlDbType.VarChar, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@WhereCon", ddlselectedType, SqlDbType.VarChar, 1000); dt = DBCallCommon.GetDataTableUsingCmd(sqlCmd); sqlConn.Close(); } catch (Exception) { throw; } } GridView2.DataSource = dt; GridView2.DataBind(); InitDataPanel(GridView2); }
public void PagerQueryParam(Statistics statistcs) { try { SqlConnection sqlConn = new SqlConnection(); SqlCommand sqlCmd = new SqlCommand(); sqlConn.ConnectionString = DBCallCommon.GetStringValue("connectionStrings"); DBCallCommon.PrepareStoredProc(sqlConn, sqlCmd, "ClaimTotal"); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@Start_Time", statistcs.StartTime, SqlDbType.DateTime, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@End_Time", statistcs.EndTime, SqlDbType.DateTime, 1000); sqlConn.Open(); sqlCmd.ExecuteNonQuery(); sqlConn.Close(); } catch (Exception) { throw; } }
/// <summary> /// 调用存储过程执行拆分 /// </summary> protected void ExecSplit() { try { SqlConnection sqlConn = new SqlConnection(); SqlCommand sqlCmd = new SqlCommand(); sqlConn.ConnectionString = DBCallCommon.GetStringValue("connectionStrings"); DBCallCommon.PrepareStoredProc(sqlConn, sqlCmd, "[PRO_TM_OrgSplitofSets]"); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@BM_XUHAO", ViewState["Xuhao"].ToString(), SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@TableName", ViewState["tablename"].ToString(), SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@BM_ENGID", ViewState["TaskID"].ToString(), SqlDbType.Text, 1000); sqlConn.Open(); sqlCmd.ExecuteNonQuery(); sqlConn.Close(); } catch (Exception) { throw; } }
private DataTable GetCurLotIncRedQutyOfMar(string bglotnum) { DataTable dt = new DataTable(); try { SqlConnection sqlConn = new SqlConnection(); SqlCommand sqlCmd = new SqlCommand(); sqlConn.ConnectionString = DBCallCommon.GetStringValue("connectionStrings"); DBCallCommon.PrepareStoredProc(sqlConn, sqlCmd, "PRO_TM_GetIncRedQtyOfMar"); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@Change_LotNum", bglotnum, SqlDbType.VarChar, 3000); dt = DBCallCommon.GetDataTableUsingCmd(sqlCmd); sqlConn.Close(); } catch (Exception) { throw; } return(dt); }
/// <summary> /// 执行存储过程 /// </summary> /// <param name="psv"></param> private System.Data.DataTable ExecMarCheck(ParamsCheckMarNotBelongToMar psv) { System.Data.DataTable dt; try { SqlConnection sqlConn = new SqlConnection(); SqlCommand sqlCmd = new SqlCommand(); sqlConn.ConnectionString = DBCallCommon.GetStringValue("connectionStrings"); DBCallCommon.PrepareStoredProc(sqlConn, sqlCmd, "[PRO_TM_CheckMarNotBelongToMarMSBOM]"); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@StrTable", psv.StrTabeleName, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@ENG_ID", psv.TaskID, SqlDbType.Text, 1000); sqlConn.Open(); dt = DBCallCommon.GetDataTableUsingCmd(sqlCmd); sqlConn.Close(); } catch (Exception) { throw; } return(dt); }
/// <summary> /// 执行存储过程验证序号(计算时) /// </summary> /// <param name="psv"></param> private DataTable CheckTaskIDReference(string TaskID) { DataTable dt; try { SqlConnection sqlConn = new SqlConnection(); SqlCommand sqlCmd = new SqlCommand(); sqlConn.ConnectionString = DBCallCommon.GetStringValue("connectionStrings"); DBCallCommon.PrepareStoredProc(sqlConn, sqlCmd, "[PRO_TM_CheckTaskIDReference]"); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@TaskID", TaskID, SqlDbType.Text, 1000); sqlConn.Open(); dt = DBCallCommon.GetDataTableUsingCmd(sqlCmd); sqlConn.Close(); } catch (Exception) { throw; } return(dt); }
/// <summary> /// 执行存储过程验证序号(保存时) /// </summary> /// <param name="psv"></param> private DataTable ExecRetProbTable(ProbIndex probindex) { DataTable dt; try { SqlConnection sqlConn = new SqlConnection(); SqlCommand sqlCmd = new SqlCommand(); sqlConn.ConnectionString = DBCallCommon.GetStringValue("connectionStrings"); DBCallCommon.PrepareStoredProc(sqlConn, sqlCmd, "[PRO_TM_FindNoFatherIndex]"); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@StrTable", probindex.StrTabeleName, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@BM_ENGID", probindex.TaskID, SqlDbType.Text, 1000); sqlConn.Open(); dt = DBCallCommon.GetDataTableUsingCmd(sqlCmd); sqlConn.Close(); } catch (Exception) { throw; } return(dt); }
private DataTable Showsupply() { DataTable dt; try { SqlConnection sqlConn = new SqlConnection(); SqlCommand sqlCmd = new SqlCommand(); sqlConn.ConnectionString = DBCallCommon.GetStringValue("connectionStrings"); DBCallCommon.PrepareStoredProc(sqlConn, sqlCmd, "[Search_Supply]"); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@name", name, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@session", session, SqlDbType.Text, 1000); sqlConn.Open(); dt = DBCallCommon.GetDataTableUsingCmd(sqlCmd); sqlConn.Close(); } catch (Exception) { throw; } return(dt); }
/// <summary> /// 绑定存储过程 /// </summary> /// <param name="str">查询条件</param> /// <returns>返回table</returns> public static DataTable GetDataByPagerQueryParam(string str, string type, string martype) { DataTable dt = new DataTable(); try { SqlConnection sqlConn = new SqlConnection(); SqlCommand sqlCmd = new SqlCommand(); sqlConn.ConnectionString = DBCallCommon.GetStringValue("connectionStrings"); DBCallCommon.PrepareStoredProc(sqlConn, sqlCmd, "TM_MaterailTotal"); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@strWhere", str, SqlDbType.VarChar, 3000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@Type", type, SqlDbType.VarChar, 10); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@MarType", martype, SqlDbType.VarChar, 20); dt = DBCallCommon.GetDataTableUsingCmd(sqlCmd); sqlConn.Close(); } catch (Exception) { throw; } return(dt); }
private DataTable UseProc(string viewtable, string taskId, string whereCon) { DataTable dt = new DataTable(); try { SqlConnection sqlConn = new SqlConnection(); SqlCommand sqlCmd = new SqlCommand(); sqlConn.ConnectionString = DBCallCommon.GetStringValue("connectionStrings"); DBCallCommon.PrepareStoredProc(sqlConn, sqlCmd, "TM_MPCHANGE_COLLECT"); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@Table_Name", viewtable, SqlDbType.VarChar, 1000); //DBCallCommon.AddParameterToStoredProc(sqlCmd, "@TaskId", taskId, SqlDbType.VarChar, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@WhereCon", whereCon, SqlDbType.VarChar, 1000); dt = DBCallCommon.GetDataTableUsingCmd(sqlCmd); sqlConn.Close(); } catch (Exception) { throw; } return(dt); }
protected DataTable ExecWgtKuCheck(string taskid, string xuhao, string jishu) { DataTable dt = null; try { SqlConnection sqlConn = new SqlConnection(); SqlCommand sqlCmd = new SqlCommand(); sqlConn.ConnectionString = DBCallCommon.GetStringValue("connectionStrings"); DBCallCommon.PrepareStoredProc(sqlConn, sqlCmd, "[PRO_TM_WeightKuCheck]"); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@TaskID", taskid, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@BM_XUHAO", xuhao, SqlDbType.Text, 1000); DBCallCommon.AddParameterToStoredProc(sqlCmd, "@BM_Jishu", jishu, SqlDbType.Text, 1000); sqlConn.Open(); dt = DBCallCommon.GetDataTableUsingCmd(sqlCmd); sqlConn.Close(); } catch (Exception) { ; } return(dt); }