public ActionResult Edit(MASTER_SCOPE dt_form) { var UserId = Session["USER_ID"]; var logcode = MixHelper.GetLogCode(); var datenow = MixHelper.ConvertDateNow(); var status = "1"; var update = " SCOPE_CODE = '" + dt_form.SCOPE_CODE + "'," + " SCOPE_NAME = '" + dt_form.SCOPE_NAME + "'," + " SCOPE_UPDATE_BY = '" + UserId + "'," + " SCOPE_UPDATE_DATE = " + datenow + "," + " SCOPE_STATUS = '" + status + "'"; var clause = "where SCOPE_ID = " + dt_form.SCOPE_ID; //return Json(new { query = "UPDATE MASTER_BIDANG SET " + update.Replace("''", "NULL") + " " + clause }, JsonRequestBehavior.AllowGet); db.Database.ExecuteSqlCommand("UPDATE MASTER_SCOPE SET " + update.Replace("''", "NULL") + " " + clause); String objek = update.Replace("'", "-"); MixHelper.InsertLog(logcode, objek, 1); TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data Berhasil Disimpan"; return(RedirectToAction("Index")); }
public ActionResult Create(MASTER_SCOPE dt_form) { var UserId = Session["USER_ID"]; var logcode = MixHelper.GetLogCode(); int lastid = MixHelper.GetSequence("MASTER_SCOPE"); var datenow = MixHelper.ConvertDateNow(); var fname = "SCOPE_ID,SCOPE_CODE,SCOPE_NAME,SCOPE_CREATE_BY,SCOPE_CREATE_DATE,SCOPE_STATUS"; var fvalue = "'" + lastid + "', " + "'" + dt_form.SCOPE_CODE + "', " + "'" + dt_form.SCOPE_NAME + "', " + "'" + UserId + "'," + datenow + "," + "1"; db.Database.ExecuteSqlCommand("INSERT INTO MASTER_SCOPE (" + fname + ") VALUES (" + fvalue.Replace("''", "NULL") + ")"); String objek = fvalue.Replace("'", "-"); MixHelper.InsertLog(logcode, objek, 1); TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data Berhasil Disimpan"; return(RedirectToAction("Index")); }
public ActionResult PenugasanKomtek(int PROPOSAL_ID = 0, string PROPOSAL_ST_KOM_NO = "", string PROPOSAL_ST_KOM_LAMPIRAN = "", string PROPOSAL_ST_KOM_DATE = "", string PROPOSAL_ST_KOM_TIME = "") { var LOGCODE = MixHelper.GetLogCode(); int LASTID = MixHelper.GetSequence("TRX_SURAT_TUGAS"); var DATENOW = MixHelper.ConvertDateNow(); var join_tgl_surat = (PROPOSAL_ST_KOM_DATE + " " + PROPOSAL_ST_KOM_TIME); String ST_DATE = "TO_DATE('" + join_tgl_surat + "', 'yyyy-mm-dd hh24:mi:ss')"; var USER_ID = Convert.ToInt32(Session["USER_ID"]); var datenow = MixHelper.ConvertDateNow(); var fname = "ST_ID,ST_PROPOSAL_ID,ST_NO_SURAT,ST_LAMPIRAN,ST_DATE,ST_PROPOSAL_STATUS,ST_VERSI,ST_CREATE_BY,ST_CREATE_DATE,ST_STATUS"; var fvalue = "'" + LASTID + "', " + "'" + PROPOSAL_ID + "', " + "'" + PROPOSAL_ST_KOM_NO + "', " + "'" + PROPOSAL_ST_KOM_LAMPIRAN + "', " + ST_DATE + ", " + "'1', " + "'1', " + "'" + USER_ID + "', " + DATENOW + "," + "'1'"; db.Database.ExecuteSqlCommand("INSERT INTO TRX_SURAT_TUGAS (" + fname + ") VALUES (" + fvalue.Replace("''", "NULL") + ")"); return(Json(new { result = true }, JsonRequestBehavior.AllowGet)); //return View(); }
public ActionResult Create(FormCollection formCollection) { string MenuId = formCollection["menu_selector"]; //int AksesId = Convert.ToInt32(formCollection["access_id"]); string NamaAkses = formCollection["access_name"]; int IndexPage = Convert.ToInt32(formCollection["indexpage"]); int UserId = Convert.ToInt32(Session["USER_ID"]); int AksesId = MixHelper.GetSequence("SYS_ACCESS"); string logcode = MixHelper.GetLogCode(); string query_insert_access = "INSERT INTO SYS_ACCESS (ACCESS_ID,ACCESS_NAME,ACCESS_CREATE_DATE,ACCESS_CREATE_BY,ACCESS_STATUS,ACCESS_DEFAULT_MENU,ACCESS_LOG_CODE) values (" + AksesId + ",'" + NamaAkses + "',SYSDATE,'" + UserId + "', 1, 1,NULL)"; db.Database.ExecuteSqlCommand(query_insert_access); //SYS_ACCESS model2 = new SYS_ACCESS { ACCESS_ID = AksesId, ACCESS_CREATE_DATE = DateTime.Now, ACCESS_CREATE_BY = UserId, ACCESS_STATUS = 1, ACCESS_DEFAULT_MENU = 1, ACCESS_LOG_CODE = logcode }; if (MenuId != null) { string[] vals = MenuId.Split(','); foreach (String val in vals) { string[] valval = val.Split('|'); int y = Convert.ToInt32(valval[0]); int z = Convert.ToInt32(valval[1]); int lastid = MixHelper.GetSequence("SYS_ACCESS_DETAIL"); string query_insert = "INSERT INTO SYS_ACCESS_DETAIL (ACCESS_DETAIL_ID,ACCESS_DETAIL_ACCESS_ID,ACCESS_DETAIL_MENU_ID,ACCESS_DETAIL_TYPE,ACCESS_DETAIL_CREATE_DATE,ACCESS_CREATE_BY,ACCESS_DETAIL_STATUS) values (" + lastid + "," + AksesId + ", " + y + ", " + z + ", SYSDATE, " + UserId + ", 1)"; db.Database.ExecuteSqlCommand(query_insert); } } TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data Berhasil Disimpan"; return(RedirectToAction("Index")); }
public ActionResult Edit(MASTER_BIBLIOGRAFI mb) { var UserId = Session["USER_ID"]; var logcode = MixHelper.GetLogCode(); int lastid = MixHelper.GetSequence("MASTER_BIBLIOGRAFI"); var datenow = MixHelper.ConvertDateNow(); var status = "1"; var update = " BIBLIOGRAFI_JUDUL = '" + mb.BIBLIOGRAFI_JUDUL + "'," + " BIBLIOGRAFI_UPDATE_BY = " + UserId + "," + " BIBLIOGRAFI_UPDATE_DATE = " + datenow + "," + " BIBLIOGRAFI_LOGCODE = '" + logcode + "', " + " BIBLIOGRAFI_STATUS = " + status + ""; var clause = "where BIBLIOGRAFI_ID = " + mb.BIBLIOGRAFI_ID; //return Json(new { query = "UPDATE MASTER_BIDANG SET " + update.Replace("''", "NULL") + " " + clause }, JsonRequestBehavior.AllowGet); db.Database.ExecuteSqlCommand("UPDATE MASTER_BIBLIOGRAFI SET " + update.Replace("''", "NULL") + " " + clause); //var logId = AuditTrails.GetLogId(); String objek = update.Replace("'", "-"); MixHelper.InsertLog(logcode, objek, 1); TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data Berhasil Disimpan"; return(RedirectToAction("Index")); }
public ActionResult Create(MASTER_BIBLIOGRAFI mb) { var UserId = Session["USER_ID"]; var logcode = MixHelper.GetLogCode(); int lastid = MixHelper.GetSequence("MASTER_BIBLIOGRAFI"); var datenow = MixHelper.ConvertDateNow(); var fname = "BIBLIOGRAFI_ID,BIBLIOGRAFI_JUDUL,BIBLIOGRAFI_CREATE_BY,BIBLIOGRAFI_CREATE_DATE,BIBLIOGRAFI_STATUS,BIBLIOGRAFI_LOGCODE"; var fvalue = "'" + lastid + "', " + "'" + mb.BIBLIOGRAFI_JUDUL + "', " + "'" + UserId + "'," + datenow + "," + "1," + "'" + logcode + "'"; //return Json(new { query = "INSERT INTO MASTER_BIDANG (" + fname + ") VALUES (" + fvalue.Replace("''", "NULL") + ")" }, JsonRequestBehavior.AllowGet); db.Database.ExecuteSqlCommand("INSERT INTO MASTER_BIBLIOGRAFI (" + fname + ") VALUES (" + fvalue.Replace("''", "NULL") + ")"); String objek = fvalue.Replace("'", "-"); MixHelper.InsertLog(logcode, objek, 1); TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data Berhasil Disimpan"; return(RedirectToAction("Index")); }
public ActionResult Create(MASTER_SNI_STYLE mss) { var USER_ID = Convert.ToInt32(Session["USER_ID"]); var LOGCODE = MixHelper.GetLogCode(); int LASTID = MixHelper.GetSequence("MASTER_SNI_STYLE"); var DATENOW = MixHelper.ConvertDateNow(); var sort_max = db.Database.SqlQuery <Int32>("SELECT NVL(MAX(SNI_STYLE_SORT), 0) AS SNI_STYLE_SORT FROM MASTER_SNI_STYLE").SingleOrDefault(); var sort = Convert.ToInt32(sort_max) + 1; var fname = "SNI_STYLE_ID,SNI_STYLE_NAME,SNI_STYLE_VALUE,SNI_STYLE_SORT,SNI_STYLE_CREATE_BY,SNI_STYLE_CREATE_DATE,SNI_STYLE_STATUS"; var fvalue = "" + LASTID + ", " + "'" + mss.SNI_STYLE_NAME + "', " + "'" + mss.SNI_STYLE_VALUE + "', " + "'" + sort + "', " + "'" + USER_ID + "', " + DATENOW + "," + "1"; db.Database.ExecuteSqlCommand("INSERT INTO MASTER_SNI_STYLE (" + fname + ") VALUES (" + fvalue.Replace("''", "NULL") + ")"); TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data SNI Berhasil di Publikasikan"; return(RedirectToAction("Index")); }
public ActionResult Create(MASTER_REFERENCES references) { var UserId = Session["USER_ID"]; var logcode = MixHelper.GetLogCode(); int lastid = MixHelper.GetSequence("MASTER_REFERENCES"); var datenow = MixHelper.ConvertDateNow(); var fname = "REF_ID, REF_TYPE, REF_CODE, REF_NAME, REF_CREATE_BY, REF_CREATE_DATE, REF_STATUS, REF_LOG_CODE"; var fvalue = "'" + lastid + "', " + "'2', " + "'" + references.REF_CODE + "', " + "'" + references.REF_NAME + "'," + "'" + UserId + "', " + datenow + "," + "'1'," + "'" + logcode + "'"; db.Database.ExecuteSqlCommand("INSERT INTO MASTER_REFERENCES (" + fname + ") VALUES (" + fvalue.Replace("''", "NULL") + ")"); String objek = fvalue.Replace("'", "-"); MixHelper.InsertLog(logcode, objek, 1); TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data Berhasil Disimpan"; return(RedirectToAction("Index")); }
public ActionResult Index(PORTAL_PROFILE pp) { var UserId = Session["USER_ID"]; var logcode = MixHelper.GetLogCode(); var datenow = MixHelper.ConvertDateNow(); var idk = db.Database.SqlQuery <int>("SELECT MAX(MK.PROFILE_ID) FROM PORTAL_PROFILE MK").SingleOrDefault(); var update = "PROFILE_TENTANG_KAMI = '" + pp.PROFILE_TENTANG_KAMI + "'," + "PROFILE_KONTAK_KAMI = '" + pp.PROFILE_KONTAK_KAMI + "'," + "PROFILE_UPDATE_DATE = " + datenow + "," + "PROFILE_UPDATE_BY = '" + UserId + "'"; var clause = "where PROFILE_ID = " + idk; //return Json(new { query = "UPDATE PORTAL_PROFILE SET " + update.Replace("''", "NULL") + " " + clause }, JsonRequestBehavior.AllowGet); db.Database.ExecuteSqlCommand("UPDATE PORTAL_PROFILE SET " + update.Replace("''", "NULL") + " " + clause); //var logId = AuditTrails.GetLogId(); String objek = update.Replace("'", "-"); MixHelper.InsertLog(logcode, objek, 1); TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data Berhasil Disimpan"; return(RedirectToAction("Index")); }
public ActionResult create(TRX_SK_PENETAPAN INPUT, string TANGGAL_SK = "") { var UserId = Session["USER_ID"]; var logcode = MixHelper.GetLogCode(); int lastid = MixHelper.GetSequence("SK_P_PNPS"); var datenow = MixHelper.ConvertDateNow(); string pathnya = Server.MapPath("~/Upload/Dokumen/SK_PENETAPAN_PNPS/"); HttpPostedFileBase file_paten = Request.Files["FILES"]; var file_name_paten = ""; var filePath_paten = ""; var fileExtension_paten = ""; if (file_paten != null) { //Check whether Directory (Folder) exists. if (!Directory.Exists(pathnya)) { //If Directory (Folder) does not exists. Create it. Directory.CreateDirectory(pathnya); } string lampiranregulasipath = file_paten.FileName; if (lampiranregulasipath.Trim() != "") { lampiranregulasipath = Path.GetFileNameWithoutExtension(file_paten.FileName); fileExtension_paten = Path.GetExtension(file_paten.FileName); file_name_paten = "SK_PENETAPAN_PNPS_" + lastid + fileExtension_paten; filePath_paten = pathnya + file_name_paten.Replace(" ", "_"); file_paten.SaveAs(filePath_paten); } } var fname = "PENETAPAN_ID,PENETAPAN_NO_SK,TANGGAL_SK,JUDUL_SK,SK_LOCATION,FILES,CREATE_DATE,CREATE_BY"; var fvalueS = "" + lastid + "," + "'" + INPUT.PENETAPAN_NO_SK + "'," + "TO_DATE ('" + TANGGAL_SK + "','yyyy-mm-dd hh24:mi:ss')," + "'" + INPUT.JUDUL_SK + "'," + "'/Upload/Dokumen/SK_PENETAPAN_PNPS/'," + "'" + file_name_paten.Replace(" ", "_") + "'," + "" + datenow + "," + "'" + UserId + "'"; db.Database.ExecuteSqlCommand("INSERT INTO TRX_SK_PENETAPAN (" + fname + ") VALUES (" + fvalueS.Replace("''", "NULL") + ")"); TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data Berhasil Disimpan"; return(RedirectToAction("Index")); //var TT = ("INSERT INTO TRX_SK_PENETAPAN (" + fname + ") VALUES (" + fvalueS.Replace("''", "NULL") + ")"); //return Content(TT); }
public ActionResult Create(int[] SNI_STYLE_ID, int[] status, string access_name = "") { int UserId = Convert.ToInt32(Session["USER_ID"]); int DocAksesId = MixHelper.GetSequence("SYS_DOC_ACCESS"); string logcode = MixHelper.GetLogCode(); var datenow = MixHelper.ConvertDateNow(); if (SNI_STYLE_ID.Count() > 0) { var fname1 = "DOC_ACCESS_ID,DOC_ACCESS_NAME,DOC_ACCESS_CREATE_BY,DOC_ACCESS_CREATE_DATE,DOC_ACCESS_STATUS"; var fvalue1 = "'" + DocAksesId + "', " + "'" + access_name + "', " + "'" + UserId + "', " + datenow + "," + "1"; db.Database.ExecuteSqlCommand("INSERT INTO SYS_DOC_ACCESS (" + fname1 + ") VALUES (" + fvalue1.Replace("''", "NULL") + ")"); int no = 0; foreach (var a in SNI_STYLE_ID) { int DocAksesDetailId = MixHelper.GetSequence("SYS_DOC_ACCESS_DETAIL"); var fname = "DOC_ACCESS_DETAIL_ID,DOC_ACCESS_DETAIL_ACCESS_ID,DOC_ACCESS_DETAIL_STYLE_ID,DOC_ACCESS_DETAIL_CREATE_BY,DOC_ACCESS_DETAIL_CREATE_DATE,DOC_ACCESS_DETAIL_STYLE_STATUS"; var fvalue = "'" + DocAksesDetailId + "', " + "'" + DocAksesId + "', " + "" + SNI_STYLE_ID[no] + ", " + "'" + UserId + "', " + datenow + "," + "" + status[no] + ""; no++; //return Json(new //{ // sEcho = "INSERT INTO SYS_DOC_ACCESS_DETAIL (" + fname + ") VALUES (" + fvalue.Replace("''", "NULL") + ")" //}, JsonRequestBehavior.AllowGet); db.Database.ExecuteSqlCommand("INSERT INTO SYS_DOC_ACCESS_DETAIL (" + fname + ") VALUES (" + fvalue.Replace("''", "NULL") + ")"); } TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data Berhasil Disimpan"; } else { TempData["Notifikasi"] = 2; TempData["NotifikasiText"] = "Data Gagal Disimpan"; } return(RedirectToAction("Index")); }
public ActionResult Create(SYS_USER sys_users, SYS_USER_INTERN sys_users_intern) { var checkemail = db.SYS_USER.SqlQuery("SELECT * FROM SYS_USER WHERE USER_NAME = '" + sys_users.USER_NAME + "' and USER_STATUS = 1").Count(); if (checkemail > 0) { TempData["Notifikasi"] = 2; TempData["NotifikasiText"] = "Terjadi duplikasi data dengan Uername : " + sys_users.USER_NAME; return(RedirectToAction("Create")); } else { var UserId = Session["USER_ID"]; var logcode = MixHelper.GetLogCode(); int idintern = MixHelper.GetSequence("SYS_USER_INTERN"); int lastid = MixHelper.GetSequence("SYS_USER"); var datenow = MixHelper.ConvertDateNow(); var fname1 = "USER_INTERN_ID,USER_INTERN_FULLNAME,USER_INTERN_ADDRESS,USER_INTERN_EMAIL,USER_INTERN_PHONE,USER_INTERN_CREATE_BY,USER_INTERN_CREATE_DATE,USER_INTERN_STATUS,USER_INTERN_LOG_CODE "; var fvalue1 = "'" + idintern + "', " + "'" + sys_users_intern.USER_INTERN_FULLNAME + "', " + "'" + sys_users_intern.USER_INTERN_ADDRESS + "'," + "'" + sys_users_intern.USER_INTERN_EMAIL + "'," + "'" + sys_users_intern.USER_INTERN_PHONE + "'," + "'" + UserId + "', " + datenow + "," + "1," + "'" + logcode + "'"; db.Database.ExecuteSqlCommand("INSERT INTO SYS_USER_INTERN (" + fname1 + ") VALUES (" + fvalue1.Replace("''", "NULL") + ")"); var fname = "USER_ID,USER_NAME,USER_PASSWORD,USER_ACCESS_ID,USER_TYPE_ID,USER_REF_ID,USER_CREATE_BY,USER_CREATE_DATE,USER_LOG_CODE,USER_STATUS"; var fvalue = "'" + lastid + "', " + "'" + sys_users.USER_NAME + "', " + "'" + GenPassword(sys_users.USER_PASSWORD) + "', " + "'" + sys_users.USER_ACCESS_ID + "'," + "1," + "'" + idintern + "', " + "'" + UserId + "', " + datenow + "," + "'" + logcode + "'," + "1"; //return Json(new { query = "INSERT INTO SYS_USER (" + fname + ") VALUES (" + fvalue.Replace("''", "NULL") + ")" }, JsonRequestBehavior.AllowGet); db.Database.ExecuteSqlCommand("INSERT INTO SYS_USER (" + fname + ") VALUES (" + fvalue.Replace("''", "NULL") + ")"); String objek = fvalue.Replace("'", "-"); MixHelper.InsertLog(logcode, objek, 1); TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data Berhasil Disimpan"; return(RedirectToAction("Index")); } }
public ActionResult Create(VIEW_NEWS news) { var UserId = Session["USER_ID"]; var logcode = MixHelper.GetLogCode(); int lastid = MixHelper.GetSequence("PORTAL_NEWS"); var datenow = MixHelper.ConvertDateNow(); string path = Server.MapPath("~/Upload/Dokumen/LAINNYA/news/"); HttpPostedFileBase file_att = Request.Files["image"]; var file_name_att = ""; var filePath = ""; if (file_att != null) { string imagenews = file_att.FileName; if (imagenews.Trim() != "") { imagenews = Path.GetFileNameWithoutExtension(file_att.FileName); string fileExtension = Path.GetExtension(file_att.FileName); file_name_att = "IMAGE_NEWS_" + lastid + fileExtension; filePath = path + file_name_att; file_att.SaveAs(filePath); } } var link = "http://localhost:4878/Upload/Dokumen/LAINNYA/news/"; var PATS = "Upload/Dokumen/LAINNYA/news/"; var fname = "NEWS_ID, NEWS_TITLE,NEWS_CONTENTS,NEWS_SUMBER, NEWS_TAG, NEWS_PATH_IMAGE, NEWS_LINK_IMAGE, NEWS_BRIEF_NEWS, NEWS_CREATE_BY, NEWS_LOG_CODE, NEWS_CREATE_DATE,NEWS_STATUS"; var fvalue = "'" + lastid + "'," + "'" + news.NEWS_TITLE + "'," + "'" + news.NEWS_CONTENTS + "'," + "'" + news.NEWS_SUMBER + "'," + "'" + news.NEWS_TAG + "'," + "'" + PATS + file_name_att + "'," + "'" + link + file_name_att + "'," + "'" + news.NEWS_BRIEF_NEWS + "'," + "'" + UserId + "'," + "'" + logcode + "'," + datenow + "," + "1"; //return Json(new { query = "INSERT INTO MASTER_BIDANG (" + fname + ") VALUES (" + fvalue.Replace("''", "NULL") + ")" }, JsonRequestBehavior.AllowGet); db.Database.ExecuteSqlCommand("INSERT INTO PORTAL_NEWS (" + fname + ") VALUES (" + fvalue.Replace("''", "NULL") + ")"); String objek = fvalue.Replace("'", "-"); MixHelper.InsertLog(logcode, objek, 1); TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data Berhasil Disimpan"; return(RedirectToAction("Index")); }
public ActionResult Edit(TRX_SK_PENETAPAN edit, string TANGGAL_SK = "") { var UserId = Session["USER_ID"]; var logcode = MixHelper.GetLogCode(); var id = edit.PENETAPAN_ID; var datenow = MixHelper.ConvertDateNow(); DateTime TANGGAL_SK_NEW = Convert.ToDateTime(edit.TANGGAL_SK); string pathnya = Server.MapPath("~/Upload/Dokumen/SK_PENETAPAN_PNPS/"); HttpPostedFileBase file_paten = Request.Files["FILES"]; var file_name_paten = ""; var filePath_paten = ""; var fileExtension_paten = ""; if (file_paten != null) { //Check whether Directory (Folder) exists. if (!Directory.Exists(pathnya)) { //If Directory (Folder) does not exists. Create it. Directory.CreateDirectory(pathnya); } string lampiranregulasipath = file_paten.FileName; if (lampiranregulasipath.Trim() != "") { lampiranregulasipath = Path.GetFileNameWithoutExtension(file_paten.FileName); fileExtension_paten = Path.GetExtension(file_paten.FileName); file_name_paten = "SK_PENETAPAN_PNPS_" + id + fileExtension_paten; filePath_paten = pathnya + file_name_paten.Replace(" ", "_"); file_paten.SaveAs(filePath_paten); } } var update = "PENETAPAN_NO_SK = '" + edit.PENETAPAN_NO_SK + "'," + "TANGGAL_SK = TO_DATE ('" + TANGGAL_SK + "','yyyy-mm-dd hh24:mi:ss')," + "JUDUL_SK = '" + edit.JUDUL_SK + "'," + "CREATE_DATE = " + datenow + ""; var clause = "where PENETAPAN_ID = " + edit.PENETAPAN_ID; db.Database.ExecuteSqlCommand("UPDATE TRX_SK_PENETAPAN SET " + update.Replace("''", "NULL") + " " + clause); TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data Berhasil Diubah"; return(RedirectToAction("Index")); //var tt = ("UPDATE TRX_SK_PENETAPAN SET " + update.Replace("''", "NULL") + " " + clause); //return Content(tt); }
public ActionResult UserAktivasi(String id = "") { ViewData["moduleId"] = moduleId; var cekCountUserByCodeActivate = portaldb.SYS_USER_PUBLIC.SqlQuery("SELECT * FROM SYS_USER_PUBLIC WHERE USER_PUBLIC_ACTIVATION_KEY = '" + id + "' AND USER_PUBLIC_STATUS = 0 ").Count(); //return Json(new { test = cekCountUserByCodeActivate }, JsonRequestBehavior.AllowGet); //var userPublic = var getDateRegByCodeActivate = (from userpublic in portaldb.SYS_USER_PUBLIC where userpublic.USER_PUBLIC_ACTIVATION_KEY == id select userpublic).SingleOrDefault(); var getUIdRegByUsrRefId = (from usersys in portaldb.SYS_USER where usersys.USER_REF_ID == getDateRegByCodeActivate.USER_PUBLIC_ID && usersys.USER_TYPE_ID == 3 select usersys).SingleOrDefault(); var TimetoString = ((DateTime)getDateRegByCodeActivate.USER_PUBLIC_CREATE_DATE).ToString("yyyy-MM-dd HH:mm:ss"); DateTime dt2 = DateTime.ParseExact(TimetoString, "yyyy-MM-dd HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture); TimeSpan timeSince = DateTime.Now.Subtract(dt2); var totalJamAktivasi = (int)timeSince.TotalHours; ViewData["Message"] = ""; //ViewData["Message"] = cekCountUserByCodeActivate + " - " + totalJamAktivasi; if (cekCountUserByCodeActivate == 1 && totalJamAktivasi <= 24) { var datenow = MixHelper.ConvertDateNow(); var logcode = MixHelper.GetLogCode(); var fupdate1 = "USER_STATUS = '1'," + "USER_UPDATE_BY = '" + getUIdRegByUsrRefId.USER_ID + "'," + "USER_UPDATE_DATE = " + datenow; var fupdate2 = "USER_PUBLIC_STATUS = '1'," + "USER_PUBLIC_UPDATE_BY = '" + getUIdRegByUsrRefId.USER_ID + "'," + "USER_PUBLIC_UPDATE_DATE = " + datenow; portaldb.Database.ExecuteSqlCommand("UPDATE SYS_USER SET " + fupdate1 + " WHERE USER_ID = " + getUIdRegByUsrRefId.USER_ID); portaldb.Database.ExecuteSqlCommand("UPDATE SYS_USER_PUBLIC SET " + fupdate2 + " WHERE USER_PUBLIC_ID = " + getDateRegByCodeActivate.USER_PUBLIC_ID); String objek = fupdate2.Replace("'", "-"); MixHelper.InsertLogActivate(logcode, (int)getUIdRegByUsrRefId.USER_ID, (int)getUIdRegByUsrRefId.USER_ACCESS_ID, objek, 2); ViewData["Note"] = "note-success"; ViewData["Message"] = "Akun anda berhasil diaktivasi, silahkan login dengan menggunakan username dan password yang sudah kami kirimkan ke email"; //TempData["NotifSukses"] = "Akun anda berhasil diaktivasi, silahkan login dengan menggunakan username dan password yang sudah kami kirimkan ke email"; return(RedirectToAction("index", "auth")); } else { ViewData["Note"] = "note-danger"; ViewData["Message"] = "Maaf, Kode Aktivasi anda sudah kadaluarsa karena anda tidak melakukan aktivasi akun anda selama 24 jam. Silahkan menghubungi Team Support kami untuk mengaktivasi akun anda."; } return(View()); }
public ActionResult Create(TRX_PROPOSAL tp, int[] PROPOSAL_ID) { var UserId = Session["USER_ID"]; var logcode = MixHelper.GetLogCode(); var datenow = MixHelper.ConvertDateNow(); var date_now = DateTime.Now.ToString("dd_MM_yyyy_hh_mm"); //return Json(new { total_count = date }, JsonRequestBehavior.AllowGet); if (PROPOSAL_ID.Count() > 0) { string path = Server.MapPath("~/Upload/Dokumen/PEMBATALAN/"); HttpPostedFileBase file_att = Request.Files["PROPOSAL_BATAL_ATTACHMENT"]; var file_name_att = ""; var filePath = ""; if (file_att != null) { string attach_batal = file_att.FileName; if (attach_batal.Trim() != "") { attach_batal = Path.GetFileNameWithoutExtension(file_att.FileName); string fileExtension = Path.GetExtension(file_att.FileName); file_name_att = "Attachment_Batal_" + date_now + "" + fileExtension; filePath = path + file_name_att; file_att.SaveAs(filePath); } } foreach (var PID in PROPOSAL_ID) { var update = " PROPOSAL_IS_BATAL = 1," + " PROPOSAL_KET_BATAL = '" + tp.PROPOSAL_KET_BATAL + "'," + " PROPOSAL_NO_SURAT_PEMBATALAN = '" + tp.PROPOSAL_NO_SURAT_PEMBATALAN + "'," + " PROPOSAL_BATAL_ATTACHMENT = '" + file_name_att + "'," + " PROPOSAL_UPDATE_DATE =" + datenow + "," + " PROPOSAL_UPDATE_BY ='" + UserId + "'"; var clausess = "where PROPOSAL_ID = " + PID; db.Database.ExecuteSqlCommand("UPDATE TRX_PROPOSAL SET " + update.Replace("''", "NULL") + " " + clausess); //return Json(new { total_count = "UPDATE TRX_PROPOSAL SET " + update.Replace("''", "NULL") + " " + clausess }, JsonRequestBehavior.AllowGet); } } TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Proposal telah dibatalkan"; return(RedirectToAction("Index")); }
public ActionResult Backstatus(int id = 0) { var UserId = Session["USER_ID"]; var logcode = MixHelper.GetLogCode(); var datenow = MixHelper.ConvertDateNow(); var update = " PROPOSAL_IS_BATAL = 0," + " PROPOSAL_KET_BATAL = 'Diaktifkan Kembali'," + " PROPOSAL_UPDATE_DATE =" + datenow + "," + " PROPOSAL_UPDATE_BY ='" + UserId + "'"; var clausess = "where PROPOSAL_ID = " + id; db.Database.ExecuteSqlCommand("UPDATE TRX_PROPOSAL SET " + update.Replace("''", "NULL") + " " + clausess); TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Usulan/Perumusan sudah aktif kembali"; return(RedirectToAction("Index")); }
public ActionResult Republish(int id) { var UserId = Session["USER_ID"]; var logcode = MixHelper.GetLogCode(); int lastid = MixHelper.GetSequence("TRX_DOCUMENTS"); var datenow = MixHelper.ConvertDateNow(); var updates = "UPDATE TRX_SNI SET SNI_IS_PUBLISH = 0, SNI_UPDATE_BY = " + UserId + ", SNI_UPDATE_DATE = " + datenow + " WHERE SNI_ID = " + id; db.Database.ExecuteSqlCommand(updates); String objek = updates.Replace("'", "-"); MixHelper.InsertLog(logcode, objek, 1); TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Berhasil, Data SNI menjadi tidak dipublikasi "; return(RedirectToAction("Index")); }
public ActionResult TambahSNI(TRX_REGULASI_TEKNIS trt, FormCollection formCollection) { var UserId = Session["USER_ID"]; var logcode = MixHelper.GetLogCode(); int lastid = MixHelper.GetSequence("TRX_REGULASI_TEKNIS_DETAIL"); var datenow = MixHelper.ConvertDateNow(); var sni_id = formCollection["RETEK_DETAIL_SNI_ID"]; if (sni_id != null) { //int n = 0; string[] vals = sni_id.Split(','); for (int n = 0; n < vals.Length; n++) { int lastid_mki = MixHelper.GetSequence("TRX_REGULASI_TEKNIS_DETAIL"); var jml = db.Database.SqlQuery <int>("SELECT COUNT(*) FROM TRX_REGULASI_TEKNIS_DETAIL MK WHERE RETEK_DETAIL_RETEK_ID = " + trt.RETEK_ID + "AND RETEK_DETAIL_SNI_ID = " + vals[n]); if (Convert.ToInt32(jml) == 0) { //string query_update = "INSERT INTO MASTER_KOMTEK_ICS (KOMTEK_ICS_ID, KOMTEK_ICS_KOMTEK_ID, KOMTEK_ICS_ICS_ID, KOMTEK_ICS_CREATE_BY, KOMTEK_ICS_CREATE_DATE, KOMTEK_ICS_STATUS, KOMTEK_ICS_LOG_CODE) VALUES (" + lastid_mki + "," + lastid + "," + vals[n] + "," + UserId + "," + datenow + ",1,'" + logcode + "')"; //db.Database.ExecuteSqlCommand(query_update); //return Json(new { query = query_update, id = komtek_ics_id }); var fname1 = "RETEK_DETAIL_ID,RETEK_DETAIL_RETEK_ID,RETEK_DETAIL_SNI_ID,RETEK_DETAIL_CREATE_BY,RETEK_DETAIL_CREATE_DATE,RETEK_DETAIL_STATUS"; var fvalue1 = "'" + lastid_mki + "'," + "'" + trt.RETEK_ID + "'," + "'" + vals[n] + "'," + "" + UserId + "," + datenow + "," + "1"; //return Json(new { query = "INSERT INTO TRX_REGULASI_TEKNIS (" + fname1 + ") VALUES (" + fvalue1.Replace("''", "NULL") + ")" }, JsonRequestBehavior.AllowGet); db.Database.ExecuteSqlCommand("INSERT INTO TRX_REGULASI_TEKNIS_DETAIL (" + fname1 + ") VALUES (" + fvalue1.Replace("''", "NULL") + ")"); String objek1 = fvalue1.Replace("'", "-"); MixHelper.InsertLog(logcode, objek1, 1); } } } TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data Berhasil Disimpan"; return(RedirectToAction("Index")); }
public ActionResult publish(int id = 0) { var UserId = Session["USER_ID"]; var logcode = MixHelper.GetLogCode(); int lastid = MixHelper.GetSequence("TRX_DOCUMENTS"); var datenow = MixHelper.ConvertDateNow(); var updates = "UPDATE TRX_SNI_SK SET IS_PUBLISH = 1 WHERE SNI_SK_ID = " + id; db.Database.ExecuteSqlCommand(updates); var update = "UPDATE TRX_SNI SET SNI_IS_PUBLISH = 1 WHERE SNI_SK_ID = " + id; db.Database.ExecuteSqlCommand(update); String objek = update.Replace("'", "-"); MixHelper.InsertLog(logcode, objek, 1); TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data SNI Berhasil di Publikasikan"; return(RedirectToAction("Index")); }
public ActionResult Edit(MASTER_SNI_STYLE mss) { var USER_ID = Convert.ToInt32(Session["USER_ID"]); var LOGCODE = MixHelper.GetLogCode(); int LASTID = MixHelper.GetSequence("MASTER_SNI_STYLE"); var DATENOW = MixHelper.ConvertDateNow(); if (mss.SNI_STYLE_ID > 0) { var uPDATE = "UPDATE MASTER_SNI_STYLE SET SNI_STYLE_NAME = '" + mss.SNI_STYLE_NAME + "', SNI_STYLE_VALUE = '" + mss.SNI_STYLE_VALUE + "', SNI_STYLE_UPDATE_BY = " + LASTID + ", SNI_STYLE_UPDATE_DATE = " + DATENOW + " WHERE SNI_STYLE_ID = " + mss.SNI_STYLE_ID; db.Database.ExecuteSqlCommand(uPDATE); TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data SNI Style Berhasil di Publikasikan"; } else { TempData["Notifikasi"] = 2; TempData["NotifikasiText"] = "Data SNI Style gagal di Publikasikan"; } return(RedirectToAction("Index")); }
public ActionResult Create(MASTER_ICS ics) { //return Content(ics.ICS_PARENT_CODE); var UserId = Session["USER_ID"]; var logcode = MixHelper.GetLogCode(); int lastid = MixHelper.GetSequence("MASTER_ICS"); var datenow = MixHelper.ConvertDateNow(); var fname = "ICS_ID," + "ICS_PARENT_CODE," + "ICS_CODE," + "ICS_NAME," + "ICS_NAME_IND," + //"ICS_YEAR," + "ICS_CREATE_BY," + "ICS_CREATE_DATE," + "ICS_STATUS," + "ICS_LOG_CODE"; var fvalue = "'" + lastid + "', " + "'" + ics.ICS_PARENT_CODE + "', " + "'" + ics.ICS_PARENT_CODE + "." + ics.ICS_CODE + "'," + "'" + ics.ICS_NAME + "'," + "'" + ics.ICS_NAME_IND + "'," + //"'" + ics.ICS_YEAR + "'," + "'" + UserId + "', " + datenow + "," + "1," + "'" + logcode + "'"; db.Database.ExecuteSqlCommand("INSERT INTO MASTER_ICS (" + fname + ") VALUES (" + fvalue.Replace("''", "NULL") + ")"); String objek = fvalue.Replace("'", "-"); MixHelper.InsertLog(logcode, objek, 1); TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data Berhasil Disimpan"; return(RedirectToAction("Index")); }
public ActionResult CreateRatek(HttpPostedFileBase NOTULEN, int PROPOSAL_ID = 0, int PROPOSAL_KOMTEK_ID = 0, int APPROVAL_TYPE = 0, string NO_RATEK = "", string TGL_RATEK = "") { var USER_ID = Convert.ToInt32(Session["USER_ID"]); var DATENOW = MixHelper.ConvertDateNow(); var DataProposal = (from proposal in db.VIEW_PROPOSAL where proposal.PROPOSAL_ID == PROPOSAL_ID select proposal).SingleOrDefault(); var PROPOSAL_PNPS_CODE_FIXER = DataProposal.PROPOSAL_PNPS_CODE; Stream STREAM_NOTULEN = NOTULEN.InputStream; byte[] APPDATA_NOTULEN = new byte[NOTULEN.ContentLength + 1]; STREAM_NOTULEN.Read(APPDATA_NOTULEN, 0, NOTULEN.ContentLength); string Extension_NOTULEN = Path.GetExtension(NOTULEN.FileName); int APPROVAL_ID = MixHelper.GetSequence("TRX_PROPOSAL_APPROVAL"); var VERSION_RATEK = db.Database.SqlQuery <decimal>("SELECT CAST(NVL(MAX(T1.PROPOSAL_RAPAT_VERSION),0) AS NUMBER)+1 AS PROPOSAL_RAPAT_VERSION FROM TRX_PROPOSAL_RAPAT T1 WHERE T1.PROPOSAL_RAPAT_PROPOSAL_ID = " + PROPOSAL_ID + " AND T1.PROPOSAL_RAPAT_PROPOSAL_STATUS = 6").SingleOrDefault(); if (Extension_NOTULEN.ToLower() == ".docx" || Extension_NOTULEN.ToLower() == ".doc") { Directory.CreateDirectory(Server.MapPath("~/Upload/Dokumen/RANCANGAN_SNI/RSNI3/" + PROPOSAL_PNPS_CODE_FIXER)); string path = Server.MapPath("~/Upload/Dokumen/RANCANGAN_SNI/RSNI3/" + PROPOSAL_PNPS_CODE_FIXER + "/"); Aspose.Words.Document doc = new Aspose.Words.Document(STREAM_NOTULEN); string filePathdoc = path + "NOTULEN_TAS_Ver" + VERSION_RATEK + "_" + PROPOSAL_PNPS_CODE_FIXER + ".docx"; string filePathpdf = path + "NOTULEN_TAS_Ver" + VERSION_RATEK + "_" + PROPOSAL_PNPS_CODE_FIXER + ".pdf"; string filePathxml = path + "NOTULEN_TAS_Ver" + VERSION_RATEK + "_" + PROPOSAL_PNPS_CODE_FIXER + ".xml"; doc.Save(@"" + filePathdoc, Aspose.Words.SaveFormat.Docx); doc.Save(@"" + filePathpdf, Aspose.Words.SaveFormat.Pdf); doc.Save(@"" + filePathxml); int LASTID_NOTULEN = MixHelper.GetSequence("TRX_DOCUMENTS"); var LOGCODE_NOTULEN = MixHelper.GetLogCode(); var FNAME_NOTULEN = "DOC_ID,DOC_FOLDER_ID,DOC_RELATED_TYPE,DOC_RELATED_ID,DOC_NAME,DOC_DESCRIPTION,DOC_FILE_PATH,DOC_FILE_NAME,DOC_FILETYPE,DOC_EDITABLE,DOC_CREATE_BY,DOC_CREATE_DATE,DOC_STATUS,DOC_LOG_CODE"; var FVALUE_NOTULEN = "'" + LASTID_NOTULEN + "', " + "'14', " + "'10', " + "'" + PROPOSAL_ID + "', " + "'" + "(" + PROPOSAL_PNPS_CODE_FIXER + ") Notulen TAS Ver " + VERSION_RATEK + "', " + "'Notulen Tenaga Ahli Standarisasi Ver " + VERSION_RATEK + " " + PROPOSAL_PNPS_CODE_FIXER + "', " + "'" + "/Upload/Dokumen/RANCANGAN_SNI/RSNI3/" + PROPOSAL_PNPS_CODE_FIXER + "/" + "', " + "'" + "NOTULEN_TAS_Ver" + VERSION_RATEK + "_" + PROPOSAL_PNPS_CODE_FIXER + "" + "', " + "'" + Extension_NOTULEN.ToUpper().Replace(".", "") + "', " + "'0', " + "'" + USER_ID + "', " + DATENOW + "," + "'1', " + "'" + LOGCODE_NOTULEN + "'"; db.Database.ExecuteSqlCommand("INSERT INTO TRX_DOCUMENTS (" + FNAME_NOTULEN + ") VALUES (" + FVALUE_NOTULEN.Replace("''", "NULL") + ")"); String objekTanggapan = FVALUE_NOTULEN.Replace("'", "-"); MixHelper.InsertLog(LOGCODE_NOTULEN, objekTanggapan, 1); } else { Directory.CreateDirectory(Server.MapPath("~/Upload/Dokumen/RANCANGAN_SNI/RSNI3/" + PROPOSAL_PNPS_CODE_FIXER)); string path = Server.MapPath("~/Upload/Dokumen/RANCANGAN_SNI/RSNI3/" + PROPOSAL_PNPS_CODE_FIXER + "/"); NOTULEN.SaveAs(path + "BERITA_ACARA_Ver" + VERSION_RATEK + "_" + PROPOSAL_PNPS_CODE_FIXER + Extension_NOTULEN.ToUpper()); int LASTID_NOTULEN = MixHelper.GetSequence("TRX_DOCUMENTS"); var LOGCODE_NOTULEN = MixHelper.GetLogCode(); var FNAME_NOTULEN = "DOC_ID,DOC_FOLDER_ID,DOC_RELATED_TYPE,DOC_RELATED_ID,DOC_NAME,DOC_DESCRIPTION,DOC_FILE_PATH,DOC_FILE_NAME,DOC_FILETYPE,DOC_EDITABLE,DOC_CREATE_BY,DOC_CREATE_DATE,DOC_STATUS,DOC_LOG_CODE"; var FVALUE_NOTULEN = "'" + LASTID_NOTULEN + "', " + "'14', " + "'10', " + "'" + PROPOSAL_ID + "', " + "'" + "(" + PROPOSAL_PNPS_CODE_FIXER + ") Notulen TAS Ver " + VERSION_RATEK + "', " + "'Notulen Tenaga Ahli Standarisasi Ver " + VERSION_RATEK + " " + PROPOSAL_PNPS_CODE_FIXER + "', " + "'" + "/Upload/Dokumen/RANCANGAN_SNI/RSNI3/" + PROPOSAL_PNPS_CODE_FIXER + "/" + "', " + "'" + "NOTULEN_TAS_Ver" + VERSION_RATEK + "_" + PROPOSAL_PNPS_CODE_FIXER + "" + "', " + "'" + Extension_NOTULEN.ToUpper().Replace(".", "") + "', " + "'0', " + "'" + USER_ID + "', " + DATENOW + "," + "'1', " + "'" + LOGCODE_NOTULEN + "'"; db.Database.ExecuteSqlCommand("INSERT INTO TRX_DOCUMENTS (" + FNAME_NOTULEN + ") VALUES (" + FVALUE_NOTULEN.Replace("''", "NULL") + ")"); String objekTanggapan = FVALUE_NOTULEN.Replace("'", "-"); MixHelper.InsertLog(LOGCODE_NOTULEN, objekTanggapan, 1); } TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data Berhasil Disimpan"; return(RedirectToAction("Index")); }
public ActionResult Detil(TRX_SNI ts, TRX_PROPOSAL tp, int PROPOSAL_ID = 0, string DOC_INFO = "") { var UserId = Session["USER_ID"]; var logcode = MixHelper.GetLogCode(); int lastid = MixHelper.GetSequence("TRX_DOCUMENTS"); var datenow = MixHelper.ConvertDateNow(); var update_sni = "UPDATE TRX_SNI SET SNI_IS_PUBLISH = 1, SNI_NOMOR = '" + ts.SNI_NOMOR + "', SNI_JUDUL = '" + ts.SNI_JUDUL + "', SNI_JUDUL_ENG = '" + ts.SNI_JUDUL_ENG + "' WHERE SNI_ID = " + ts.SNI_ID; db.Database.ExecuteSqlCommand(update_sni); var update_PROPOSAL = "UPDATE TRX_PROPOSAL SET PROPOSAL_ABSTRAK = '" + tp.PROPOSAL_ABSTRAK + "', PROPOSAL_ABSTRAK_ENG = '" + tp.PROPOSAL_ABSTRAK_ENG + "', PROPOSAL_RUANG_LINGKUP = '" + tp.PROPOSAL_RUANG_LINGKUP + "', PROPOSAL_RUANG_LINGKUP_ENG = '" + tp.PROPOSAL_RUANG_LINGKUP_ENG + "' WHERE PROPOSAL_ID = " + ts.SNI_PROPOSAL_ID; db.Database.ExecuteSqlCommand(update_PROPOSAL); var updates = "UPDATE TRX_SNI_SK SET IS_PUBLISH = 1 WHERE SNI_SK_ID = " + ts.SNI_SK_ID; db.Database.ExecuteSqlCommand(updates); var DataProposal = (from proposal in db.VIEW_PROPOSAL where proposal.PROPOSAL_ID == ts.SNI_PROPOSAL_ID select proposal).SingleOrDefault(); var PROPOSAL_PNPS_CODE_FIXER = DataProposal.PROPOSAL_PNPS_CODE; var TGL_SEKARANG = DateTime.Now.ToString("yyyyMMddHHmmss"); HttpPostedFileBase file4 = Request.Files["file_sni"]; if (file4.ContentLength > 0) { var doc = (from b in db.TRX_DOCUMENTS where b.DOC_ID == ts.SNI_DOC_ID && b.DOC_FOLDER_ID == 8 && b.DOC_RELATED_TYPE == 100 select b).SingleOrDefault(); int LASTID_DOC = MixHelper.GetSequence("TRX_DOCUMENTS"); Directory.CreateDirectory(Server.MapPath("~/Upload/Dokumen/SNI")); string path = Server.MapPath("~/Upload/Dokumen/SNI/"); Stream stremdokumen = file4.InputStream; byte[] appData = new byte[file4.ContentLength + 1]; stremdokumen.Read(appData, 0, file4.ContentLength); string Extension = Path.GetExtension(file4.FileName); if (Extension.ToLower() == ".doc" || Extension.ToLower() == ".docx") { //Aspose.Pdf.Document pdf = new Aspose.Pdf.Document(stremdokumen); Aspose.Words.Document docx = new Aspose.Words.Document(stremdokumen); string filePathdoc = path + "SNI_" + PROPOSAL_PNPS_CODE_FIXER + "_" + TGL_SEKARANG + "(publish).docx"; string filePathpdf = path + "SNI_" + PROPOSAL_PNPS_CODE_FIXER + "_" + TGL_SEKARANG + "(publish).pdf"; string filePathxml = path + "SNI_" + PROPOSAL_PNPS_CODE_FIXER + "_" + TGL_SEKARANG + "(publish).xml"; docx.Save(@"" + filePathdoc, Aspose.Words.SaveFormat.Docx); docx.Save(@"" + filePathpdf, Aspose.Words.SaveFormat.Pdf); docx.Save(@"" + filePathxml); string Total_Hal = ""; if (DOC_INFO == "" || DOC_INFO == " ") { Total_Hal = (docx.PageCount).ToString(); } else { Total_Hal = DOC_INFO; } ////string filePathpdf = path + "SNI_" + PROPOSAL_PNPS_CODE_FIXER + "_" + TGL_SEKARANG + "(publish).pdf"; //string filePathxml = path + "SNI_" + PROPOSAL_PNPS_CODE_FIXER + "_" + TGL_SEKARANG + "(publish).xml"; //pdf.Save(@"" + filePathpdf, Aspose.Pdf.SaveFormat.Pdf); //pdf.Save(@"" + filePathxml); var LOGCODE_TANGGAPAN_MTPS = MixHelper.GetLogCode(); var fupdate = "UPDATE TRX_DOCUMENTS SET DOC_FILE_NAME = 'SNI_" + PROPOSAL_PNPS_CODE_FIXER + "_" + TGL_SEKARANG + "(publish)'," + "DOC_UPDATE_BY = " + UserId + "," + "DOC_INFO = '" + Total_Hal + "'," + "DOC_FILETYPE = 'DOCX'," + "DOC_UPDATE_DATE = " + datenow + "" + "WHERE DOC_RELATED_ID = " + ts.SNI_PROPOSAL_ID + " AND DOC_FOLDER_ID = 8 AND DOC_RELATED_TYPE = 100"; db.Database.ExecuteSqlCommand(fupdate); } } String objek = update_sni.Replace("'", "-"); MixHelper.InsertLog(logcode, objek, 1); String objeks = update_PROPOSAL.Replace("'", "-"); MixHelper.InsertLog(logcode, objeks, 1); String objekss = updates.Replace("'", "-"); MixHelper.InsertLog(logcode, objekss, 1); TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data SNI Berhasil di Publikasikan"; return(RedirectToAction("Index")); }
public ActionResult Create(TRX_MAINTENANCES mtn, TRX_MAINTENANCE_DETAILS mtd, string MAINTENANCE_KOMTEK2 = "") { var UserId = Session["USER_ID"]; var logcode = MixHelper.GetLogCode(); int lastid = MixHelper.GetSequence("TRX_MAINTENANCES"); var datenow = MixHelper.ConvertDateNow(); var id_sni = Convert.ToString(mtd.MAINTENANCE_DETAIL_SNI_ID); var komtek_id = ""; if (MAINTENANCE_KOMTEK2 != "-") { komtek_id = MAINTENANCE_KOMTEK2; } else if (MAINTENANCE_KOMTEK2 == "-") { komtek_id = mtn.MAINTENANCE_KOMTEK; } //return Content(komtek_id); string pathnya = Server.MapPath("~/Upload/Dokumen/FORM_KAJI_ULANG/"); HttpPostedFileBase file_paten = Request.Files["MAINTENANCE_DETAIL_KJ_ULG_NAME"]; var file_name_paten = ""; var filePath_paten = ""; var fileExtension_paten = ""; if (file_paten != null) { //Check whether Directory (Folder) exists. if (!Directory.Exists(pathnya)) { //If Directory (Folder) does not exists. Create it. Directory.CreateDirectory(pathnya); } string lampiranregulasipath = file_paten.FileName; if (lampiranregulasipath.Trim() != "") { lampiranregulasipath = Path.GetFileNameWithoutExtension(file_paten.FileName); fileExtension_paten = Path.GetExtension(file_paten.FileName); file_name_paten = "FORM_KAJI_ULANG_PEMELIHARAAN_IDM_" + lastid + fileExtension_paten; filePath_paten = pathnya + file_name_paten.Replace(" ", "_"); file_paten.SaveAs(filePath_paten); } } //if (Convert.ToInt32(form["count_rows"]) > 0) //{ DateTime MAINTENANCE_DATE_a = Convert.ToDateTime(mtn.MAINTENANCE_DATE); var MAINTENANCE_DATE = "TO_DATE('" + MAINTENANCE_DATE_a.ToString("yyyy-MM-dd HH:mm:ss") + "', 'yyyy-mm-dd hh24:mi:ss')"; //KOMTEK_BIDANG_ID,KOMTEK_INSTANSI_ID, var fname = "MAINTENANCE_ID,MAINTENANCE_DOC_NUMBER,MAINTENANCE_KOMTEK,MAINTENANCE_CREATE_BY,MAINTENANCE_CREATE_DATE,MAINTENANCE_STATUS"; var fvalue = "'" + lastid + "', " + "'" + mtn.MAINTENANCE_DOC_NUMBER + "'," + "'" + komtek_id + "', " + "'" + UserId + "'," + datenow + "," + "1"; //return Json(new { query = "INSERT INTO MASTER_KOMITE_TEKNIS (" + fname + ") VALUES (" + fvalue.Replace("''", "NULL") + ")" }, JsonRequestBehavior.AllowGet); db.Database.ExecuteSqlCommand("INSERT INTO TRX_MAINTENANCES (" + fname + ") VALUES (" + fvalue.Replace("''", "NULL") + ")"); String objek = fvalue.Replace("'", "-"); MixHelper.InsertLog(logcode, objek, 1); //for (var a = 0; a < Convert.ToInt32(form["count_rows"]); a++) //{ int lastid_detail = MixHelper.GetSequence("TRX_MAINTENANCE_DETAILS"); DateTime MAINTENANCE_DETAIL_REV_DATE_ = Convert.ToDateTime(mtd.MAINTENANCE_DETAIL_REV_DATE); var MAINTENANCE_DETAIL_REV_DATE = "TO_DATE('" + MAINTENANCE_DETAIL_REV_DATE_.ToString("yyyy-MM-dd HH:mm:ss") + "', 'yyyy-mm-dd hh24:mi:ss')"; DateTime MAINTENANCE_DETAIL_REPORT_DATE_ = Convert.ToDateTime(mtd.MAINTENANCE_DETAIL_REPORT_DATE); var MAINTENANCE_DETAIL_REPORT_DATE = "TO_DATE('" + MAINTENANCE_DETAIL_REPORT_DATE_.ToString("yyyy-MM-dd HH:mm:ss") + "', 'yyyy-mm-dd hh24:mi:ss')"; var fnameS = ""; var fvalueS = ""; if (mtd.MAINTENANCE_DETAIL_KJ_ULG_NAME != null) { fnameS = "MAINTENANCE_DETAIL_ID,MAINTENANCE_DETAIL_MTN_ID,MAINTENANCE_DETAIL_SNI_ID,MAINTENANCE_DETAIL_REV_DATE,MAINTENANCE_DETAIL_RESULT,MAINTENANCE_DETAIL_REPORT_DATE,MAINTENANCE_DETAIL_KJ_ULG_LOC,MAINTENANCE_DETAIL_KJ_ULG_NAME,MAINTENANCE_DETAIL_NO_SURAT"; fvalueS = "'" + lastid_detail + "', " + "'" + lastid + "', " + "'" + mtd.MAINTENANCE_DETAIL_SNI_ID + "', " + MAINTENANCE_DETAIL_REV_DATE + "," + "'" + mtd.MAINTENANCE_DETAIL_RESULT + "', " + MAINTENANCE_DETAIL_REPORT_DATE + "," + "'/Upload/Dokumen/FORM_KAJI_ULANG/'," + "'" + file_name_paten.Replace(" ", "_") + "'," + "'" + mtd.MAINTENANCE_DETAIL_NO_SURAT + "'"; } else { fnameS = "MAINTENANCE_DETAIL_ID,MAINTENANCE_DETAIL_MTN_ID,MAINTENANCE_DETAIL_SNI_ID,MAINTENANCE_DETAIL_REV_DATE,MAINTENANCE_DETAIL_RESULT,MAINTENANCE_DETAIL_REPORT_DATE,MAINTENANCE_DETAIL_NO_SURAT"; fvalueS = "'" + lastid_detail + "', " + "'" + lastid + "', " + "'" + mtd.MAINTENANCE_DETAIL_SNI_ID + "', " + MAINTENANCE_DETAIL_REV_DATE + "," + "'" + mtd.MAINTENANCE_DETAIL_RESULT + "', " + MAINTENANCE_DETAIL_REPORT_DATE + "," + "'" + mtd.MAINTENANCE_DETAIL_NO_SURAT + "'"; } //return Json(new { query = "INSERT INTO MASTER_KOMITE_TEKNIS (" + fname + ") VALUES (" + fvalue.Replace("''", "NULL") + ")" }, JsonRequestBehavior.AllowGet); db.Database.ExecuteSqlCommand("INSERT INTO TRX_MAINTENANCE_DETAILS (" + fnameS + ") VALUES (" + fvalueS.Replace("''", "NULL") + ")"); //update trx_sni db.Database.ExecuteSqlCommand("UPDATE TRX_SNI SET SNI_MAINTENANCE_STS = '1' WHERE SNI_ID = " + id_sni); //} TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data Berhasil Disimpan"; //} //else //{ // TempData["Notifikasi"] = 2; // TempData["NotifikasiText"] = "Data Gagal Disimpan"; //} return(RedirectToAction("Index")); }
public ActionResult Edit(int id, int[] SNI_STYLE_ID, int[] status, string access_name = "") { int UserId = Convert.ToInt32(Session["USER_ID"]); int DocAksesId = MixHelper.GetSequence("SYS_DOC_ACCESS"); string logcode = MixHelper.GetLogCode(); var datenow = MixHelper.ConvertDateNow(); if (SNI_STYLE_ID.Count() > 0) { var update_doc_access = "UPDATE SYS_DOC_ACCESS SET DOC_ACCESS_NAME = '" + access_name + "', DOC_ACCESS_UPDATE_BY = " + UserId + ", DOC_ACCESS_UPDATE_DATE = " + datenow + " WHERE DOC_ACCESS_ID = " + id; db.Database.ExecuteSqlCommand(update_doc_access); //return Json(new //{ // sEcho = update_doc_access //}, JsonRequestBehavior.AllowGet); int no = 0; foreach (var a in SNI_STYLE_ID) { //var updateted = "UPDATE SYS_DOC_ACCESS_DETAIL SET DOC_ACCESS_DETAIL_STYLE_STATUS = " + status[no] + " WHERE DOC_ACCESS_DETAIL_STYLE_ID = " + SNI_STYLE_ID[no] + " AND DOC_ACCESS_DETAIL_ACCESS_ID = " + id; //db.Database.ExecuteSqlCommand(updateted); var dataDocRole = db.SYS_DOC_ACCESS_DETAIL.SqlQuery("SELECT * FROM SYS_DOC_ACCESS_DETAIL WHERE DOC_ACCESS_DETAIL_ACCESS_ID = " + id + " AND DOC_ACCESS_DETAIL_STYLE_ID = " + SNI_STYLE_ID[no]).FirstOrDefault(); if (dataDocRole != null) { var updateted = "UPDATE SYS_DOC_ACCESS_DETAIL SET DOC_ACCESS_DETAIL_STYLE_STATUS = " + status[no] + " WHERE DOC_ACCESS_DETAIL_STYLE_ID = " + SNI_STYLE_ID[no] + " AND DOC_ACCESS_DETAIL_ACCESS_ID = " + id; db.Database.ExecuteSqlCommand(updateted); //string query_update = "UPDATE SYS_ACCESS_DETAIL SET ACCESS_DETAIL_STATUS = 1, ACCESS_DETAIL_UPDATE_DATE = SYSDATE, ACCESS_DETAIL_UPDATE_BY = " + UserId + " where ACCESS_DETAIL_ACCESS_ID = '" + AksesId + "' AND ACCESS_DETAIL_MENU_ID = '" + y + "' AND ACCESS_DETAIL_TYPE = '" + z + "'"; //db.Database.ExecuteSqlCommand(query_update); } else { //int lastid = MixHelper.GetSequence("SYS_DOC_ACCESS_DETAIL"); //string query_insert = "INSERT INTO SYS_DOC_ACCESS_DETAIL (ACCESS_DETAIL_ID,ACCESS_DETAIL_ACCESS_ID,ACCESS_DETAIL_MENU_ID,ACCESS_DETAIL_TYPE,ACCESS_DETAIL_CREATE_DATE,ACCESS_CREATE_BY,ACCESS_DETAIL_STATUS) values (" + lastid + "," + AksesId + ", " + y + ", " + z + ", SYSDATE, " + UserId + ", 1)"; //db.Database.ExecuteSqlCommand(query_insert); int DocAksesDetailId = MixHelper.GetSequence("SYS_DOC_ACCESS_DETAIL"); var fname = "DOC_ACCESS_DETAIL_ID,DOC_ACCESS_DETAIL_ACCESS_ID,DOC_ACCESS_DETAIL_STYLE_ID,DOC_ACCESS_DETAIL_CREATE_BY,DOC_ACCESS_DETAIL_CREATE_DATE,DOC_ACCESS_DETAIL_STYLE_STATUS"; var fvalue = "'" + DocAksesDetailId + "', " + "'" + id + "', " + "" + SNI_STYLE_ID[no] + ", " + "'" + UserId + "', " + datenow + "," + "" + status[no] + ""; db.Database.ExecuteSqlCommand("INSERT INTO SYS_DOC_ACCESS_DETAIL (" + fname + ") VALUES (" + fvalue.Replace("''", "NULL") + ")"); } no++; } TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data Berhasil Disimpan"; } else { TempData["Notifikasi"] = 2; TempData["NotifikasiText"] = "Data Gagal Disimpan"; } return(RedirectToAction("Index")); }
public ActionResult Approval(int PROPOSAL_ID = 0, string PROPOSAL_PNPS_CODEZZ = "", int PROPOSAL_KOMTEK_ID = 0, int[] PROPOSAL_ICS_REF_ICS_ID = null) { var DataProposal = (from proposal in db.VIEW_PROPOSAL where proposal.PROPOSAL_ID == PROPOSAL_ID select proposal).SingleOrDefault(); var PROPOSAL_PNPS_CODE = db.Database.SqlQuery <string>("SELECT CAST(TO_CHAR (SYSDATE, 'YYYY') || '.' || KOMTEK_CODE || '.' || ( SELECT CAST ( ( CASE WHEN LENGTH (COUNT(PROPOSAL_ID) + 1) = 1 THEN '0' || CAST ( COUNT (PROPOSAL_ID) + 1 AS VARCHAR2 (255) ) ELSE CAST ( COUNT (PROPOSAL_ID) + 1 AS VARCHAR2 (255) ) END ) AS VARCHAR2 (255) ) PNPSCODE FROM TRX_PROPOSAL WHERE PROPOSAL_KOMTEK_ID = KOMTEK_ID ) AS VARCHAR2(255)) AS PNPSCODE FROM MASTER_KOMITE_TEKNIS WHERE KOMTEK_ID = " + PROPOSAL_KOMTEK_ID).SingleOrDefault(); string test = "SELECT CAST(TO_CHAR (SYSDATE, 'YYYY') || '.' || KOMTEK_CODE || '.' || ( SELECT CAST ( ( CASE WHEN LENGTH (COUNT(PROPOSAL_ID) + 1) = 1 THEN '0' || CAST ( COUNT (PROPOSAL_ID) + 1 AS VARCHAR2 (255) ) ELSE CAST ( COUNT (PROPOSAL_ID) + 1 AS VARCHAR2 (255) ) END ) AS VARCHAR2 (255) ) PNPSCODE FROM TRX_PROPOSAL WHERE PROPOSAL_KOMTEK_ID = KOMTEK_ID ) AS VARCHAR2(255)) AS PNPSCODE FROM MASTER_KOMITE_TEKNIS WHERE KOMTEK_ID = " + PROPOSAL_KOMTEK_ID; var USER_ID = Convert.ToInt32(Session["USER_ID"]); var PROPOSAL_PNPS_CODE_FIXER = DataProposal.PROPOSAL_CODE; var DATENOW = MixHelper.ConvertDateNow(); db.Database.ExecuteSqlCommand("UPDATE TRX_PROPOSAL SET PROPOSAL_STATUS = 3, PROPOSAL_STATUS_PROSES = 1,PROPOSAL_KOMTEK_ID = " + PROPOSAL_KOMTEK_ID + ", PROPOSAL_IS_POLLING = 0, PROPOSAL_POLLING_ID = NULL, PROPOSAL_UPDATE_DATE = " + DATENOW + ", PROPOSAL_UPDATE_BY = " + USER_ID + " WHERE PROPOSAL_ID = " + PROPOSAL_ID); var PROPOSAL_LOG_CODE = db.Database.SqlQuery <string>("SELECT PROPOSAL_LOG_CODE FROM TRX_PROPOSAL WHERE PROPOSAL_ID = " + PROPOSAL_ID).SingleOrDefault(); String objek1 = "UPDATE TRX_PROPOSAL SET PROPOSAL_STATUS = 3,PROPOSAL_KOMTEK_ID = " + PROPOSAL_KOMTEK_ID + ", PROPOSAL_STATUS_PROSES = 1, PROPOSAL_IS_POLLING = 0, PROPOSAL_POLLING_ID = NULL, PROPOSAL_UPDATE_DATE = " + DATENOW + ", PROPOSAL_UPDATE_BY = " + USER_ID + " WHERE PROPOSAL_ID = " + PROPOSAL_ID; MixHelper.InsertLog(PROPOSAL_LOG_CODE, objek1.Replace("'", "-"), 2); int APPROVAL_ID = MixHelper.GetSequence("TRX_PROPOSAL_APPROVAL"); db.Database.ExecuteSqlCommand("UPDATE TRX_PROPOSAL_APPROVAL SET APPROVAL_STATUS = 0 WHERE APPROVAL_PROPOSAL_ID = " + PROPOSAL_ID); db.Database.ExecuteSqlCommand("INSERT INTO TRX_PROPOSAL_APPROVAL (APPROVAL_ID,APPROVAL_PROPOSAL_ID,APPROVAL_TYPE,APPROVAL_DATE,APPROVAL_BY,APPROVAL_STATUS,APPROVAL_STATUS_PROPOSAL,APPROVAL_STATUS_SESSION) VALUES (" + APPROVAL_ID + "," + PROPOSAL_ID + ",1," + DATENOW + "," + USER_ID + ",1,2,1)"); db.Database.ExecuteSqlCommand("UPDATE TRX_MONITORING SET MONITORING_TGL_APP_MTPS = " + DATENOW + ", MONITORING_HASIL_APP_MTPS = 1 WHERE MONITORING_PROPOSAL_ID = " + PROPOSAL_ID); int LASTID = MixHelper.GetSequence("TRX_DOCUMENTS"); var TGL_SEKARANG = DateTime.Now.ToString("yyyyMMddHHmmss"); var DataTanggapan = db.Database.SqlQuery <VIEW_POLLING_DETAIL>("SELECT * FROM VIEW_POLLING_DETAIL WHERE POLLING_DETAIL_POLLING_ID = " + DataProposal.PROPOSAL_POLLING_ID + " ORDER BY POLLING_DETAIL_INPUT_TYPE ASC,POLLING_DETAIL_CREATE_DATE DESC").ToList(); string path = Server.MapPath("~/Upload/Dokumen/RANCANGAN_SNI/MTPS/" + PROPOSAL_PNPS_CODE_FIXER + "/"); string dataFormat = Server.MapPath("~/Format/Laporan/"); Stream stream = System.IO.File.OpenRead(dataFormat + "FORMAT_TANGGAPAN_PUBLIKASI_MTPS.docx"); Aspose.Words.Document Tanggapan = new Aspose.Words.Document(stream); ReplaceHelper helper = new ReplaceHelper(Tanggapan); helper.Replace("JudulPNPS", DataProposal.PROPOSAL_JUDUL_PNPS); DateTime dt = Convert.ToDateTime(DataProposal.POLLING_START_DATE); helper.Replace("TanggalJP", dt.ToString("dd/MM/yyyy")); helper.Replace("RuangLingkupPNPS", DataProposal.PROPOSAL_RUANG_LINGKUP); Paragraph paragraph = new Paragraph(Tanggapan); DocumentBuilder builder = new DocumentBuilder(Tanggapan); Aspose.Words.Font font = builder.Font; font.Bold = false; font.Color = System.Drawing.Color.Black; font.Italic = false; font.Name = "Calibri"; font.Size = 11; builder.MoveToDocumentEnd(); var number = 0; string html = "<table width='100%' border='1' bordercolor='#111111' cellpadding='2' style='border-collapse: collapse' cellpadding='0' cellspacing='0'>" + "<tr>" + "<td width='5%' style='text-align:center'><b>No</b></td>" + "<td width='15%' style='text-align:center'><b>Nama</b></td>" + "<td width='15%' style='text-align:center'><b>Tipe tanggapan</b></td>" + "<td width='65%' style='text-align:center'><b>Tanggapan</b></td>" + "</tr>"; foreach (var i in DataTanggapan) { number++; html += "<tr>" + "<td>" + number + "</td>" + "<td>" + i.USER_PUBLIC_NAMA + "</td>" + "<td>" + i.POLLING_DETAIL_INPUT_TYPE_NAME + "</td>" + "<td>" + i.POLLING_DETAIL_REASON + "</td>" + "</tr>"; } html += "</table>"; builder.InsertHtml(html); Tanggapan.Save(@"" + path + "DAFTAR_TANGGAPAN_PUBLIKASI_USULAN_PNPS_" + PROPOSAL_PNPS_CODE_FIXER + "_" + TGL_SEKARANG + ".docx", Aspose.Words.SaveFormat.Docx); Tanggapan.Save(@"" + path + "DAFTAR_TANGGAPAN_PUBLIKASI_USULAN_PNPS_" + PROPOSAL_PNPS_CODE_FIXER + "_" + TGL_SEKARANG + ".pdf", Aspose.Words.SaveFormat.Pdf); Tanggapan.Save(@"" + path + "DAFTAR_TANGGAPAN_PUBLIKASI_USULAN_PNPS_" + PROPOSAL_PNPS_CODE_FIXER + "_" + TGL_SEKARANG + ".xml"); var LOGCODE_TANGGAPAN_MTPS = MixHelper.GetLogCode(); var FNAME_TANGGAPAN_MTPS = "DOC_ID,DOC_FOLDER_ID,DOC_RELATED_TYPE,DOC_RELATED_ID,DOC_NAME,DOC_DESCRIPTION,DOC_FILE_PATH,DOC_FILE_NAME,DOC_FILETYPE,DOC_EDITABLE,DOC_CREATE_BY,DOC_CREATE_DATE,DOC_STATUS,DOC_LOG_CODE"; var FVALUE_TANGGAPAN_MTPS = "'" + LASTID + "', " + "'10', " + "'1', " + "'" + PROPOSAL_ID + "', " + "'" + "(" + PROPOSAL_PNPS_CODE_FIXER + ") Daftar Tanggapan Publikasi Usulan PNPS" + "', " + "'Daftar Tanggapan Hasil Publikasi Usulan PNPS dengan Judul PNPS : " + DataProposal.PROPOSAL_JUDUL_PNPS + "', " + "'" + "/Upload/Dokumen/RANCANGAN_SNI/MTPS/" + PROPOSAL_PNPS_CODE_FIXER + "/" + "', " + "'" + "DAFTAR_TANGGAPAN_PUBLIKASI_USULAN_PNPS_" + PROPOSAL_PNPS_CODE_FIXER + "_" + TGL_SEKARANG + "" + "', " + "'DOCX', " + "'0', " + "'" + USER_ID + "', " + DATENOW + "," + "'1', " + "'" + LOGCODE_TANGGAPAN_MTPS + "'"; db.Database.ExecuteSqlCommand("INSERT INTO TRX_DOCUMENTS (" + FNAME_TANGGAPAN_MTPS + ") VALUES (" + FVALUE_TANGGAPAN_MTPS.Replace("''", "NULL") + ")"); String objekTanggapan = FVALUE_TANGGAPAN_MTPS.Replace("'", "-"); MixHelper.InsertLog(LOGCODE_TANGGAPAN_MTPS, objekTanggapan, 1); db.Database.ExecuteSqlCommand("UPDATE TRX_POLLING SET POLLING_IS_KUORUM = 1,POLLING_UPDATE_DATE = " + DATENOW + ", POLLING_UPDATE_BY = '" + USER_ID + "' WHERE POLLING_ID = " + DataProposal.PROPOSAL_POLLING_ID); TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data Berhasil Disimpan"; return(RedirectToAction("Index")); }
public ActionResult Comment(TRX_POLLING_DETAILS input, VIEW_POLLING VP, FormCollection form) { var GetIP = db.Database.SqlQuery <SYS_CONFIG>("SELECT * FROM SYS_CONFIG WHERE CONFIG_ID = 12").FirstOrDefault(); var GetUser = db.Database.SqlQuery <SYS_CONFIG>("SELECT * FROM SYS_CONFIG WHERE CONFIG_ID = 13").FirstOrDefault(); var GetPassword = db.Database.SqlQuery <SYS_CONFIG>("SELECT * FROM SYS_CONFIG WHERE CONFIG_ID = 14").FirstOrDefault(); var GetPath = db.Database.SqlQuery <SYS_CONFIG>("SELECT * FROM SYS_CONFIG WHERE CONFIG_ID = 15").FirstOrDefault(); var TGL_SEKARANG = DateTime.Now.ToString("yyyyMMddHHmmss"); string path = ""; string filePathpdf = ""; HttpPostedFileBase file4 = Request.Files["POLLING_FILE"]; if (file4.ContentLength > 0) { Directory.CreateDirectory(GetPath.CONFIG_VALUE + "/Upload/DokPolling"); path = GetPath.CONFIG_VALUE + "/Upload/DokPolling/"; Stream stremdokumen = file4.InputStream; byte[] appData = new byte[file4.ContentLength + 1]; stremdokumen.Read(appData, 0, file4.ContentLength); string Extension = Path.GetExtension(file4.FileName); if (Extension.ToLower() == ".pdf") { Aspose.Pdf.Document pdf = new Aspose.Pdf.Document(stremdokumen); //Aspose.Words.Document docx = new Aspose.Words.Document(stremdokumen); filePathpdf = path + "POLLING_" + VP.PROPOSAL_ID + "_" + TGL_SEKARANG + ".pdf"; pdf.Save(@"" + filePathpdf, Aspose.Pdf.SaveFormat.Pdf); } } using (OracleConnection con = new OracleConnection("Data Source=" + GetIP.CONFIG_VALUE + ";User ID=" + GetUser.CONFIG_VALUE + ";PASSWORD="******";")) { con.Open(); using (OracleCommand cmd = new OracleCommand()) { var pathnya = "/Upload/DokPolling/POLLING_" + VP.PROPOSAL_ID + "_" + TGL_SEKARANG + ".pdf"; var UserId = Session["USER_ID"]; var logcode = MixHelper.GetLogCode(); int lastid = MixHelper.GetSequence("TRX_POLLING_DETAILS"); var datenow = MixHelper.ConvertDateNow(); var year_now = DateTime.Now.Year; var fname = "POLLING_DETAIL_ID,POLLING_DETAIL_POLLING_ID,POLLING_DETAIL_REASON,POLLING_DETAIL_CREATE_BY,POLLING_DETAIL_CREATE_DATE,POLLING_DETAIL_STATUS,POLLING_DETAIL_FILE_PATH,POLLING_DETAIL_INPUT_TYPE"; cmd.Connection = con; cmd.CommandType = System.Data.CommandType.Text; cmd.CommandText = " INSERT INTO TRX_POLLING_DETAILS (" + fname + ") VALUES ('" + lastid + "','" + input.POLLING_DETAIL_POLLING_ID + "',:parameter," + UserId + "," + datenow + ",1,'" + pathnya + "',1) "; OracleParameter oracleParameterClob = new OracleParameter(); oracleParameterClob.OracleDbType = OracleDbType.Clob; //1 million long string oracleParameterClob.Value = input.POLLING_DETAIL_REASON; cmd.Parameters.Add(oracleParameterClob); cmd.ExecuteNonQuery(); db.Database.ExecuteSqlCommand("UPDATE TRX_POLLING TP SET TP.POLLING_JML_PARTISIPAN = (TP.POLLING_JML_PARTISIPAN + 1) WHERE TP.POLLING_ID =" + input.POLLING_DETAIL_POLLING_ID); TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Terima kasih, pendapat anda berhasil di simpan."; } con.Close(); var proposal_id = Convert.ToInt32(form["PROPOSAL_ID"]); return(RedirectToAction("Comment/" + proposal_id)); } }
public ActionResult Edit(MASTER_TAS mt, int[] ICS_ID, string[] TAS_EDUCATION_INSTITUSI, string[] TAS_EDUCATION_YEAR, string[] TAS_EDUCATION_PRODI, string[] TAS_RIWAYAT_INSTITUSI_NAME, string[] TAS_RIWAYAT_TAHUN, string[] TAS_RIWAYAT_BIDANG_JABATAN, string[] TAS_RIWAYAT_JENIS_PELATIHAN, string[] TAS_RIWAYAT_TAHUN_PEL, string[] TAS_RIWAYAT_PENYELENGGARA, string[] TAS_RIWAYAT_PENGALAMAN) { var UserId = Session["USER_ID"]; var logcode = MixHelper.GetLogCode(); //int lastid = MixHelper.GetSequence("TRX_SNI"); int last_id = MixHelper.GetSequence("MASTER_TAS"); var datenow = MixHelper.ConvertDateNow(); //var fname = "TAS_ID,TAS_NAME,TAS_INSTANSI_ID,TAS_ADDRESS,TAS_PHONE,TAS_FAX,TAS_OFFICE_ADDRESS,TAS_OFFICE_PHONE,TAS_HANDPHONE,TAS_EMAIL,TAS_CREATE_BY,TAS_CREATE_DATE,TAS_STATUS,TAS_LOG_CODE"; var value = "TAS_NAME = '" + mt.TAS_NAME + "'," + "TAS_INSTANSI_ID = '" + mt.TAS_INSTANSI_ID + "'," + "TAS_ADDRESS = '" + mt.TAS_ADDRESS + "'," + "TAS_PHONE = '" + mt.TAS_PHONE + "'," + "TAS_FAX = '" + mt.TAS_FAX + "'," + "TAS_OFFICE_ADDRESS ='" + mt.TAS_OFFICE_ADDRESS + "'," + "TAS_OFFICE_PHONE ='" + mt.TAS_OFFICE_PHONE + "'," + "TAS_HANDPHONE ='" + mt.TAS_HANDPHONE + "'," + "TAS_EMAIL ='" + mt.TAS_EMAIL + "'," + "TAS_UPDATE_BY ='" + UserId + "'," + "TAS_UPDATE_DATE =" + datenow + "," + "TAS_LOG_CODE =" + logcode + ""; var clause = " WHERE TAS_ID =" + mt.TAS_ID; //db.Database.ExecuteSqlCommand("INSERT INTO MASTER_TAS (" + fname + ") VALUES (" + value.Replace("''", "NULL") + ")"); db.Database.ExecuteSqlCommand("UPDATE MASTER_TAS SET " + value.Replace("''", "NULL") + " " + clause); //return Json(new //{ // aaData = "UPDATE MASTER_TAS SET " + value.Replace("''", "NULL") + " " + clause //}, JsonRequestBehavior.AllowGet); if (ICS_ID != null) { var updates = "TAS_DETAIL_ICS_STATUS=0"; var clauses = "WHERE TAS_DETAIL_ICS_TAS_ID = " + mt.TAS_ID; db.Database.ExecuteSqlCommand("UPDATE MASTER_TAS_DETAIL_ICS SET " + updates.Replace("''", "NULL") + " " + clauses); foreach (var TAS_ICS_ID in ICS_ID) { var jml = db.Database.ExecuteSqlCommand("SELECT COUNT(*) FROM MASTER_TAS_DETAIL_ICS WHERE TAS_DETAIL_ICS_ICS_ID =" + TAS_ICS_ID + " AND TAS_DETAIL_ICS_TAS_ID =" + mt.TAS_ID); if (jml == 0) { int lastid_mTDI = MixHelper.GetSequence("MASTER_TAS_DETAIL_ICS"); string query_create = "INSERT INTO MASTER_TAS_DETAIL_ICS (TAS_DETAIL_ICS_ID,TAS_DETAIL_ICS_TAS_ID,TAS_DETAIL_ICS_ICS_ID,TAS_DETAIL_ICS_STATUS) VALUES (" + lastid_mTDI + "," + mt.TAS_ID + "," + TAS_ICS_ID + ",1)"; db.Database.ExecuteSqlCommand(query_create); } else { var query_update = "TAS_DETAIL_ICS_STATUS=1"; var query_clause = "WHERE TAS_DETAIL_ICS_TAS_ID = '" + mt.TAS_ID + "' AND TAS_DETAIL_ICS_ICS_ID=" + TAS_ICS_ID; db.Database.ExecuteSqlCommand("UPDATE MASTER_TAS_DETAIL_ICS SET " + query_update.Replace("''", "NULL") + " " + query_clause); } } } if (TAS_EDUCATION_INSTITUSI.Count() > 0) { db.Database.ExecuteSqlCommand("DELETE FROM MASTER_TAS_EDUCATION WHERE TAS_EDUCATION_TAS_ID = " + mt.TAS_ID); var fnameSS = "TAS_EDUCATION_ID," + "TAS_EDUCATION_TAS_ID," + "TAS_EDUCATION_INSTITUSI," + "TAS_EDUCATION_YEAR," + "TAS_EDUCATION_PRODI," + "TAS_EDUCATION_STATUS"; for (var i = 0; i < TAS_EDUCATION_INSTITUSI.Count(); i++) { int lastidxx = MixHelper.GetSequence("MASTER_TAS_EDUCATION"); //var jml = db.Database.ExecuteSqlCommand("SELECT COUNT(*) FROM MASTER_TAS_EDUCATION WHERE TAS_EDUCATION_TAS_ID =" + mt.TAS_ID); //var logcodeSS = MixHelper.GetLogCode(); //decimal amount = Convert.ToDecimal(Price[i].Replace(",", "")) * Convert.ToDecimal(QtyOpname[i].Replace(",", "")); var fvalueSS = "'" + lastidxx + "'," + "'" + mt.TAS_ID + "'," + "'" + TAS_EDUCATION_INSTITUSI[i] + "'," + "'" + TAS_EDUCATION_YEAR[i] + "'," + "'" + TAS_EDUCATION_PRODI[i] + "'," + "1"; db.Database.ExecuteSqlCommand("INSERT INTO MASTER_TAS_EDUCATION (" + fnameSS + ") VALUES (" + fvalueSS.Replace("''", "NULL") + ")"); } } if (TAS_RIWAYAT_INSTITUSI_NAME.Count() > 0) { db.Database.ExecuteSqlCommand("DELETE FROM MASTER_TAS_RIWAYAT WHERE TAS_RIWAYAT_TAS_ID = " + mt.TAS_ID + " AND TAS_RIWAYAT_TYPE = 1"); var fnameSSS = "TAS_RIWAYAT_ID," + "TAS_RIWAYAT_TAS_ID," + "TAS_RIWAYAT_TYPE," + "TAS_RIWAYAT_INSTITUSI_NAME," + "TAS_RIWAYAT_TAHUN," + "TAS_RIWAYAT_BIDANG_JABATAN," + "TAS_RIWAYAT_STATUS"; for (var i = 0; i < TAS_RIWAYAT_INSTITUSI_NAME.Count(); i++) { int lastidxxx = MixHelper.GetSequence("MASTER_TAS_RIWAYAT"); //var logcodeSS = MixHelper.GetLogCode(); //decimal amount = Convert.ToDecimal(Price[i].Replace(",", "")) * Convert.ToDecimal(QtyOpname[i].Replace(",", "")); var fvalueSSS = "'" + lastidxxx + "'," + "'" + mt.TAS_ID + "'," + "1," + "'" + TAS_RIWAYAT_INSTITUSI_NAME[i] + "'," + "'" + TAS_RIWAYAT_TAHUN[i] + "'," + "'" + TAS_RIWAYAT_BIDANG_JABATAN[i] + "'," + "1"; db.Database.ExecuteSqlCommand("INSERT INTO MASTER_TAS_RIWAYAT (" + fnameSSS + ") VALUES (" + fvalueSSS.Replace("''", "NULL") + ")"); } } if (TAS_RIWAYAT_JENIS_PELATIHAN.Count() > 0) { db.Database.ExecuteSqlCommand("DELETE FROM MASTER_TAS_RIWAYAT WHERE TAS_RIWAYAT_TAS_ID = " + mt.TAS_ID + " AND TAS_RIWAYAT_TYPE = 2"); var fnameSSS = "TAS_RIWAYAT_ID," + "TAS_RIWAYAT_TAS_ID," + "TAS_RIWAYAT_TYPE," + "TAS_RIWAYAT_TAHUN," + "TAS_RIWAYAT_JENIS_PELATIHAN," + "TAS_RIWAYAT_PENYELENGGARA," + "TAS_RIWAYAT_STATUS"; for (var i = 0; i < TAS_RIWAYAT_JENIS_PELATIHAN.Count(); i++) { int lastidxxxx = MixHelper.GetSequence("MASTER_TAS_RIWAYAT"); //var logcodeSS = MixHelper.GetLogCode(); //decimal amount = Convert.ToDecimal(Price[i].Replace(",", "")) * Convert.ToDecimal(QtyOpname[i].Replace(",", "")); var fvalueSSS = "'" + lastidxxxx + "'," + "'" + mt.TAS_ID + "'," + "2," + "'" + TAS_RIWAYAT_TAHUN_PEL[i] + "'," + "'" + TAS_RIWAYAT_JENIS_PELATIHAN[i] + "'," + "'" + TAS_RIWAYAT_PENYELENGGARA[i] + "'," + "1"; db.Database.ExecuteSqlCommand("INSERT INTO MASTER_TAS_RIWAYAT (" + fnameSSS + ") VALUES (" + fvalueSSS.Replace("''", "NULL") + ")"); } } if (TAS_RIWAYAT_PENGALAMAN.Count() > 0) { db.Database.ExecuteSqlCommand("DELETE FROM MASTER_TAS_RIWAYAT WHERE TAS_RIWAYAT_TAS_ID = " + mt.TAS_ID + " AND TAS_RIWAYAT_TYPE = 3"); var fnameSSS = "TAS_RIWAYAT_ID," + "TAS_RIWAYAT_TAS_ID," + "TAS_RIWAYAT_TYPE," + "TAS_RIWAYAT_PENGALAMAN," + "TAS_RIWAYAT_STATUS"; for (var i = 0; i < TAS_RIWAYAT_PENGALAMAN.Count(); i++) { int lastidxxxxx = MixHelper.GetSequence("MASTER_TAS_RIWAYAT"); //var logcodeSS = MixHelper.GetLogCode(); //decimal amount = Convert.ToDecimal(Price[i].Replace(",", "")) * Convert.ToDecimal(QtyOpname[i].Replace(",", "")); var fvalueSSS = "'" + lastidxxxxx + "'," + "'" + mt.TAS_ID + "'," + "3," + "'" + TAS_RIWAYAT_PENGALAMAN[i] + "'," + "1"; db.Database.ExecuteSqlCommand("INSERT INTO MASTER_TAS_RIWAYAT (" + fnameSSS + ") VALUES (" + fvalueSSS.Replace("''", "NULL") + ")"); } } TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data Berhasil Disimpan"; return(RedirectToAction("Index")); }
public ActionResult Create(MASTER_TAS mt, int[] ICS_ID, string[] TAS_EDUCATION_INSTITUSI, string[] TAS_EDUCATION_YEAR, string[] TAS_EDUCATION_PRODI, string[] TAS_RIWAYAT_INSTITUSI_NAME, string[] TAS_RIWAYAT_TAHUN, string[] TAS_RIWAYAT_BIDANG_JABATAN, string[] TAS_RIWAYAT_JENIS_PELATIHAN, string[] TAS_RIWAYAT_TAHUN_PEL, string[] TAS_RIWAYAT_PENYELENGGARA, string[] TAS_RIWAYAT_PENGALAMAN) { var UserId = Session["USER_ID"]; var logcode = MixHelper.GetLogCode(); //int lastid = MixHelper.GetSequence("TRX_SNI"); int last_id = MixHelper.GetSequence("MASTER_TAS"); var datenow = MixHelper.ConvertDateNow(); var fname = "TAS_ID,TAS_NAME,TAS_INSTANSI_ID,TAS_ADDRESS,TAS_PHONE,TAS_FAX,TAS_OFFICE_ADDRESS,TAS_OFFICE_PHONE,TAS_HANDPHONE,TAS_EMAIL,TAS_CREATE_BY,TAS_CREATE_DATE,TAS_STATUS,TAS_LOG_CODE"; var value = "'" + last_id + "', " + "'" + mt.TAS_NAME + "'," + "'" + mt.TAS_INSTANSI_ID + "'," + "'" + mt.TAS_ADDRESS + "'," + "'" + mt.TAS_PHONE + "'," + "'" + mt.TAS_FAX + "'," + "'" + mt.TAS_OFFICE_ADDRESS + "'," + "'" + mt.TAS_OFFICE_PHONE + "'," + "'" + mt.TAS_HANDPHONE + "'," + "'" + mt.TAS_EMAIL + "'," + "'" + UserId + "'," + "" + datenow + "," + "1," + "" + logcode + ""; db.Database.ExecuteSqlCommand("INSERT INTO MASTER_TAS (" + fname + ") VALUES (" + value.Replace("''", "NULL") + ")"); if (ICS_ID != null) { foreach (var TAS_ICS_ID in ICS_ID) { var logcodeS = MixHelper.GetLogCode(); int lastid_mTDI = MixHelper.GetSequence("MASTER_TAS_DETAIL_ICS"); string query_create = "INSERT INTO MASTER_TAS_DETAIL_ICS (TAS_DETAIL_ICS_ID,TAS_DETAIL_ICS_TAS_ID,TAS_DETAIL_ICS_ICS_ID,TAS_DETAIL_ICS_STATUS) VALUES (" + lastid_mTDI + "," + last_id + "," + TAS_ICS_ID + ",1)"; db.Database.ExecuteSqlCommand(query_create); } } if (TAS_EDUCATION_INSTITUSI.Count() > 0) { var fnameSS = "TAS_EDUCATION_ID," + "TAS_EDUCATION_TAS_ID," + "TAS_EDUCATION_INSTITUSI," + "TAS_EDUCATION_YEAR," + "TAS_EDUCATION_PRODI," + "TAS_EDUCATION_STATUS"; for (var i = 0; i < TAS_EDUCATION_INSTITUSI.Count(); i++) { int lastidxx = MixHelper.GetSequence("MASTER_TAS_EDUCATION"); //var logcodeSS = MixHelper.GetLogCode(); //decimal amount = Convert.ToDecimal(Price[i].Replace(",", "")) * Convert.ToDecimal(QtyOpname[i].Replace(",", "")); var fvalueSS = "'" + lastidxx + "'," + "'" + last_id + "'," + "'" + TAS_EDUCATION_INSTITUSI[i] + "'," + "'" + TAS_EDUCATION_YEAR[i] + "'," + "'" + TAS_EDUCATION_PRODI[i] + "'," + "1"; db.Database.ExecuteSqlCommand("INSERT INTO MASTER_TAS_EDUCATION (" + fnameSS + ") VALUES (" + fvalueSS.Replace("''", "NULL") + ")"); } } if (TAS_RIWAYAT_INSTITUSI_NAME.Count() > 0) { var fnameSSS = "TAS_RIWAYAT_ID," + "TAS_RIWAYAT_TAS_ID," + "TAS_RIWAYAT_TYPE," + "TAS_RIWAYAT_INSTITUSI_NAME," + "TAS_RIWAYAT_TAHUN," + "TAS_RIWAYAT_BIDANG_JABATAN," + "TAS_RIWAYAT_STATUS"; for (var i = 0; i < TAS_RIWAYAT_INSTITUSI_NAME.Count(); i++) { int lastidxxx = MixHelper.GetSequence("MASTER_TAS_RIWAYAT"); //var logcodeSS = MixHelper.GetLogCode(); //decimal amount = Convert.ToDecimal(Price[i].Replace(",", "")) * Convert.ToDecimal(QtyOpname[i].Replace(",", "")); var fvalueSSS = "'" + lastidxxx + "'," + "'" + last_id + "'," + "1," + "'" + TAS_RIWAYAT_INSTITUSI_NAME[i] + "'," + "'" + TAS_RIWAYAT_TAHUN[i] + "'," + "'" + TAS_RIWAYAT_BIDANG_JABATAN[i] + "'," + "1"; db.Database.ExecuteSqlCommand("INSERT INTO MASTER_TAS_RIWAYAT (" + fnameSSS + ") VALUES (" + fvalueSSS.Replace("''", "NULL") + ")"); } } if (TAS_RIWAYAT_JENIS_PELATIHAN.Count() > 0) { var fnameSSS = "TAS_RIWAYAT_ID," + "TAS_RIWAYAT_TAS_ID," + "TAS_RIWAYAT_TYPE," + "TAS_RIWAYAT_TAHUN," + "TAS_RIWAYAT_JENIS_PELATIHAN," + "TAS_RIWAYAT_PENYELENGGARA," + "TAS_RIWAYAT_STATUS"; for (var i = 0; i < TAS_RIWAYAT_JENIS_PELATIHAN.Count(); i++) { int lastidxxxx = MixHelper.GetSequence("MASTER_TAS_RIWAYAT"); //var logcodeSS = MixHelper.GetLogCode(); //decimal amount = Convert.ToDecimal(Price[i].Replace(",", "")) * Convert.ToDecimal(QtyOpname[i].Replace(",", "")); var fvalueSSS = "'" + lastidxxxx + "'," + "'" + last_id + "'," + "2," + "'" + TAS_RIWAYAT_TAHUN_PEL[i] + "'," + "'" + TAS_RIWAYAT_JENIS_PELATIHAN[i] + "'," + "'" + TAS_RIWAYAT_PENYELENGGARA[i] + "'," + "1"; db.Database.ExecuteSqlCommand("INSERT INTO MASTER_TAS_RIWAYAT (" + fnameSSS + ") VALUES (" + fvalueSSS.Replace("''", "NULL") + ")"); } } if (TAS_RIWAYAT_PENGALAMAN.Count() > 0) { var fnameSSS = "TAS_RIWAYAT_ID," + "TAS_RIWAYAT_TAS_ID," + "TAS_RIWAYAT_TYPE," + "TAS_RIWAYAT_PENGALAMAN," + "TAS_RIWAYAT_STATUS"; for (var i = 0; i < TAS_RIWAYAT_PENGALAMAN.Count(); i++) { int lastidxxxxx = MixHelper.GetSequence("MASTER_TAS_RIWAYAT"); //var logcodeSS = MixHelper.GetLogCode(); //decimal amount = Convert.ToDecimal(Price[i].Replace(",", "")) * Convert.ToDecimal(QtyOpname[i].Replace(",", "")); var fvalueSSS = "'" + lastidxxxxx + "'," + "'" + last_id + "'," + "3," + "'" + TAS_RIWAYAT_PENGALAMAN[i] + "'," + "1"; db.Database.ExecuteSqlCommand("INSERT INTO MASTER_TAS_RIWAYAT (" + fnameSSS + ") VALUES (" + fvalueSSS.Replace("''", "NULL") + ")"); } } TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data Berhasil Disimpan"; return(RedirectToAction("Index")); }