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_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 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 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 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_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(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 Aktif(int id) { var UserId = Session["USER_ID"]; var datenow = MixHelper.ConvertDateNow(); var idsk = id; db.Database.ExecuteSqlCommand("UPDATE TRX_SNI SET SNI_STATUS = 1, SNI_UPDATE_BY = " + UserId + ", SNI_UPDATE_DATE = " + datenow + " WHERE SNI_ID = " + idsk); TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data Berhasil Diaktifkan"; return(RedirectToAction("Index")); }
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(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 Update(string USER_INTERN_FULLNAME = "", string USER_INTERN_PHONE = "", string USER_INTERN_EMAIL = "", string USER_INTERN_ADDRESS = "", string USER_NAME = "", int USER_ID = 0, int USER_REF_ID = 0, int USER_TYPE_ID = 0) { var checkemail = db.SYS_USER.SqlQuery("SELECT * FROM SYS_USER WHERE USER_NAME = '" + USER_NAME + "' AND USER_STATUS = 1 AND USER_ID != " + USER_ID).Count(); if (checkemail > 0) { TempData["Notifikasi"] = 2; TempData["NotifikasiText"] = "Terjadi duplikasi data dengan Username : "******"Index", new { id = "1" })); } else { var UserId = USER_ID; var datenow = MixHelper.ConvertDateNow(); var fupdate1 = "USER_NAME = '" + USER_NAME + "'," + "USER_UPDATE_BY = '" + UserId + "'," + "USER_UPDATE_DATE = " + datenow; db.Database.ExecuteSqlCommand("UPDATE SYS_USER SET " + fupdate1 + " WHERE USER_ID = " + USER_ID); if (USER_TYPE_ID == 1) { var fupdate2 = "USER_INTERN_FULLNAME = '" + USER_INTERN_FULLNAME + "'," + "USER_INTERN_ADDRESS = '" + USER_INTERN_ADDRESS + "'," + "USER_INTERN_EMAIL = '" + USER_INTERN_EMAIL + "'," + "USER_INTERN_PHONE = '" + USER_INTERN_PHONE + "'," + "USER_INTERN_UPDATE_BY = '" + UserId + "'," + "USER_INTERN_UPDATE_DATE = " + datenow; db.Database.ExecuteSqlCommand("UPDATE SYS_USER_INTERN SET " + fupdate2 + " WHERE USER_INTERN_ID = " + USER_REF_ID); String objek = fupdate2.Replace("'", "-"); } else { var fupdate2 = "KOMTEK_ANGGOTA_NAMA = '" + USER_INTERN_FULLNAME + "'," + "KOMTEK_ANGGOTA_ADDRESS = '" + USER_INTERN_ADDRESS + "'," + "KOMTEK_ANGGOTA_EMAIL = '" + USER_INTERN_EMAIL + "'," + "KOMTEK_ANGGOTA_TELP = '" + USER_INTERN_PHONE + "'," + "KOMTEK_ANGGOTA_UPDATE_BY = '" + UserId + "'," + "KOMTEK_ANGGOTA_UPDATE_DATE = " + datenow; db.Database.ExecuteSqlCommand("UPDATE MASTER_KOMTEK_ANGGOTA SET " + fupdate2 + " WHERE KOMTEK_ANGGOTA_KODE = " + USER_REF_ID); String objek = fupdate2.Replace("'", "-"); } //MixHelper.InsertLog(logcode, objek, 1); TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data Berhasil Disimpan"; return(RedirectToAction("Index", new { id = "1" })); } }
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 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 ChangePassword(int USER_ID = 0, int USER_REF_ID = 0, string oldpassword = "", string USER_PASSWORD = "", string RE_USER_PASSWORD = "", string USER_EMAIL = "") { if (USER_PASSWORD == RE_USER_PASSWORD) { var DataUser = db.Database.SqlQuery <VIEW_USERS>("SELECT * FROM VIEW_USERS WHERE USER_ID = " + USER_ID).FirstOrDefault(); if (GenPassword(oldpassword) == DataUser.USER_PASSWORD) { var UserId = USER_ID; var datenow = MixHelper.ConvertDateNow(); var fupdate1 = "USER_PASSWORD = '******'," + "USER_UPDATE_BY = '" + UserId + "'," + "USER_UPDATE_DATE = " + datenow; db.Database.ExecuteSqlCommand("UPDATE SYS_USER SET " + fupdate1 + " WHERE USER_ID = " + USER_ID); //String objek = fupdate1.Replace("'", "-"); //MixHelper.InsertLog(logcode, objek, 1); //Send Account Activation to Email var email = (from t in db.SYS_EMAIL where t.EMAIL_IS_USE == 1 select t).SingleOrDefault(); SendMailHelper.MailUsername = email.EMAIL_NAME; //"*****@*****.**"; SendMailHelper.MailPassword = email.EMAIL_PASSWORD; //"r4h45143uy"; SendMailHelper mailer = new SendMailHelper(); mailer.ToEmail = USER_EMAIL; mailer.Subject = "Authentifikasi Perubahan Password Anggota Komtek - SISPK"; var isiEmail = "Selamat password anda sekarang diubah menjadi seperti di bawah ini : <br />"; isiEmail += "Username : "******"<br />"; isiEmail += "Password : "******"<br />"; isiEmail += "Demikian Informasi yang kami sampaikan, atas kerjasamanya kami ucapkan terimakasih. <br />"; isiEmail += "<span style='text-align:right;font-weight:bold;margin-top:20px;'>Web Administrator</span>"; mailer.Body = isiEmail; mailer.IsHtml = true; mailer.Send(); TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data Berhasil Disimpan"; } else { TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data Gagal Disimpan Password Lama Salah"; } } else { TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data Gagal Disimpan Password baru tidak sama"; } return(RedirectToAction("Index", new { id = "2" })); }
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 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 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 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 Edit(SYS_CONFIG config) { var UserId = Session["USER_ID"]; var datenow = MixHelper.ConvertDateNow(); var logcode = config.CONFIG_LOG_CODE; var fupdate = "CONFIG_NAME = '" + config.CONFIG_NAME + "'," + "CONFIG_VALUE = '" + config.CONFIG_VALUE + "'," + "CONFIG_UPDATE_BY = '" + UserId + "'," + "CONFIG_UPDATE_DATE = " + datenow; db.Database.ExecuteSqlCommand("UPDATE SYS_CONFIG SET " + fupdate + " WHERE CONFIG_ID = " + config.CONFIG_ID); String objek = fupdate.Replace("'", "-"); MixHelper.InsertLog(logcode, objek, 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_ICS ics) { var UserId = Session["USER_ID"]; var logcode = ics.ICS_LOG_CODE; var datenow = MixHelper.ConvertDateNow(); var fupdate = "ICS_PARENT_CODE = '" + ics.ICS_PARENT_CODE + "'," + "ICS_CODE = '" + ics.ICS_CODE + "'," + "ICS_NAME = '" + ics.ICS_NAME + "'," + "ICS_NAME_IND = '" + ics.ICS_NAME_IND + "'," + //"ICS_YEAR = '" + ics.ICS_YEAR + "'," + "ICS_UPDATE_BY = '" + UserId + "'," + "ICS_UPDATE_DATE = " + datenow; db.Database.ExecuteSqlCommand("UPDATE MASTER_ICS SET " + fupdate + " WHERE ICS_ID = '" + ics.ICS_ID + "'"); String objek = fupdate.Replace("'", "-"); MixHelper.InsertLog(logcode, objek, 1); TempData["Notifikasi"] = 1; TempData["NotifikasiText"] = "Data Berhasil Disimpan"; 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 Edit(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 AND USER_ID != " + sys_users.USER_ID).Count(); if (checkemail > 0) { TempData["Notifikasi"] = 2; TempData["NotifikasiText"] = "Terjadi duplikasi data dengan Uername : " + sys_users.USER_NAME; return(RedirectToAction("Edit/" + sys_users.USER_ID)); } else { var UserId = Session["USER_ID"]; var datenow = MixHelper.ConvertDateNow(); var fupdate1 = "USER_ACCESS_ID = '" + sys_users.USER_ACCESS_ID + "'," + "USER_NAME = '" + sys_users.USER_NAME + "'," + //"USER_PASSWORD = '******'," + "USER_UPDATE_BY = '" + UserId + "'," + "USER_UPDATE_DATE = " + datenow; var fupdate2 = "USER_INTERN_FULLNAME = '" + sys_users_intern.USER_INTERN_FULLNAME + "'," + "USER_INTERN_ADDRESS = '" + sys_users_intern.USER_INTERN_ADDRESS + "'," + "USER_INTERN_EMAIL = '" + sys_users_intern.USER_INTERN_EMAIL + "'," + "USER_INTERN_PHONE = '" + sys_users_intern.USER_INTERN_PHONE + "'," + "USER_INTERN_UPDATE_BY = '" + UserId + "'," + "USER_INTERN_UPDATE_DATE = " + datenow; //return Json(new { query1 = "UPDATE SYS_USER SET " + fupdate1 + " WHERE USER_ID = " + sys_users.USER_ID, query2 = "UPDATE SYS_USER_INTERN SET " + fupdate2 + " WHERE USER_INTERN_ID = " + sys_users_intern.USER_INTERN_ID}, JsonRequestBehavior.AllowGet); db.Database.ExecuteSqlCommand("UPDATE SYS_USER SET " + fupdate1 + " WHERE USER_ID = " + sys_users.USER_ID); db.Database.ExecuteSqlCommand("UPDATE SYS_USER_INTERN SET " + fupdate2 + " WHERE USER_INTERN_ID = " + sys_users_intern.USER_INTERN_ID); String objek = fupdate2.Replace("'", "-"); //MixHelper.InsertLog(logcode, objek, 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 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)); } }