/// <summary> /// 获取单号 /// </summary> /// <returns></returns> public string getOddNum( ) { StringBuilder strSql = new StringBuilder( ); strSql.Append("SELECT MAX(QUO001) QUO001 FROM R_QUO"); DataTable dt = SqlHelper.ExecuteDataTable(strSql.ToString( )); if (dt != null && dt.Rows.Count > 0) { string odd = dt.Rows [0] ["QUO001"].ToString( ); if (string.IsNullOrEmpty(odd)) { return("R_504-" + Drity.GetDt( ).ToString("yyyyMMdd") + "0001"); } else { if (odd.Substring(6, 8).Equals(Drity.GetDt( ).ToString("yyyyMMdd"))) { return("R_504-" + (Convert.ToInt64(odd.Substring(6, odd.Length - 6)) + 1).ToString( )); } else { return("R_504-" + Drity.GetDt( ).ToString("yyyyMMdd") + "0001"); } } } else { return("R_504-" + Drity.GetDt( ).ToString("yyyyMMdd") + "0001"); } }
/// <summary> /// 获取单号 /// </summary> /// <returns></returns> public string getCode( ) { StringBuilder strSql = new StringBuilder( ); strSql.Append("SELECT MAX(INA001) INA001 FROM R_INA"); DataTable table = SqlHelper.ExecuteDataTable(strSql.ToString( )); DateTime dt = Drity.GetDt( ); if (table == null || table.Rows.Count < 1) { return(dt.ToString("yyyyMMdd") + "001"); } else { string code = table.Rows [0] ["INA001"].ToString( ); if (string.IsNullOrEmpty(code)) { return(dt.ToString("yyyyMMdd") + "001"); } else if (code.Substring(0, 8).Equals(dt.ToString("yyyyMMdd"))) { return((Convert.ToInt64(code) + 1).ToString( )); } else { return(dt.ToString("yyyyMMdd") + "001"); } } }
/// <summary> /// 获取新的单号 /// </summary> /// <returns></returns> string getOdd( ) { StringBuilder strSql = new StringBuilder( ); strSql.AppendFormat("SELECT MAX(CA001) CA001 FROM R_PQCA "); DataTable dt = SqlHelper.ExecuteDataTable(strSql.ToString( )); if (dt != null && dt.Rows.Count > 0) { if (string.IsNullOrEmpty(dt.Rows [0] ["CA001"].ToString( ))) { return("R_376-" + Drity.GetDt( ).ToString("yyyyMMdd") + "001"); } else { if (dt.Rows [0] ["CA001"].ToString( ).Substring(6, 8).Equals(Drity.GetDt( ).ToString("yyyyMMdd"))) { return("R_376-" + (Convert.ToInt64(dt.Rows [0] ["CA001"].ToString( ).Substring(6, 11)) + 1).ToString( )); } else { return("R_376-" + Drity.GetDt( ).ToString("yyyyMMdd") + "001"); } } } else { return("R_376-" + Drity.GetDt( ).ToString("yyyyMMdd") + "001"); } }
/// <summary> /// get max oddNum from r_pqch /// </summary> /// <returns></returns> public string getOddNum( ) { StringBuilder strSql = new StringBuilder( ); strSql.Append("SELECT MAX(CN001) CN001 FROM R_PQCN "); strSql.AppendFormat("WHERE CN001 LIKE 'R_044-{0}%'", Drity.GetDt( ).ToString("yyyyMMdd")); DataTable dt = SqlHelper.ExecuteDataTable(strSql.ToString( )); if (dt != null && dt.Rows.Count > 0) { string oddNum = dt.Rows [0] ["CN001"].ToString( ); if (string.IsNullOrEmpty(oddNum)) { return("R_044-" + Drity.GetDt( ).ToString("yyyyMMdd") + "0001"); } else { oddNum = "R_044-" + (Convert.ToInt64(oddNum.Substring(6, 12)) + 1).ToString( ); return(oddNum); } } else { return("R_044-" + Drity.GetDt( ).ToString("yyyyMMdd") + "0001"); } }
public bool delete(string oddNum, string logins) { Hashtable SQLString = new Hashtable( ); StringBuilder strSql = new StringBuilder( ); strSql.AppendFormat("DELETE FROM R_PQL WHERE HT64='{0}'", oddNum); SQLString.Add(strSql, null); SQLString.Add(Drity.DrityOfComparation("R_021", "合同评审表(R_021)", logins, Drity.GetDt( ), oddNum, strSql.ToString( ).Replace("'", "''"), "删除", "取消删除"), null); return(SqlHelper.ExecuteSqlTran(SQLString)); }
public bool delete(string logins) { ArrayList SQLString = new ArrayList( ); StringBuilder strSql = new StringBuilder( ); strSql.Append("DELETE FROM R_PQL WHERE HT04='' AND HT04 IS NULL"); SQLString.Add(strSql.ToString( )); SQLString.Add(Drity.DrityOfComparation("R_021", "合同评审表(R_021)", logins, Drity.GetDt( ), "", strSql.ToString( ).Replace("'", "''"), "删除", "删除空白")); return(SqlHelper.ExecuteSqlTran(SQLString)); }
public FormQuotation( ) { InitializeComponent( ); _bll = new MulaolaoBll.Bll.QuoBll( ); _quo = new MulaolaoLibrary.QuoEntity( ); _qup = new MulaolaoLibrary.QupEntity( ); controlUnEnable( ); InitData( ); GridViewMoHuSelect.SetFilter(new DevExpress.XtraGrid.Views.Grid.GridView [] { gridView1, ViewFor }); GrivColumnStyle.setColumnStyle(new DevExpress.XtraGrid.Views.Grid.GridView [] { gridView1, ViewFor }); dt = Drity.GetDt( ); }
public bool Delete(MulaolaoLibrary.ContractreviewEntity _mode, string logins) { ArrayList SQLString = new ArrayList( ); StringBuilder strSql = new StringBuilder( ); strSql.AppendFormat("DELETE FROM R_PQL WHERE idx={0}", _mode.idx); SQLString.Add(strSql.ToString( )); SQLString.Add(Drity.DrityOfComparation("R_021", "合同评审表(R_021)", logins, Drity.GetDt( ), _mode.HT64, strSql.ToString( ).Replace("'", "''"), "删除", "删除")); strSql = new StringBuilder( ); strSql.AppendFormat("UPDATE R_PQF SET PQF25='{0}' WHERE PQF01='{1}'", _mode.HT07, _mode.HT01); SQLString.Add(strSql.ToString( )); SQLString.Add(Drity.DrityOfComparation("R_021", "合同评审表(R_021)", logins, Drity.GetDt( ), _mode.HT64, strSql.ToString( ).Replace("'", "''"), "删除", "删除编辑001PQF25字段")); return(SqlHelper.ExecuteSqlTran(SQLString)); }
public bool Delete(string oddNum, string tableName, string logins) { ArrayList SQLString = new ArrayList( ); StringBuilder strSql = new StringBuilder( ); strSql.AppendFormat("DELETE FROM R_PQL WHERE HT64='{0}'", oddNum); SQLString.Add(strSql.ToString( )); SQLString.Add(Drity.DrityOfComparation("R_021", "合同评审表(R_021)", logins, Drity.GetDt( ), oddNum, strSql.ToString( ).Replace("'", "''"), "删除", "删除")); strSql = new StringBuilder( ); strSql.AppendFormat("DELETE FROM R_REVIEWS WHERE RES01=(SELECT CX01 FROM R_MLLCXMC WHERE CX02='{0}') AND RES06='{1}'", tableName, oddNum); SQLString.Add(strSql.ToString( )); SQLString.Add(Drity.DrityOfComparation("R_021", "合同评审表(R_021)", logins, Drity.GetDt( ), oddNum, strSql.ToString( ).Replace("'", "''"), "删除", "删除送审内容")); return(SqlHelper.ExecuteSqlTran(SQLString)); }
public bool Insert(MulaolaoLibrary.ContractreviewEntity _mode, string logins) { ArrayList SQLString = new ArrayList( ); StringBuilder strSql = new StringBuilder( ); strSql.AppendFormat("INSERT INTO R_PQL (HT64,HT01,HT02,HT07,HT65,HT66) VALUES ('{0}','{1}','{2}','{3}','{4}','{5}')", _mode.HT64, _mode.HT01, _mode.HT02, _mode.HT07, _mode.HT65, _mode.HT66); SQLString.Add(strSql.ToString( )); SQLString.Add(Drity.DrityOfComparation("R_021", "合同评审表(R_021)", logins, Drity.GetDt( ), _mode.HT64, strSql.ToString( ).Replace("'", "''"), "新建", "新建")); strSql = new StringBuilder( ); strSql.AppendFormat("UPDATE R_PQF SET PQF25='{0}',PQF17='{1}',PQF66='{2}' WHERE PQF01='{3}'", _mode.HT07, _mode.HT65, _mode.HT66, _mode.HT01); SQLString.Add(strSql.ToString( )); SQLString.Add(Drity.DrityOfComparation("R_021", "合同评审表(R_021)", logins, Drity.GetDt( ), _mode.HT64, strSql.ToString( ).Replace("'", "''"), "新建", "更改001生产车间")); strSql = new StringBuilder( ); strSql.AppendFormat("UPDATE R_PQAE SET AE08='{0}' WHERE AE02='{1}'", _mode.HT66, _mode.HT01); SQLString.Add(strSql.ToString( )); SQLString.Add(Drity.DrityOfComparation("R_021", "合同评审表(R_021)", logins, Drity.GetDt( ), _mode.HT64, strSql.ToString( ).Replace("'", "''"), "新建", "更改001生产车间")); return(SqlHelper.ExecuteSqlTran(SQLString)); }
public bool Update(MulaolaoLibrary.ContractreviewEntity _mode, string logins) { ArrayList SQLString = new ArrayList( ); StringBuilder strSql = new StringBuilder( ); strSql.AppendFormat("UPDATE R_PQL SET HT01='{0}',HT07='{1}',HT65='{2}',HT66='{3}' WHERE idx={4}", _mode.HT01, _mode.HT07, _mode.HT65, _mode.HT66, _mode.idx); SQLString.Add(strSql.ToString( )); SQLString.Add(Drity.DrityOfComparation("R_021", "合同评审表(R_021)", logins, Drity.GetDt( ), _mode.HT64, strSql.ToString( ).Replace("'", "''"), "编辑", "编辑流水等")); strSql = new StringBuilder( ); strSql.AppendFormat("UPDATE R_PQF SET PQF25='{0}',PQF17='{1}',PQF66='{2}' WHERE PQF01='{3}'", _mode.HT07, _mode.HT65, _mode.HT66, _mode.HT01); SQLString.Add(strSql.ToString( )); SQLString.Add(Drity.DrityOfComparation("R_021", "合同评审表(R_021)", logins, Drity.GetDt( ), _mode.HT64, strSql.ToString( ).Replace("'", "''"), "编辑", "编辑流水等")); strSql = new StringBuilder( ); strSql.AppendFormat("UPDATE R_PQAE SET AE08='{0}' WHERE AE02='{1}'", _mode.HT66, _mode.HT01); SQLString.Add(strSql.ToString( )); SQLString.Add(Drity.DrityOfComparation("R_021", "合同评审表(R_021)", logins, Drity.GetDt( ), _mode.HT64, strSql.ToString( ).Replace("'", "''"), "编辑", "编辑流水等")); return(SqlHelper.ExecuteSqlTran(SQLString)); }
/// <summary> /// delete data from r_pqcu and r_pqcv and write operation to r_pqbf /// </summary> /// <param name="oddNum"></param> /// <param name="logins"></param> /// <returns></returns> public bool Delete(string oddNum, string logins) { ArrayList SQLString = new ArrayList( ); StringBuilder strSql = new StringBuilder( ); strSql.Append("DELETE FROM R_PQDA "); strSql.AppendFormat("WHERE DA001='{0}'", oddNum); SQLString.Add(strSql.ToString( )); SQLString.Add(Drity.DrityOfComparation("R_142", "QA测试报告(R_142)", logins, Drity.GetDt( ), oddNum, strSql.ToString( ).Replace("'", "''"), "删除", "删除")); strSql = new StringBuilder( ); strSql.Append("DELETE FROM R_PQDB "); strSql.AppendFormat("WHERE DB001='{0}'", oddNum); SQLString.Add(strSql.ToString( )); SQLString.Add(Drity.DrityOfComparation("R_142", "QA测试报告(R_142)", logins, Drity.GetDt( ), oddNum, strSql.ToString( ).Replace("'", "''"), "删除", "删除")); strSql = new StringBuilder( ); strSql.Append("DELETE FROM R_REVIEWS "); strSql.AppendFormat("WHERE RES06='{0}'", oddNum); SQLString.Add(strSql.ToString( )); SQLString.Add(Drity.DrityOfComparation("R_142", "QA测试报告(R_142)", logins, Drity.GetDt( ), oddNum, strSql.ToString( ).Replace("'", "''"), "删除", "删除")); return(SqlHelper.ExecuteSqlTran(SQLString)); }
/// <summary> /// delete data from r_pqn,r_pqna,r_reviews /// </summary> /// <param name="oddNum"></param> /// <param name="logins"></param> /// <param name="stateOdd"></param> /// <returns></returns> public bool Delete(string oddNum, string logins) { ArrayList SQLString = new ArrayList( ); StringBuilder strSql = new StringBuilder( ); strSql.AppendFormat("DELETE FROM R_REVIEWS WHERE RES06='{0}'", oddNum); SQLString.Add(strSql.ToString( )); SQLString.Add(Drity.DrityOfComparation("R_369", "客户信息传递记录表(R_369)", logins, Drity.GetDt( ), oddNum, strSql.ToString( ).Replace("'", "''"), "删除", "删除送审")); strSql = new StringBuilder( ); strSql.AppendFormat("DELETE FROM R_PQN WHERE KH01='{0}'", oddNum); SQLString.Add(strSql.ToString( )); SQLString.Add(Drity.DrityOfComparation("R_369", "客户信息传递记录表(R_369)", logins, Drity.GetDt( ), oddNum, strSql.ToString( ).Replace("'", "''"), "删除", "删除表头")); strSql = new StringBuilder( ); strSql.AppendFormat("DELETE FROM R_PQNA WHERE NA001='{0}'", oddNum); SQLString.Add(strSql.ToString( )); SQLString.Add(Drity.DrityOfComparation("R_369", "客户信息传递记录表(R_369)", logins, Drity.GetDt( ), oddNum, strSql.ToString( ).Replace("'", "''"), "删除", "删除表身")); return(SqlHelper.ExecuteSqlTran(SQLString)); }
/// <summary> /// edit data from r_pqcb and r_pqcc to database /// </summary> /// <param name="table"></param> /// <param name="_cb"></param> /// <param name="logins"></param> /// <param name="strList"></param> /// <returns></returns> public bool Edit(DataTable table, MulaolaoLibrary.StandardAuditTreCFEntity _cf, string logins, List <string> strList) { Hashtable SQLString = new Hashtable( ); StringBuilder strSql = new StringBuilder( ); edit_pqcf(SQLString, strSql, _cf); SQLString.Add(Drity.DrityOfComparation("R_484", "动力段生产首件量.检具审核确认记录表(R_484)", logins, Drity.GetDt( ), _cf.CF001, strSql.ToString( ).Replace("'", "''"), "编辑", "编辑"), null); MulaolaoLibrary.StandardAuditTreCGEntity _ce = new MulaolaoLibrary.StandardAuditTreCGEntity( ); _ce.CG001 = _cf.CF001; for (int i = 0; i < table.Rows.Count; i++) { _ce.CG002 = table.Rows [i] ["CG002"].ToString( ); _ce.CG003 = table.Rows [i] ["CG003"].ToString( ); _ce.CG004 = table.Rows [i] ["CG004"].ToString( ); if (string.IsNullOrEmpty(table.Rows [i] ["CG005"].ToString( ))) { _ce.CG005 = null; } else { _ce.CG005 = Convert.ToDateTime(table.Rows [i] ["CG005"]); } if (string.IsNullOrEmpty(table.Rows [i] ["CG006"].ToString( ))) { _ce.CG006 = null; } else { _ce.CG006 = Convert.ToDateTime(table.Rows [i] ["CG006"]); } _ce.CG007 = table.Rows [i] ["CG007"].ToString( ); _ce.CG008 = table.Rows [i] ["CG008"].ToString( ); _ce.CG009 = table.Rows [i] ["CG009"].ToString( ); _ce.CG010 = table.Rows [i] ["CG010"].ToString( ); _ce.CG011 = table.Rows [i] ["CG011"].ToString( ); _ce.CG012 = table.Rows [i] ["CG012"].ToString( ); _ce.CG013 = table.Rows [i] ["CG013"].ToString( ); if (string.IsNullOrEmpty(table.Rows [i] ["CG014"].ToString( ))) { _ce.CG014 = null; } else { _ce.CG014 = Convert.ToDateTime(table.Rows [i] ["CG014"]); } _ce.CG015 = table.Rows [i] ["CG015"].ToString( ); if (string.IsNullOrEmpty(table.Rows [i] ["CG016"].ToString( ))) { _ce.CG016 = null; } else { _ce.CG016 = Convert.ToDateTime(table.Rows [i] ["CG016"]); } _ce.CG017 = table.Rows [i] ["CG017"].ToString( ); if (string.IsNullOrEmpty(table.Rows [i] ["CG018"].ToString( ))) { _ce.CG018 = null; } else { _ce.CG018 = Convert.ToDateTime(table.Rows [i] ["CG018"]); } _ce.CG019 = table.Rows [i] ["CG019"].ToString( ); _ce.CG020 = table.Rows [i] ["CG020"].ToString( ); _ce.CG021 = table.Rows [i] ["CG021"].ToString( ); _ce.CG022 = table.Rows [i] ["CG022"].ToString( ); _ce.CG023 = table.Rows [i] ["CG023"].ToString( ); _ce.idx = string.IsNullOrEmpty(table.Rows [i] ["idx"].ToString( )) == true ? 0 : Convert.ToInt32(table.Rows [i] ["idx"].ToString( )); if (_ce.idx < 1) { add_pqcg(SQLString, strSql, _ce, logins); } else { edit_pqcg(SQLString, strSql, _ce, logins); } } foreach (string s in strList) { _ce.idx = Convert.ToInt32(s); delete_pqcg(SQLString, strSql, _ce, logins); } return(SqlHelper.ExecuteSqlTran(SQLString)); }
/// <summary> /// delete data from r_pqcf and r_pqcg, and write operation to r_pqbf /// </summary> /// <param name="oddNum"></param> /// <param name="logins"></param> /// <returns></returns> public bool Delete(string oddNum, string logins) { ArrayList SQLString = new ArrayList( ); StringBuilder strSql = new StringBuilder( ); strSql.Append("DELETE FROM R_PQCF "); strSql.AppendFormat("WHERE CF001='{0}'", oddNum); SQLString.Add(strSql.ToString( )); SQLString.Add(Drity.DrityOfComparation("R_484", "动力段生产首件量.检具审核确认记录表(R_484)", logins, Drity.GetDt( ), oddNum, strSql.ToString( ).Replace("'", "''"), "删除", "删除")); strSql = new StringBuilder( ); strSql.Append("DELETE FROM R_PQCG "); strSql.AppendFormat("WHERE CG001='{0}'", oddNum); SQLString.Add(strSql.ToString( )); SQLString.Add(Drity.DrityOfComparation("R_484", "动力段生产首件量.检具审核确认记录表(R_484)", logins, Drity.GetDt( ), oddNum, strSql.ToString( ).Replace("'", "''"), "删除", "删除")); strSql = new StringBuilder( ); strSql.Append("DELETE FROM R_REVIEWS "); strSql.AppendFormat("WHERE RES06='{0}'", oddNum); SQLString.Add(strSql.ToString( )); SQLString.Add(Drity.DrityOfComparation("R_484", "动力段生产首件量.检具审核确认记录表(R_484)", logins, Drity.GetDt( ), oddNum, strSql.ToString( ).Replace("'", "''"), "删除", "删除")); return(SqlHelper.ExecuteSqlTran(SQLString)); }
/// <summary> /// save data to r_pqcb and r_pqcc /// </summary> /// <param name="table"></param> /// <param name="_cb"></param> /// <returns></returns> public bool Save(DataTable table, MulaolaoLibrary.StandardAuditForCHEntity _cf, string logins) { Hashtable SQLString = new Hashtable( ); StringBuilder strSql = new StringBuilder( ); _cf.CH001 = getOddNum( ); add_pqcf(SQLString, strSql, _cf); SQLString.Add(Drity.DrityOfComparation("R_487", "包装首件标准样审核确认记录表(R_487)", logins, Drity.GetDt( ), _cf.CH001, strSql.ToString( ).Replace("'", "''"), "新增", "新增"), null); MulaolaoLibrary.StandardAuditForCIEntity _ce = new MulaolaoLibrary.StandardAuditForCIEntity( ); _ce.CI001 = _cf.CH001; for (int i = 0; i < table.Rows.Count; i++) { _ce.CI002 = table.Rows [i] ["CI002"].ToString( ); _ce.CI003 = table.Rows [i] ["CI003"].ToString( ); _ce.CI004 = table.Rows [i] ["CI004"].ToString( ); if (string.IsNullOrEmpty(table.Rows [i] ["CI005"].ToString( ))) { _ce.CI005 = null; } else { _ce.CI005 = Convert.ToDateTime(table.Rows [i] ["CI005"]); } if (string.IsNullOrEmpty(table.Rows [i] ["CI006"].ToString( ))) { _ce.CI006 = null; } else { _ce.CI006 = Convert.ToDateTime(table.Rows [i] ["CI006"]); } _ce.CI007 = table.Rows [i] ["CI007"].ToString( ); _ce.CI008 = table.Rows [i] ["CI008"].ToString( ); _ce.CI009 = table.Rows [i] ["CI009"].ToString( ); _ce.CI010 = table.Rows [i] ["CI010"].ToString( ); _ce.CI011 = table.Rows [i] ["CI011"].ToString( ); _ce.CI012 = table.Rows [i] ["CI012"].ToString( ); _ce.CI013 = table.Rows [i] ["CI013"].ToString( ); if (string.IsNullOrEmpty(table.Rows [i] ["CI014"].ToString( ))) { _ce.CI014 = null; } else { _ce.CI014 = Convert.ToDateTime(table.Rows [i] ["CI014"]); } _ce.CI015 = table.Rows [i] ["CI015"].ToString( ); if (string.IsNullOrEmpty(table.Rows [i] ["CI016"].ToString( ))) { _ce.CI016 = null; } else { _ce.CI016 = Convert.ToDateTime(table.Rows [i] ["CI016"]); } _ce.CI017 = table.Rows [i] ["CI017"].ToString( ); if (string.IsNullOrEmpty(table.Rows [i] ["CI018"].ToString( ))) { _ce.CI018 = null; } else { _ce.CI018 = Convert.ToDateTime(table.Rows [i] ["CI018"]); } if (string.IsNullOrEmpty(table.Rows [i] ["CI019"].ToString( ))) { _ce.CI019 = null; } else { _ce.CI019 = Convert.ToInt32(table.Rows [i] ["CI019"]); } _ce.CI020 = table.Rows [i] ["CI020"].ToString( ); _ce.CI021 = table.Rows [i] ["CI021"].ToString( ); _ce.CI024 = string.IsNullOrEmpty(table.Rows [i] ["CI024"].ToString( )) == true ? 0 : Convert.ToInt32(table.Rows [i] ["CI024"].ToString( )); add_pqcg(SQLString, strSql, _ce, logins); } return(SqlHelper.ExecuteSqlTran(SQLString)); }
/// <summary> /// 复制数据 /// </summary> /// <param name="oddNum"></param> /// <param name="logins"></param> /// <returns></returns> public string copy(string oddNum, string logins) { ArrayList SQLString = new ArrayList( ); StringBuilder strSql = new StringBuilder( ); strSql.AppendFormat("INSERT INTO R_PQDK (DK002,DK003,DK004,DK005,DK006,DK007,DK008,DK009,DK010,DK011,DK012,DK013,DK014,DK015,DK016,DK017,DK018,DK019,DK020,DK021,DK022,DK023,DK024,DK025,DK026,DK027,DK028,DK029,DK030,DK031,DK032,DK033,DK034,DK035,DK036,DK037,DK038,DK039) SELECT DK002,DK003,DK004,DK005,DK006,DK007,DK008,DK009,DK010,DK011,DK012,DK013,DK014,DK015,DK016,DK017,DK018,DK019,DK020,DK021,DK022,DK023,DK024,DK025,DK026,DK027,DK028,DK029,DK030,DK031,DK032,DK033,DK034,DK035,DK036,DK037,DK038,DK039 FROM R_PQDK WHERE DK001='{0}' ", oddNum); SQLString.Add(strSql.ToString( )); SQLString.Add(Drity.DrityOfComparation("R_293", "客检产品质量报告(R_293)", logins, Drity.GetDt( ), oddNum, strSql.ToString( ).Replace("'", "''"), "复制", "复制")); strSql = new StringBuilder( ); string odN = getOddNum( ); strSql.AppendFormat("UPDATE R_PQDK SET DK001='{0}' WHERE DK001 IS NULL", odN); SQLString.Add(strSql.ToString( )); SQLString.Add(Drity.DrityOfComparation("R_293", "客检产品质量报告(R_293)", logins, Drity.GetDt( ), odN, strSql.ToString( ).Replace("'", "''"), "复制", "复制")); if (SqlHelper.ExecuteSqlTran(SQLString)) { return(odN); } else { return(string.Empty); } }
/// <summary> /// save data to databse /// </summary> /// <param name="table">单身</param> /// <param name="_cr">单头</param> /// <param name="tableOne">系数</param> /// <param name="coeList">系数删除</param> /// <param name="bodyList">单身删除</param> /// <param name="logins">登录人</param> /// <returns></returns> public bool Save(DataTable table, MulaolaoLibrary.TestResultRecordCREntity _cr, DataTable tableOne, List <string> coeList, List <string> bodyList, string logins) { Hashtable SQLString = new Hashtable( ); StringBuilder strSql = new StringBuilder( ); if (_cr.idx < 1) { _cr.CR001 = getOddNum( ); add_cr(SQLString, strSql, _cr); SQLString.Add(Drity.DrityOfComparation("R_418", "产品粘接、组装人员牢固度安全常态抽测结果记录(R_418)", logins, Drity.GetDt( ), _cr.CR001, strSql.ToString( ).Replace("'", "''"), "新增", "新增表头"), null); } else { edit_cr(SQLString, strSql, _cr); SQLString.Add(Drity.DrityOfComparation("R_418", "产品粘接、组装人员牢固度安全常态抽测结果记录(R_418)", logins, Drity.GetDt( ), _cr.CR001, strSql.ToString( ).Replace("'", "''"), "编辑", "编辑表头"), null); } MulaolaoLibrary.TestResultRecordCSEntity _cs = new MulaolaoLibrary.TestResultRecordCSEntity( ); _cs.CS001 = _cr.CR001; for (int i = 0; i < table.Rows.Count; i++) { if (string.IsNullOrEmpty(table.Rows [i] ["CS002"].ToString( ))) { _cs.CS002 = null; } else { _cs.CS002 = Convert.ToDateTime(table.Rows [i] ["CS002"].ToString( )); } _cs.CS003 = table.Rows [i] ["CS003"].ToString( ); _cs.CS004 = table.Rows [i] ["CS004"].ToString( ); _cs.CS005 = table.Rows [i] ["CS005"].ToString( ); if (string.IsNullOrEmpty(table.Rows [i] ["CS006"].ToString( ))) { _cs.CS006 = null; } else { _cs.CS006 = Convert.ToDateTime(table.Rows [i] ["CS006"].ToString( )); } _cs.CS007 = string.IsNullOrEmpty(table.Rows [i] ["CS007"].ToString( )) == true ? 0 : Convert.ToInt32(table.Rows [i] ["CS007"].ToString( )); _cs.CS008 = string.IsNullOrEmpty(table.Rows [i] ["CS008"].ToString( )) == true ? 0 : Convert.ToInt32(table.Rows [i] ["CS008"].ToString( )); _cs.CS009 = table.Rows [i] ["CS009"].ToString( ); _cs.CS010 = table.Rows [i] ["CS010"].ToString( ); _cs.CS011 = table.Rows [i] ["CS011"].ToString( ); _cs.idx = string.IsNullOrEmpty(table.Rows [i] ["idx"].ToString( )) == true ? 0 : Convert.ToInt32(table.Rows [i] ["idx"].ToString( )); if (_cs.idx < 1) { add_cs(SQLString, strSql, _cs); SQLString.Add(Drity.DrityOfComparation("R_418-" + i, "产品粘接、组装人员牢固度安全常态抽测结果记录(R_418)", logins, Drity.GetDt( ), _cr.CR001, strSql.ToString( ).Replace("'", "''"), "新增", "新增单身"), null); } else { edit_cs(SQLString, strSql, _cs); SQLString.Add(Drity.DrityOfComparation("R_418-" + i, "产品粘接、组装人员牢固度安全常态抽测结果记录(R_418)", logins, Drity.GetDt( ), _cr.CR001, strSql.ToString( ).Replace("'", "''"), "新增", "编辑单身"), null); } } if (bodyList.Count > 0) { foreach (string s in bodyList) { delete_cs(SQLString, strSql, _cs); SQLString.Add(Drity.DrityOfComparation("R_418-" + s, "产品粘接、组装人员牢固度安全常态抽测结果记录(R_418)", logins, Drity.GetDt( ), _cr.CR001, strSql.ToString( ).Replace("'", "''"), "新增", "删除单身"), null); } } MulaolaoLibrary.TestResultRecordCTEntity _ct = new MulaolaoLibrary.TestResultRecordCTEntity( ); for (int i = 0; i < tableOne.Rows.Count; i++) { _ct.CT001 = tableOne.Rows [i] ["CT001"].ToString( ); _ct.CT002 = tableOne.Rows [i] ["CT002"].ToString( ); _ct.CT003 = tableOne.Rows [i] ["CT003"].ToString( ); _ct.CT004 = tableOne.Rows [i] ["CT004"].ToString( ); _ct.CT005 = tableOne.Rows [i] ["CT005"].ToString( ); _ct.CT006 = tableOne.Rows [i] ["CT006"].ToString( ); _ct.CT007 = tableOne.Rows [i] ["CT007"].ToString( ); _ct.CT009 = tableOne.Rows [i] ["CT009"].ToString( ); _ct.CT010 = tableOne.Rows [i] ["CT010"].ToString( ); _ct.CT011 = tableOne.Rows [i] ["CT011"].ToString( ); _ct.CT012 = tableOne.Rows [i] ["CT012"].ToString( ); _ct.CT013 = tableOne.Rows [i] ["CT013"].ToString( ); _ct.CT014 = tableOne.Rows [i] ["CT014"].ToString( ); _ct.idx = string.IsNullOrEmpty(tableOne.Rows [i] ["idx"].ToString( )) == true ? 0 : Convert.ToInt32(tableOne.Rows [i] ["idx"].ToString( )); if (_ct.idx < 1) { add_ct(SQLString, strSql, _ct); SQLString.Add(Drity.DrityOfComparation("R_418-" + i, "产品粘接、组装人员牢固度安全常态抽测结果记录(R_418)", logins, Drity.GetDt( ), _cr.CR001, strSql.ToString( ).Replace("'", "''"), "新增", "新增系数"), null); } else { edit_ct(SQLString, strSql, _ct); SQLString.Add(Drity.DrityOfComparation("R_418-" + i, "产品粘接、组装人员牢固度安全常态抽测结果记录(R_418)", logins, Drity.GetDt( ), _cr.CR001, strSql.ToString( ).Replace("'", "''"), "新增", "编辑系数"), null); } } if (coeList.Count > 0) { foreach (string s in coeList) { _ct.idx = Convert.ToInt32(s); delete_dt(SQLString, strSql, _ct); SQLString.Add(Drity.DrityOfComparation("R_418-" + s, "产品粘接、组装人员牢固度安全常态抽测结果记录(R_418)", logins, Drity.GetDt( ), _cr.CR001, strSql.ToString( ).Replace("'", "''"), "新增", "删除系数"), null); } } return(SqlHelper.ExecuteSqlTran(SQLString)); }
/// <summary> /// save data to r_pqcv r_pqcu r_pqcw /// </summary> /// <param name="tableOnt"></param> /// <param name="tableTwo"></param> /// <param name="_cv"></param> /// <param name="bodyList"></param> /// <param name="coeList"></param> /// <param name="logins"></param> /// <returns></returns> public bool Save(DataTable tableOnt, DataTable tableTwo, MulaolaoLibrary.TestResultRecordOneCVEntity _cv, List <string> bodyList, List <string> coeList, string logins) { Hashtable SQLString = new Hashtable( ); StringBuilder strSql = new StringBuilder( ); if (_cv.idx < 1) { _cv.CV001 = getOddNum( ); add_cv(SQLString, strSql, _cv); SQLString.Add(Drity.DrityOfComparation("R_368", "粘接(R_368)", logins, Drity.GetDt( ), _cv.CV001, strSql.ToString( ).Replace("'", "''"), "新增", "新增表头"), null); } else { edit_cv(SQLString, strSql, _cv); SQLString.Add(Drity.DrityOfComparation("R_368", "粘接(R_368)", logins, Drity.GetDt( ), _cv.CV001, strSql.ToString( ).Replace("'", "''"), "编辑", "编辑表头"), null); } MulaolaoLibrary.TestResultRecordOneCUEntity model = new MulaolaoLibrary.TestResultRecordOneCUEntity( ); model.CU001 = _cv.CV001; for (int i = 0; i < tableOnt.Rows.Count; i++) { model.CU002 = tableOnt.Rows [i] ["CU002"].ToString( ); model.CU003 = tableOnt.Rows [i] ["CU003"].ToString( ); model.CU004 = tableOnt.Rows [i] ["CU004"].ToString( ); if (string.IsNullOrEmpty(tableOnt.Rows [i] ["CU005"].ToString( ))) { model.CU005 = null; } else { model.CU005 = Convert.ToDateTime(tableOnt.Rows [i] ["CU005"].ToString( )); } if (string.IsNullOrEmpty(tableOnt.Rows [i] ["CU006"].ToString( ))) { model.CU006 = null; } else { model.CU006 = Convert.ToDateTime(tableOnt.Rows [i] ["CU006"].ToString( )); } model.CU007 = tableOnt.Rows [i] ["CU007"].ToString( ); model.CU008 = tableOnt.Rows [i] ["CU008"].ToString( ); if (string.IsNullOrEmpty(tableOnt.Rows [i] ["CU009"].ToString( ))) { model.CU009 = null; } else { model.CU009 = Convert.ToDateTime(tableOnt.Rows [i] ["CU009"].ToString( )); } model.CU010 = tableOnt.Rows [i] ["CU010"].ToString( ); model.CU028 = tableOnt.Rows [i] ["CU028"].ToString( ); if (string.IsNullOrEmpty(tableOnt.Rows [i] ["CU011"].ToString( ))) { model.CU011 = null; } else { model.CU011 = Convert.ToDateTime(tableOnt.Rows [i] ["CU011"].ToString( )); } model.CU012 = tableOnt.Rows [i] ["CU012"].ToString( ); model.CU013 = tableOnt.Rows [i] ["CU013"].ToString( ); if (string.IsNullOrEmpty(tableOnt.Rows [i] ["CU014"].ToString( ))) { model.CU014 = null; } else { model.CU014 = Convert.ToDateTime(tableOnt.Rows [i] ["CU014"].ToString( )); } model.CU015 = tableOnt.Rows [i] ["CU015"].ToString( ); model.CU016 = tableOnt.Rows [i] ["CU016"].ToString( ); if (string.IsNullOrEmpty(tableOnt.Rows [i] ["CU017"].ToString( ))) { model.CU017 = null; } else { model.CU017 = Convert.ToDateTime(tableOnt.Rows [i] ["CU017"].ToString( )); } model.CU018 = tableOnt.Rows [i] ["CU018"].ToString( ); model.CU019 = tableOnt.Rows [i] ["CU019"].ToString( ); if (string.IsNullOrEmpty(tableOnt.Rows [i] ["CU020"].ToString( ))) { model.CU020 = null; } else { model.CU020 = Convert.ToDateTime(tableOnt.Rows [i] ["CU020"].ToString( )); } model.CU021 = tableOnt.Rows [i] ["CU021"].ToString( ); model.CU022 = tableOnt.Rows [i] ["CU022"].ToString( ); if (string.IsNullOrEmpty(tableOnt.Rows [i] ["CU023"].ToString( ))) { model.CU023 = null; } else { model.CU023 = Convert.ToDateTime(tableOnt.Rows [i] ["CU023"].ToString( )); } model.CU024 = tableOnt.Rows [i] ["CU024"].ToString( ); model.CU025 = tableOnt.Rows [i] ["CU025"].ToString( ); model.CU026 = tableOnt.Rows [i] ["CU026"].ToString( ); model.CU027 = tableOnt.Rows [i] ["CU027"].ToString( ); model.idx = string.IsNullOrEmpty(tableOnt.Rows [i] ["idx"].ToString( )) == true ? 0 : Convert.ToInt32(tableOnt.Rows [i] ["idx"].ToString( )); if (model.idx < 1) { add_cu(SQLString, strSql, model); SQLString.Add(Drity.DrityOfComparation("R_368-" + i, "粘接(R_368)", logins, Drity.GetDt( ), model.CU001, strSql.ToString( ).Replace("'", "''"), "新增", "新增单身"), null); } else { edit_cu(SQLString, strSql, model); SQLString.Add(Drity.DrityOfComparation("R_368-" + i, "粘接(R_368)", logins, Drity.GetDt( ), model.CU001, strSql.ToString( ).Replace("'", "''"), "编辑", "编辑单身"), null); } } if (bodyList.Count > 0) { foreach (string s in bodyList) { model.idx = Convert.ToInt32(s); delete_cu(SQLString, strSql, model); SQLString.Add(Drity.DrityOfComparation("R_368-" + model.idx, "粘接(R_368)", logins, Drity.GetDt( ), model.CU001, strSql.ToString( ).Replace("'", "''"), "删除", "删除单身"), null); } } MulaolaoLibrary.TestResultRecordOneCWEntity _cw = new MulaolaoLibrary.TestResultRecordOneCWEntity( ); for (int i = 0; i < tableTwo.Rows.Count; i++) { _cw.idx = string.IsNullOrEmpty(tableTwo.Rows [i] ["idx"].ToString( )) == true ? 0 : Convert.ToInt32(tableTwo.Rows [i] ["idx"].ToString( )); _cw.CW001 = tableTwo.Rows [i] ["CW001"].ToString( ); _cw.CW002 = tableTwo.Rows [i] ["CW002"].ToString( ); if (_cw.idx > 0) { edit_cw(SQLString, strSql, _cw); SQLString.Add(Drity.DrityOfComparation("R_368-" + i, "粘接(R_368)", logins, Drity.GetDt( ), model.CU001, strSql.ToString( ).Replace("'", "''"), "编辑", "编辑系数"), null); } else { add_cw(SQLString, strSql, _cw); SQLString.Add(Drity.DrityOfComparation("R_368-" + i, "粘接(R_368)", logins, Drity.GetDt( ), model.CU001, strSql.ToString( ).Replace("'", "''"), "新增", "新增系数"), null); } } if (coeList.Count > 0) { foreach (string s in coeList) { _cw.idx = Convert.ToInt32(s); delete_cw(SQLString, strSql, _cw); SQLString.Add(Drity.DrityOfComparation("R_368-" + _cw.idx, "粘接(R_368)", logins, Drity.GetDt( ), model.CU001, strSql.ToString( ).Replace("'", "''"), "删除", "删除系数"), null); } } return(SqlHelper.ExecuteSqlTran(SQLString)); }
/// <summary> /// save data to database /// </summary> /// <param name="table"></param> /// <param name="_di"></param> /// <param name="bodyList"></param> /// <param name="logins"></param> /// <returns></returns> public bool Save(DataTable table, MulaolaoLibrary.QualityFinalInspsctionDIEntity _di, List <string> bodyList, string logins) { Hashtable SQLString = new Hashtable( ); StringBuilder strSql = new StringBuilder( ); if (_di.idx > 0) { edit_di(SQLString, strSql, _di); SQLString.Add(Drity.DrityOfComparation("R_101", "品质终检报告单(R_101)", logins, Drity.GetDt( ), _di.DI001, strSql.ToString( ).Replace("'", "''"), "编辑", "编辑表头"), null); } else { _di.DI001 = getOddNum( ); add_di(SQLString, strSql, _di); SQLString.Add(Drity.DrityOfComparation("R_101", "品质终检报告单(R_101)", logins, Drity.GetDt( ), _di.DI001, strSql.ToString( ).Replace("'", "''"), "新增", "新增表头"), null); } MulaolaoLibrary.QualityFinalInspsctionDJEntity model = new MulaolaoLibrary.QualityFinalInspsctionDJEntity( ); model.DJ001 = _di.DI001; for (int i = 0; i < table.Rows.Count; i++) { model.idx = string.IsNullOrEmpty(table.Rows [i] ["idx"].ToString( )) == true ? 0 : Convert.ToInt32(table.Rows [i] ["idx"].ToString( )); model.DJ002 = table.Rows [i] ["DJ002"].ToString( ); model.DJ003 = table.Rows [i] ["DJ003"].ToString( ); model.DJ004 = table.Rows [i] ["DJ004"].ToString( ); model.DJ005 = table.Rows [i] ["DJ005"].ToString( ); model.DJ006 = table.Rows [i] ["DJ006"].ToString( ); if (string.IsNullOrEmpty(table.Rows [i] ["DJ007"].ToString( ))) { model.DJ007 = null; } else { model.DJ007 = Convert.ToDateTime(table.Rows [i] ["DJ007"].ToString( )); } model.DJ008 = string.IsNullOrEmpty(table.Rows [i] ["DJ008"].ToString( )) == true ? 0 : Convert.ToInt32(table.Rows [i] ["DJ008"].ToString( )); if (model.idx > 0) { edit_dj(SQLString, strSql, model); SQLString.Add(Drity.DrityOfComparation("R_101" + i, "品质终检报告单(R_101)", logins, Drity.GetDt( ), _di.DI001, strSql.ToString( ).Replace("'", "''"), "编辑", "编辑表身"), null); } else { add_dj(SQLString, strSql, model); SQLString.Add(Drity.DrityOfComparation("R_101" + i, "品质终检报告单(R_101)", logins, Drity.GetDt( ), _di.DI001, strSql.ToString( ).Replace("'", "''"), "新增", "新增表身"), null); } } if (bodyList.Count > 0) { foreach (string s in bodyList) { model.idx = Convert.ToInt32(s); delete_dj(SQLString, strSql, model); SQLString.Add(Drity.DrityOfComparation("R_101" + model.idx, "品质终检报告单(R_101)", logins, Drity.GetDt( ), _di.DI001, strSql.ToString( ).Replace("'", "''"), "删除", "删除表身"), null); } } return(SqlHelper.ExecuteSqlTran(SQLString)); }
public bool saveTo(DataTable table, string logins) { ArrayList SQLString = new ArrayList( ); StringBuilder strSql = new StringBuilder( ); MulaolaoLibrary.ContractreviewEntity _model = new MulaolaoLibrary.ContractreviewEntity( ); for (int i = 0; i < table.Rows.Count; i++) { _model.HT01 = table.Rows [i] ["PQF01"].ToString( ); _model.HT66 = table.Rows [i] ["HT66"].ToString( ); if (Exists(_model.HT01)) { strSql = new StringBuilder( ); strSql.AppendFormat("UPDATE R_PQAE SET AE08='{0}' WHERE AE02='{1}'", _model.HT66, _model.HT01); SQLString.Add(strSql.ToString( )); SQLString.Add(Drity.DrityOfComparation("R_021", "合同评审表(R_021)", logins, Drity.GetDt( ), _model.HT64, strSql.ToString( ).Replace("'", "''"), "编辑", "编辑250生产车间")); } } return(SqlHelper.ExecuteSqlTran(SQLString)); }
/// <summary> /// save data to r_pqn,r_pqna /// </summary> /// <param name="model"></param> /// <param name="table"></param> /// <param name="strList"></param> /// <param name="logins"></param> /// <returns></returns> public bool Save(MulaolaoLibrary.CustomerrecordEntity model, DataTable table, string logins) { Hashtable SQLString = new Hashtable( ); StringBuilder strSql = new StringBuilder( ); model.KH01 = getOddNum( ); add_pqn(SQLString, strSql, model); SQLString.Add(Drity.DrityOfComparation("R_369", "客户信息传递记录表(R_369)", logins, Drity.GetDt( ), model.KH01, strSql.ToString( ).Replace("'", "''"), "新增", "增加"), null); MulaolaoLibrary.CustomerrecordNAEntity _na = new MulaolaoLibrary.CustomerrecordNAEntity( ); _na.NA001 = model.KH01; for (int i = 0; i < table.Rows.Count; i++) { _na.NA002 = table.Rows [i] ["NA002"].ToString( ); _na.NA003 = table.Rows [i] ["NA003"].ToString( ); _na.NA004 = table.Rows [i] ["NA004"].ToString( ); _na.NA005 = table.Rows [i] ["NA005"].ToString( ); _na.NA006 = table.Rows [i] ["NA006"].ToString( ); _na.NA007 = table.Rows [i] ["NA007"].ToString( ); _na.NA008 = table.Rows [i] ["NA008"].ToString( ); _na.NA009 = table.Rows [i] ["NA009"].ToString( ); add_pqna(SQLString, strSql, _na); } return(SqlHelper.ExecuteSqlTran(SQLString)); }
/// <summary> /// edit data to r_pqn,r_pqna /// </summary> /// <param name="model"></param> /// <param name="table"></param> /// <param name="logins"></param> /// <param name="strList"></param> /// <returns></returns> public bool Edit(MulaolaoLibrary.CustomerrecordEntity model, DataTable table, string logins, List <string> strList) { Hashtable SQLString = new Hashtable( ); StringBuilder strSql = new StringBuilder( ); edit_pqn(SQLString, strSql, model); SQLString.Add(Drity.DrityOfComparation("R_369", "客户信息传递记录表(R_369)", logins, Drity.GetDt( ), model.KH01, strSql.ToString( ).Replace("'", "''"), "编辑", "编辑"), null); MulaolaoLibrary.CustomerrecordNAEntity _na = new MulaolaoLibrary.CustomerrecordNAEntity( ); _na.NA001 = model.KH01; for (int i = 0; i < table.Rows.Count; i++) { _na.idx = string.IsNullOrEmpty(table.Rows [i] ["idx"].ToString( )) == true ? 0 : Convert.ToInt32(table.Rows [i] ["idx"].ToString( )); _na.NA002 = table.Rows [i] ["NA002"].ToString( ); _na.NA003 = table.Rows [i] ["NA003"].ToString( ); _na.NA004 = table.Rows [i] ["NA004"].ToString( ); _na.NA005 = table.Rows [i] ["NA005"].ToString( ); _na.NA006 = table.Rows [i] ["NA006"].ToString( ); _na.NA007 = table.Rows [i] ["NA007"].ToString( ); _na.NA008 = table.Rows [i] ["NA008"].ToString( ); _na.NA009 = table.Rows [i] ["NA009"].ToString( ); if (_na.idx < 1) { add_pqna(SQLString, strSql, _na); } else { edit_pqna(SQLString, strSql, _na); } } if (strList.Count > 0) { foreach (string s in strList) { _na.idx = Convert.ToInt32(s); delete_pqna(SQLString, strSql, _na); } } return(SqlHelper.ExecuteSqlTran(SQLString)); }
/// <summary> /// save data to r_pqda r_pqdb /// </summary> /// <param name="table"></param> /// <param name="_da"></param> /// <param name="bodyList"></param> /// <param name="logins"></param> /// <returns></returns> public bool Save(DataTable table, MulaolaoLibrary.TestReportForAQDAEntity _da, List <string> bodyList, string logins) { Hashtable SQLString = new Hashtable( ); StringBuilder strSql = new StringBuilder( ); if (_da.idx < 1) { _da.DA001 = getOddNum( ); add_da(SQLString, strSql, _da); SQLString.Add(Drity.DrityOfComparation("R_142", "QA测试报告(R_142)", logins, Drity.GetDt( ), _da.DA001, strSql.ToString( ).Replace("'", "''"), "新增", "新增表头"), null); } else { edit_da(SQLString, strSql, _da); SQLString.Add(Drity.DrityOfComparation("R_142", "QA测试报告(R_142)", logins, Drity.GetDt( ), _da.DA001, strSql.ToString( ).Replace("'", "''"), "编辑", "编辑表头"), null); } MulaolaoLibrary.TestReportForAQDBEntity model = new MulaolaoLibrary.TestReportForAQDBEntity( ); model.DB001 = _da.DA001; for (int i = 0; i < table.Rows.Count; i++) { model.idx = string.IsNullOrEmpty(table.Rows [i] ["idx"].ToString( )) == true ? 0 : Convert.ToInt32(table.Rows [i] ["idx"].ToString( )); model.DB002 = table.Rows [i] ["DB002"].ToString( ); model.DB003 = table.Rows [i] ["DB003"].ToString( ); model.DB004 = string.IsNullOrEmpty(table.Rows [i] ["DB004"].ToString( )) == true ? 0 : Convert.ToInt32(table.Rows [i] ["DB004"].ToString( )); model.DB005 = string.IsNullOrEmpty(table.Rows [i] ["DB005"].ToString( )) == true ? 0 : Convert.ToInt32(table.Rows [i] ["DB005"].ToString( )); model.DB006 = string.IsNullOrEmpty(table.Rows [i] ["DB006"].ToString( )) == true ? 0 : Convert.ToInt32(table.Rows [i] ["DB006"].ToString( )); model.DB007 = string.IsNullOrEmpty(table.Rows [i] ["DB007"].ToString( )) == true ? 0 : Convert.ToInt32(table.Rows [i] ["DB007"].ToString( )); model.DB008 = string.IsNullOrEmpty(table.Rows [i] ["DB008"].ToString( )) == true ? 0 : Convert.ToInt32(table.Rows [i] ["DB008"].ToString( )); model.DB009 = table.Rows [i] ["DB009"].ToString( ); model.DB010 = string.IsNullOrEmpty(table.Rows [i] ["DB010"].ToString( )) == true ? 0 : Convert.ToInt32(table.Rows [i] ["DB010"].ToString( )); if (model.idx < 1) { add_db(SQLString, strSql, model); SQLString.Add(Drity.DrityOfComparation("R_142" + i, "QA测试报告(R_142)", logins, Drity.GetDt( ), _da.DA001, strSql.ToString( ).Replace("'", "''"), "新增", "新增表身"), null); } else { edit_db(SQLString, strSql, model); SQLString.Add(Drity.DrityOfComparation("R_142" + i, "QA测试报告(R_142)", logins, Drity.GetDt( ), _da.DA001, strSql.ToString( ).Replace("'", "''"), "编辑", "编辑表身"), null); } } if (bodyList.Count > 0) { foreach (string s in bodyList) { model.idx = Convert.ToInt32(s); delete_db(SQLString, strSql, model); SQLString.Add(Drity.DrityOfComparation("R_142" + model.idx, "QA测试报告(R_142)", logins, Drity.GetDt( ), _da.DA001, strSql.ToString( ).Replace("'", "''"), "删除", "删除表身"), null); } } return(SqlHelper.ExecuteSqlTran(SQLString)); }
/// <summary> /// save data to r_pqcb and r_pqcc /// </summary> /// <param name="table"></param> /// <param name="_cb"></param> /// <returns></returns> public bool Save(DataTable table, MulaolaoLibrary.StandardAuditTwoCDEntity _cd, string logins) { Hashtable SQLString = new Hashtable( ); StringBuilder strSql = new StringBuilder( ); _cd.CD001 = getOddNum( ); add_pqcb(SQLString, strSql, _cd); SQLString.Add(Drity.DrityOfComparation("R_483", "丝、移、热印生产首件标准样审核确认记录表(R_483)", logins, Drity.GetDt( ), _cd.CD001, strSql.ToString( ).Replace("'", "''"), "新增", "新增"), null); MulaolaoLibrary.StandardAuditTwoCEEntity _ce = new MulaolaoLibrary.StandardAuditTwoCEEntity( ); _ce.CE001 = _cd.CD001; for (int i = 0; i < table.Rows.Count; i++) { _ce.CE002 = table.Rows [i] ["CE002"].ToString( ); _ce.CE003 = table.Rows [i] ["CE003"].ToString( ); _ce.CE004 = table.Rows [i] ["CE004"].ToString( ); if (string.IsNullOrEmpty(table.Rows [i] ["CE005"].ToString( ))) { _ce.CE005 = null; } else { _ce.CE005 = Convert.ToDateTime(table.Rows [i] ["CE005"]); } if (string.IsNullOrEmpty(table.Rows [i] ["CE006"].ToString( ))) { _ce.CE006 = null; } else { _ce.CE006 = Convert.ToDateTime(table.Rows [i] ["CE006"]); } _ce.CE007 = table.Rows [i] ["CE007"].ToString( ); _ce.CE008 = table.Rows [i] ["CE008"].ToString( ); _ce.CE009 = table.Rows [i] ["CE009"].ToString( ); _ce.CE010 = table.Rows [i] ["CE010"].ToString( ); _ce.CE011 = table.Rows [i] ["CE011"].ToString( ); _ce.CE012 = table.Rows [i] ["CE012"].ToString( ); _ce.CE013 = table.Rows [i] ["CE013"].ToString( ); if (string.IsNullOrEmpty(table.Rows [i] ["CE014"].ToString( ))) { _ce.CE014 = null; } else { _ce.CE014 = Convert.ToDateTime(table.Rows [i] ["CE014"]); } _ce.CE015 = table.Rows [i] ["CE015"].ToString( ); if (string.IsNullOrEmpty(table.Rows [i] ["CE016"].ToString( ))) { _ce.CE016 = null; } else { _ce.CE016 = Convert.ToDateTime(table.Rows [i] ["CE016"]); } _ce.CE017 = table.Rows [i] ["CE017"].ToString( ); if (string.IsNullOrEmpty(table.Rows [i] ["CE018"].ToString( ))) { _ce.CE018 = null; } else { _ce.CE018 = Convert.ToDateTime(table.Rows [i] ["CE018"]); } _ce.CE019 = table.Rows [i] ["CE019"].ToString( ); if (string.IsNullOrEmpty(table.Rows [i] ["CE020"].ToString( ))) { _ce.CE020 = null; } else { _ce.CE020 = Convert.ToDateTime(table.Rows [i] ["CE020"]); } _ce.CE021 = table.Rows [i] ["CE021"].ToString( ); _ce.CE022 = table.Rows [i] ["CE022"].ToString( ); _ce.CE023 = table.Rows [i] ["CE023"].ToString( ); add_pqcc(SQLString, strSql, _ce, logins); } return(SqlHelper.ExecuteSqlTran(SQLString)); }
/// <summary> /// add data to r_pqdk /// </summary> /// <param name="model"></param> /// <param name="logins"></param> /// <returns></returns> public bool Save(MulaolaoLibrary.QualityReportDKEntity model, string logins, string state) { Hashtable SQLString = new Hashtable( ); StringBuilder strSql = new StringBuilder( ); if (state.Equals("edit")) { edit_dk(SQLString, strSql, model); SQLString.Add(Drity.DrityOfComparation("R_293", "客检产品质量报告(R_293)", logins, Drity.GetDt( ), model.DK001, strSql.ToString( ).Replace("'", "''"), "编辑", "编辑表头"), null); } else { model.DK001 = getOddNum( ); add_dk(SQLString, strSql, model); SQLString.Add(Drity.DrityOfComparation("R_293", "客检产品质量报告(R_293)", logins, Drity.GetDt( ), model.DK001, strSql.ToString( ).Replace("'", "''"), "新增", "新增表头"), null); } return(SqlHelper.ExecuteSqlTran(SQLString)); }
/// <summary> /// delete data from r_pqcr and r_pqcs and write operation to r_pqbf /// </summary> /// <param name="oddNum"></param> /// <param name="logins"></param> /// <returns></returns> public bool Delete(string oddNum, string logins) { ArrayList SQLString = new ArrayList( ); StringBuilder strSql = new StringBuilder( ); strSql.Append("DELETE FROM R_PQCR "); strSql.AppendFormat("WHERE CR001='{0}'", oddNum); SQLString.Add(strSql.ToString( )); SQLString.Add(Drity.DrityOfComparation("R_418", "产品粘接、组装人员牢固度安全常态抽测结果记录(R_418)", logins, Drity.GetDt( ), oddNum, strSql.ToString( ).Replace("'", "''"), "删除", "删除")); strSql = new StringBuilder( ); strSql.Append("DELETE FROM R_PQCS "); strSql.AppendFormat("WHERE CS001='{0}'", oddNum); SQLString.Add(strSql.ToString( )); SQLString.Add(Drity.DrityOfComparation("R_418", "产品粘接、组装人员牢固度安全常态抽测结果记录(R_418)", logins, Drity.GetDt( ), oddNum, strSql.ToString( ).Replace("'", "''"), "删除", "删除")); strSql = new StringBuilder( ); strSql.Append("DELETE FROM R_REVIEWS "); strSql.AppendFormat("WHERE RES06='{0}'", oddNum); SQLString.Add(strSql.ToString( )); SQLString.Add(Drity.DrityOfComparation("R_418", "产品粘接、组装人员牢固度安全常态抽测结果记录(R_418)", logins, Drity.GetDt( ), oddNum, strSql.ToString( ).Replace("'", "''"), "删除", "删除")); return(SqlHelper.ExecuteSqlTran(SQLString)); }