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> 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 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); }
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()); }
protected void deletebt_Click(object sender, EventArgs e) { Dfinddept1.SelectedValue = "00"; Dfinddept2.SelectedValue = "00"; Radiogrouportw.Visible = false; //隐藏 Radiogrouportw.SelectedValue = "1"; //默认为岗位/班组 DataTable dt = null; SqlConnection sqlConn = new SqlConnection(); sqlConn.ConnectionString = DBCallCommon.GetStringValue("connectionStrings"); DBCallCommon.openConn(sqlConn); SqlCommand sqlCmd = new SqlCommand();//选择用 sqlCmd.Connection = sqlConn; SqlCommand sqlCmd1 = new SqlCommand();//删除用 sqlCmd1.Connection = sqlConn; string cannotstr; foreach (RepeaterItem e_id in tbds_depinfoRepeater.Items) { CheckBox chk = (CheckBox)e_id.FindControl("checkboxdep"); if (chk.Checked) { cannotstr = ((Label)e_id.FindControl("DEP_CODE")).Text; #region //查找对象 if (Radiogrouportw.SelectedValue == "0") { sqlCmd.CommandText = "select * from TBDS_STAFFINFO where ST_JOBCAT LIKE '" + cannotstr + "%'"; sqlCmd1.CommandText = "delete from TBDS_JOBCATINFO where JC_ID LIKE '" + cannotstr + "%'"; } else { sqlCmd.CommandText = "select * from TBDS_STAFFINFO where ST_DEPID LIKE '" + cannotstr + "%'"; sqlCmd1.CommandText = "delete from TBDS_DEPINFO where DEP_CODE LIKE '" + cannotstr + "%'"; } #endregion dt = DBCallCommon.GetDataTableUsingCmd(sqlCmd); if (dt.Rows.Count > 0) { Lnumber.Text = Convert.ToString(dt.Rows.Count); Response.Write("<script>alert('编码为" + cannotstr + "下有人员,不能删除,若想删除,请删除该编码下的所有人员!');</script>"); } else { sqlCmd1.ExecuteNonQuery();//执行删除操作 } } } UCPaging1.CurrentPage = 1; databind(); DBCallCommon.closeConn(sqlConn); }
/// <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); }
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 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 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 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); }