private static int SetResult(string PRG_CODE, DataSet ds) { DataTable dtTempE = ds.Tables[0].Clone(); DataTable dtTempC = ds.Tables[0].Clone(); string strExpErr = "COM_COL = 'E' "; string strExpCom = "COM_COL = 'C' "; DataRow[] dRowE = ds.Tables[0].Select(strExpErr); DataRow[] dRowC = ds.Tables[0].Select(strExpCom); for (int i = 0; i < dRowE.Length; i++) { dtTempE.ImportRow(dRowE[i]); } for (int i = 0; i < dRowC.Length; i++) { dtTempC.ImportRow(dRowC[i]); } RemoveCol(ref dtTempE); RemoveCol(ref dtTempC); dtTempE.TableName = "E"; dtTempC.TableName = "C"; //DataSet dsVal = EXC001.QueryAllVal(SessionHelper.SYS_COM_CODE, PRG_CODE, ""); DataAccess.EXC001.EXC001DA da = new DataAccess.EXC001.EXC001DA(); da.DTO.Execute.ExecuteType = DataAccess.EXC001.EXC001ExecuteType.GetQueryAllVal; da.DTO.Model.COM_CODE = SessionHelper.SYS_COM_CODE; da.DTO.Model.PRG_CODE = PRG_CODE; da.Select(da.DTO); DataTable dtC = ConvertTypeDate(dtTempC, da.DTO.Models); DataSet dsC = new DataSet(); DataSet dsE = new DataSet(); //dsC.Tables.Add(dtTempC); // dtTempC.Dispose(); dsC.Tables.Add(dtC); dsE.Tables.Add(dtTempE); //---Test DaTa 15/11/2011---- setTmpDataComplate("C_" + PRG_CODE, dsC); setTmpDataError("E_" + PRG_CODE, dsE); return(0); }
public ActionResult GetValidateExcel(DataAccess.StandardModel model, string PRG_CODE) { //string PRG_CODE = "ZQM013P";//SessionHelper.SYS_CurrentPRG_CODE; //GetData DataAccess.EXC001.EXC001DA da = new DataAccess.EXC001.EXC001DA(); SetStandardErrorLog(da.DTO); da.DTO.Execute.ExecuteType = DataAccess.EXC001.EXC001ExecuteType.GetQueryAllVal; da.DTO.Model.COM_CODE = SessionHelper.SYS_COM_CODE; da.DTO.Model.PRG_CODE = PRG_CODE; da.Select(da.DTO); EXC001Model result = WEBAPP.Helper.ExcelData.ValidateExcel(model.EXCEL_UPLOAD[0].File.ToArrayByte(), model.EXCEL_UPLOAD[0].FILE_NAME, SessionHelper.SYS_COM_CODE, PRG_CODE, da.DTO.Models); return(JsonAllowGet(result)); }