public void Save(SQLHelper sqlHelper, BESIMREG_REQUESTEDBY entity) { string sql = string.Empty; try { if (entity.IsNew) { // update tblTableCode DATableCode daTableCode = new DATableCode(); //entity.REQUESTEDBYID = daTableCode.GetTableId(sqlHelper, "REQUESTEDBYID", "SIMREG_REQUESTEDBY"); sql = sqlHelper.MakeSQL(@"INSERT INTO SIMREG_REQUESTEDBY(REQUESTEDBYID, TITLE, IDATE, IUSER, EDATE, EUSER)" + " VALUES(SQ_SIMREG_REQUESTEDBYID.Nextval, $s, SYSDATE, $n, SYSDATE, $n)", //entity.REQUESTEDBYID, entity.TITLE, //entity.IDATE, entity.IUSER, //entity.EDATE, entity.EUSER); } else { sql = sqlHelper.MakeSQL(@"UPDATE SIMREG_REQUESTEDBY SET TITLE=$s, EDATE=SYSDATE, EUSER=$n WHERE REQUESTEDBYID=$n", entity.TITLE, //entity.EDATE, entity.EUSER, entity.REQUESTEDBYID); } sqlHelper.ExecuteNonQuery(sql); } catch (Exception ex) { throw new Exception(ex.Message); } }
public void Save(SQLHelper sqlHelper, BESIMREG_NEWFORM entity) { string sql = string.Empty; try { if (entity.IsNew) { // update tblTableCode DATableCode daTableCode = new DATableCode(); //entity.ID = daTableCode.GetTableId(sqlHelper, "ID", "SIMREG_NEWFORM"); sql = sqlHelper.MakeSQL(@"INSERT INTO SIMREG_NEWFORM(ID, MSISDNTITLE, REQUESTEDDATE, REQUESTEDBYID, REQUESTEDTYPEID, DELIVEREDBYDATE, DELIVEREDBYID, IDATE, IUSER, EDATE, EUSER)" + " VALUES(SQ_SIMREG_NEWFORMID.Nextval, $s, $d, $n, $n, $d, $n, SYSDATE, $n, SYSDATE, $n)", //entity.ID, //entity.MSISDNID, entity.MSISDNTITLE, entity.REQUESTEDDATE, entity.REQUESTEDBYID, entity.REQUESTEDTYPEID, entity.DELIVEREDBYDATE, entity.DELIVEREDBYID, //entity.IDATE, entity.IUSER, //entity.EDATE, entity.EUSER); } else { sql = sqlHelper.MakeSQL(@"UPDATE SIMREG_NEWFORM SET MSISDNTITLE=$s, REQUESTEDDATE=$d, REQUESTEDBYID=$n, REQUESTEDTYPEID=$n, DELIVEREDBYDATE=$d, DELIVEREDBYID=$n, EDATE=SYSDATE, EUSER=$n WHERE ID=$n", //entity.MSISDNID, entity.MSISDNTITLE, entity.REQUESTEDDATE, entity.REQUESTEDBYID, entity.REQUESTEDTYPEID, entity.DELIVEREDBYDATE, entity.DELIVEREDBYID, //entity.EDATE, entity.EUSER, entity.ID); } sqlHelper.ExecuteNonQuery(sql); } catch (Exception ex) { throw new Exception(ex.Message); } }