private void runcreditpolicy(string key) { object[] par = new object[] { key }; conn.ExecReader("select isnull(creditpolicy,0) from slik_applicant where appid = @1", par, dbtimeout); bool creditpolicy = false; if (conn.hasRow()) { creditpolicy = bool.Parse(conn.GetFieldValue(0).ToString()); } if (!creditpolicy) { string sql = "select idikredit_id from idi_kredit where debiturinfo_id in (select debiturinfo_id from idi_debitur_info where appid = @1 and selected = '1')"; DataTable dt = conn.GetDataTable(sql, par, dbtimeout); for (int i = 0; i <= dt.Rows.Count - 1; i++) { DecSystem d = new DecSystem(conn); string idikredit_id = dt.Rows[i][0].ToString(); par = new object[] { idikredit_id, "DE" }; string ResultID = d.execute("AND [IDI_KREDIT].[IDIKREDIT_ID]=@1", par, "POLICY", "DE", null); par = new object[] { idikredit_id, "POLICY", "DE", ResultID }; conn.ExecuteNonQuery("EXEC SP_APPDECSYSRES @1,@2,@3,@4", par, dbtimeout); ResultID = d.execute("AND [IDI_KREDIT].[IDIKREDIT_ID]=@1", par, "PASSPOLICY", "DE", null); par = new object[] { idikredit_id, "PASSPOLICY", "DE", ResultID }; conn.ExecuteNonQuery("EXEC SP_APPDECSYSRES @1,@2,@3,@4", par, dbtimeout); } par = new object[] { key }; conn.ExecuteNonQuery("update applicant set creditpolicy = '1' where appid = @1", par, dbtimeout); } }
private void runcreditpolicy(string appid) { try { object[] par = new object[] { appid }; conn.ExecNonQuery("exec slik_clearPolicy @1", par, dbtimeout); string sql = "select * from slik_vw_creditpolicy where appid = @1 "; DataTable dt = conn.GetDataTable(sql, par, dbtimeout); for (int i = 0; i <= dt.Rows.Count - 1; i++) { DecSystem d = new DecSystem(conn); string resultid = dt.Rows[i]["fasilitasid"].ToString(); par = new object[] { resultid, "SLIK" }; try { string ResultID = d.execute("AND [slik_ideb_kredit].[fasilitasid]=@1", par, "POLICY", "SLIK", null); par = new object[] { resultid, "POLICY", "SLIK", ResultID }; conn.ExecuteNonQuery("EXEC SP_APPDECSYSRES @1,@2,@3,@4", par, dbtimeout); } catch { } } par = new object[] { appid }; conn.ExecNonQuery("exec slik_updFinalPolicy @1", par, dbtimeout); } catch (Exception ex) { grid.JSProperties["cp_alert"] = ex.Message; } }
public void rundec(bool rerun) { LBL_MSG.Text = ""; string retmsg = ""; if (Request.QueryString["readonly"] != null) { return; } object[] param = new object[] { regno, Stage, rerun }; DataTable dtRunDecSys = conn.GetDataTable( "EXEC SP_APPDECSYSRUN @1,@2,@3", param, dbtimeout); for (int i = 0; i < dtRunDecSys.Rows.Count; i++) { try { DecSystem DecSys = new DecSystem(conn); string DecId = dtRunDecSys.Rows[i]["DEC_ID"].ToString(); param = new object[] { regno, Stage }; string ResultID = DecSys.execute( "AND [APP].[AP_REGNO]=@1", param, DecId, Stage, hashFieldFWsend); param = new object[] { regno, DecId, Stage, ResultID }; conn.ExecuteNonQuery( "EXEC SP_APPDECSYSRES @1,@2,@3,@4", param, dbtimeout); } catch (Exception ex) { ModuleSupport.LogError(this.Page, ex); string errDecId = dtRunDecSys.Rows[i]["DEC_ID"].ToString(); retmsg += errDecId + ", "; } } if (retmsg != "") { LBL_MSG.Text = "<font color=Red> Execution error on engine: " + retmsg.Substring(0, retmsg.Length - 2) + "</font>"; } }