public override void BuilderReportSqlAndTempTable(IRptParams filter, string tableName) { string cks = string.Empty; conditionEntry condition = getFilterCondiftionFields(filter, base.Context, cks); string material = condition.material; string startDate = condition.startDate; string endDate = condition.endDate; decimal qichu = condition.qichu; string cangku = condition.cangku; string executeSQL = string.Empty; SQLStaticStatements sqlAllDetail = new SQLStaticStatements(); string searchCondition = string.Empty; string sqlAll = sqlAllDetail.returnSQLInStockDetailReport(); executeSQL = string.Format(sqlAll, tableName, material,cangku,startDate,endDate); DBUtils.Execute(this.Context, executeSQL); string SelectSQL = "select FDATE,BILLNO FROM {0} "; using (IDataReader ReadData = DBUtils.ExecuteReader(this.Context, string.Format(SelectSQL, tableName))) { while (ReadData.Read()) { string endDateCondition = Convert.ToDateTime(ReadData["FDATE"]).ToString("yyyy-MM-dd HH:mm:ss", System.Globalization.DateTimeFormatInfo.InvariantInfo); string billno = Convert.ToString(ReadData["BILLNO"]); string update4KCQTY = sqlAllDetail.returnSQL4KUCUNQTY(); executeSQL = string.Format(update4KCQTY, tableName, startDate, endDateCondition, material, billno, qichu); DBUtils.Execute(this.Context, executeSQL); } } }
public override void BuilderReportSqlAndTempTable(IRptParams filter, string tableName) { DynamicObject customFilter = filter.FilterParameter.CustomFilter; string startDate = Convert.ToDateTime(customFilter["F_PAEZ_startDate"]).ToString("yyyy-MM-dd", System.Globalization.DateTimeFormatInfo.InvariantInfo); string endDate = Convert.ToDateTime(customFilter["F_PAEZ_endDate"]).ToString("yyyy-MM-dd", System.Globalization.DateTimeFormatInfo.InvariantInfo); //string startDate = Convert.ToString(customFilter["F_PAEZ_startDate"]).Substring(0,10).Replace("/","-"); //string endDate = Convert.ToString(customFilter["F_PAEZ_endDate"]).Substring(0,10).Replace("/","-"); string executeSQL = string.Empty; SQLStaticStatements sqlAllDetail = new SQLStaticStatements(); string searchCondition = string.Empty; string sqlAll = sqlAllDetail.returnSQLEndProductionSendOutDetailReport(searchCondition); List <string> stockss = new List <string>(); //stockList = stocks.getStockID(this.Context); foreach (DynamicStockObject stock in stockList) { stockss.Add(stock.ckName); } executeSQL = string.Format(sqlAll, tableName, String.Join(", ", stockss.ToArray()), startDate, endDate); DBUtils.Execute(this.Context, executeSQL); // 调拨总数 StringBuilder updateCK = new StringBuilder(); foreach (string s in stockss) { updateCK.Append("ISNULL(" + s + ",0) + "); } //string sqlsum = String.Join("+ ", stockss.ToArray()); executeSQL = string.Format("UPDATE {0} SET DIAOBOSUM = {1}", tableName, updateCK.Remove(updateCK.Length - 3, 3)); DBUtils.Execute(this.Context, executeSQL); //调拨金额 executeSQL = string.Format("UPDATE {0} SET DIAOBOJINE = ISNULL(DIAOBOSUM*DANJIA, 0)", tableName); DBUtils.Execute(this.Context, executeSQL); //产品总数 string prodsum = sqlAllDetail.returnSQL4ProdSum(); executeSQL = string.Format(prodsum, tableName, startDate, endDate); DBUtils.Execute(this.Context, executeSQL); //期初库存 string qichukucun = sqlAllDetail.returnSQL4qichukucun(); executeSQL = string.Format(qichukucun, tableName, startDate); DBUtils.Execute(this.Context, executeSQL); //期末库存 string qimokucun = sqlAllDetail.returnSQL4qimokucun(); executeSQL = string.Format(qimokucun, tableName, endDate); DBUtils.Execute(this.Context, executeSQL); //期末库存金额 executeSQL = string.Format("UPDATE {0} SET QIMOKUCUNJINE = ISNULL(QIMOKUCUN*DANJIA, 0)", tableName); DBUtils.Execute(this.Context, executeSQL); }
public override void BuilderReportSqlAndTempTable(IRptParams filter, string tableName) { string cks = string.Empty; getFilterCondiftionFields(filter, base.Context, cks); SQLStaticStatements sqlAllDetail = new SQLStaticStatements(); string sqlAll = sqlAllDetail.returnSQK4OnTheWayDetailReport(); string executeSQL = string.Format(sqlAll, tableName, material); DBUtils.Execute(this.Context, executeSQL); }
public override void BuilderReportSqlAndTempTable(IRptParams filter, string tableName) { string cks = string.Empty; getFilterCondiftionFields(filter, base.Context, cks); SQLStaticStatements sqlAllDetail = new SQLStaticStatements(); string sqlAll = sqlAllDetail.returnSQK4NoOutDetailReport(); GetSubStockNameUtils ckNameObject = new GetSubStockNameUtils(); List <DynamicStockObject> ckNameObj = ckNameObject.getStockID(this.Context); foreach (DynamicStockObject ck in ckNameObj) { if (ck.ckName.Equals(ckName.Substring(0, 5))) { ckid = Convert.ToString(ck.stockid); } } string executeSQL = string.Format(sqlAll, tableName, ckid, material); DBUtils.Execute(this.Context, executeSQL); }
public override void BuilderReportSqlAndTempTable(IRptParams filter, string tableName) { string cks = string.Empty; getFilterCondiftionFields(filter, base.Context, cks); SQLStaticStatements sqlAllDetail = new SQLStaticStatements(); string sqlAll = sqlAllDetail.returnSQK4StockDetailReport(); string executeSQL = string.Format(sqlAll, tableName, material, ckName); DBUtils.Execute(this.Context, executeSQL); string kctot = "UPDATE {0} SET KCTOTAL = ISNULL(INQTY,0) - ISNULL(OUTQTY,0) "; string SelectSQL = "select FDATE,BILLNO FROM {0} "; //GetSubStockNameUtils stocks = new GetSubStockNameUtils(); //List<DynamicStockObject> stocklist = stocks.getStockID(this.Context); //int stockid = 0; //foreach (DynamicStockObject s in stocklist) { // if (s.ckName.Equals(ckName)) { // stockid = s.stockid; // break; // } //} //using (IDataReader ReadData = DBUtils.ExecuteReader(this.Context, string.Format(SelectSQL, tableName))) //{ // while (ReadData.Read()) // { // // string endDateCondition = Convert.ToDateTime(ReadData["FDATE"]).ToString("yyyy-MM-dd HH:mm:ss", System.Globalization.DateTimeFormatInfo.InvariantInfo); // string billno = Convert.ToString(ReadData["BILLNO"]); // string update4KCQTY = sqlAllDetail.returnSQL4KUCUNDETAILQTY(); // executeSQL = string.Format(update4KCQTY, tableName, material, stockid, billno); // DBUtils.Execute(this.Context, executeSQL); // } //} string executeSQL1 = string.Format(kctot, tableName, material, ckName); DBUtils.Execute(this.Context, executeSQL1); }