private void getData() { ActivityLog log = new ActivityLog(); ActivityLogBll logBll = new ActivityLogBll(); string host = Request.UserHostName; string ipaddress = Request.UserHostAddress; string userName = Session["user"].ToString(); if (String.IsNullOrEmpty(ipaddress)) { ipaddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } log.HostName = host; log.IPAddress = ipaddress; log.Action = "get data supplier"; log.UserName = userName; try { var branchCode = ((wcf_auth.GeneralUserProfile)SessionCheck.Check(Response, Session["userprofile"])).mAuthObjectValueList.FirstOrDefault(t => t.mAuthObjectName == "REGION").Value1; gvPenyalur.DataSource = bll.getData(branchCode.ToString()); gvPenyalur.DataBind(); log.Type = "S"; log.Description = "get data supplier cabang " + branchCode.ToString() + " sukses"; } catch (Exception Ex) { log.Type = "E"; log.Description = " get data supplier error :" + Ex.Message; ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('" + HttpUtility.JavaScriptStringEncode(log.Description) + "');", true); } finally { logBll.InsertActivity(log); } }
protected void SAVE_Click(object sender, EventArgs e) { string id = Session["proposal_number"].ToString(); ActivityLog log = new ActivityLog(); ActivityLogBll logBll = new ActivityLogBll(); string host = Request.UserHostName; string ipaddress = Request.UserHostAddress; string userName = Session["user"].ToString(); if (String.IsNullOrEmpty(ipaddress)) { ipaddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } log.HostName = host; log.IPAddress = ipaddress; log.Action = "save jadwal pembayaran"; log.UserName = userName; try { bll.prosesData(id); log.Type = "S"; log.Description = log.Action + " " + id + " sukses oleh :" + userName; Response.Redirect("JadwalPembayaran.aspx"); } catch (Exception ex) { log.Type = "E"; log.Description = log.Action + " error :" + ex.Message; } finally { logBll.InsertActivity(log); } }
protected void gvPersetujuan_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { ActivityLog log = new ActivityLog(); ActivityLogBll logBll = new ActivityLogBll(); string host = Request.UserHostName; string ipaddress = Request.UserHostAddress; string userName = Session["user"].ToString(); if (String.IsNullOrEmpty(ipaddress)) { ipaddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } log.HostName = host; log.IPAddress = ipaddress; log.Action = "Persetujuan "; log.UserName = userName; try { string approval_result = e.NewValues["approval_result"].ToString(); //string approval_result_date = e.NewValues["approval_result_date"].ToString(); string granted_amount; try { granted_amount = e.NewValues["granted_amount"].ToString(); } catch { granted_amount = "0"; } if (approval_result == "0") { granted_amount = "0"; } Hashtable ht = new Hashtable(); var id = e.Keys["id"].ToString(); ht.Add("@approval_result-smallint", approval_result); ht.Add("@granted_amount-decimal", granted_amount); ht.Add("@id-int", id); ht.Add("@approved_by-varchar-99", Session["user"]); bll1.SetApproval(ht); log.Type = "S"; log.Description = log.Action + ' ' + id + ' ' + "Sukses oleh id" + ' ' + userName; e.Cancel = true; gvPersetujuan.CancelEdit(); GetData(); } catch (Exception ex) { log.Type = "E"; log.Description = "Persetujuan Gagal : " + ex.Message; } finally { logBll.InsertActivity(log); } }
protected void btnUpdate_Click(object sender, EventArgs e) { ActivityLog log = new ActivityLog(); ActivityLogBll logBll = new ActivityLogBll(); string host = Request.UserHostName; string ipaddress = Request.UserHostAddress; string userName = Session["user"].ToString(); if (String.IsNullOrEmpty(ipaddress)) { ipaddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } log.HostName = host; log.IPAddress = ipaddress; log.Action = "Update Data Administrasi"; log.UserName = userName; try { Hashtable ht = new Hashtable(); ht.Add("@company_longterm_plan-text", mmRJPP.Text); ht.Add("@company_wbs-text", mmRKAP.Text); ht.Add("@adds_workforce-int", txtTambahTenaga.Text); ht.Add("@is_purchasing_machinary-bit", cbbMesin.Value.ToString()); ht.Add("@is_purchasing_materials-bit", cbbBahanBaku.Value.ToString()); ht.Add("@is_purchasing_tools-bit", cbbPeralatan.Value.ToString()); ht.Add("@is_attending_mg_course-bit", cbbKursus.Value.ToString()); ht.Add("@is_developing_workplace-bit", cbbTempatUsaha.Value.ToString()); ht.Add("@is_upgrading_skill-bit", cbbKeterampilan.Value.ToString()); ht.Add("@is_paying_loan-bit", cbbPinjaman.Value.ToString()); ht.Add("@has_other_plans-bit", cbbRencana.Value.ToString()); ht.Add("@machinary_purchase-decimal", txtMesin.Text); ht.Add("@material_purchases-decimal", txtBahanBaku.Text); ht.Add("@tool_purchases-decimal", txtPeralatan.Text); ht.Add("@mg_course_cost-decimal", txtKursus.Text); ht.Add("@workplace_development_cost-decimal", txtTempatUsaha.Text); ht.Add("@skill_upgrade_cost-decimal", txtKeterampilan.Text); ht.Add("@loan_payment-decimal", txtPinjaman.Text); ht.Add("@other_plans_cost-decimal", txtRencana.Text); ht.Add("@mitra_id-int", Session["mitraid"]); ht.Add("@modified_by-varchar-64", Session["user"]); bll.updateData(ht); log.Type = "S"; log.Description = log.Action + " mitra id " + Session["mitraid"].ToString() + " sukses oleh " + userName; GetData(); ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('" + HttpUtility.JavaScriptStringEncode(log.Description) + "');", true); } catch (Exception ex) { log.Type = "E"; log.Description = "update data administrasi error : " + ex.Message; ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('" + HttpUtility.JavaScriptStringEncode(log.Description) + "');", true); } finally { logBll.InsertActivity(log); } }
protected void gvPersetujuan_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { ActivityLog log = new ActivityLog(); ActivityLogBll logBll = new ActivityLogBll(); string host = Request.UserHostName; string ipaddress = Request.UserHostAddress; string userName = Session["user"].ToString(); if (String.IsNullOrEmpty(ipaddress)) { ipaddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } log.HostName = host; log.IPAddress = ipaddress; log.Action = "Insert Persetujuan Hibah"; log.UserName = userName; try { Hashtable ht = new Hashtable(); var regDate = DateTime.Parse(e.NewValues["registration_date"].ToString()); var branchCode = ((wcf_auth.GeneralUserProfile)Session["userprofile"]).mAuthObjectValueList.FirstOrDefault(t => t.mAuthObjectName == "REGION").Value1; ht.Add("@proposal_number-varchar-99", e.NewValues["proposal_number"] ?? ""); ht.Add("@registration_date-varchar-10", regDate.ToString("MM/dd/yyyy") ?? ""); ht.Add("@requestor_name-varchar-99", e.NewValues["requestor_name"] ?? ""); ht.Add("@requestor_address-varchar-300", e.NewValues["requestor_address"] ?? ""); ht.Add("@NilaiSetuju-decimal-18", e.NewValues["NilaiSetuju"] ?? ""); ht.Add("@Kegunaan-varchar-255", e.NewValues["Kegunaan"] ?? ""); ht.Add("@JenisKredit-int", e.NewValues["creditkind_id"] ?? ""); ht.Add("@modified_by-varchar-64", Session["user"] ?? ""); ht.Add("@status-char-1", e.NewValues["status"] ?? ""); ht.Add("@syaratAkad-varchar-512", e.NewValues["syaratAkad"] ?? ""); ht.Add("@syaratPenarikan-varchar-512", e.NewValues["syaratPenarikan"] ?? ""); //ht.Add("@Modified_by-varchar-64", Session["user"] ?? ""); (new PersetujuanHibahBll()).InsertData(ht); log.Type = "S"; log.Description = log.Action + " " + e.NewValues["proposal_number"].ToString() + " sukses oleh id " + userName; e.Cancel = true; gvPersetujuan.CancelEdit(); GetData(); gvPersetujuan.JSProperties["cpMessage"] = true; //} } catch (Exception ex) { gvPersetujuan.JSProperties["cpMessage"] = ex.Message; log.Type = "E"; log.Description = "insert form kemitraan error : " + ex.Message; } finally { logBll.InsertActivity(log); } }
protected void gvLihatPanjar_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { ActivityLog log = new ActivityLog(); ActivityLogBll logBll = new ActivityLogBll(); string host = Request.UserHostName; string ipaddress = Request.UserHostAddress; string userName = Session["user"].ToString(); if (String.IsNullOrEmpty(ipaddress)) { ipaddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } log.HostName = host; log.IPAddress = ipaddress; log.Action = "Insert Panjar"; log.UserName = userName; try { Hashtable ht = new Hashtable(); var branchCode = ((wcf_auth.GeneralUserProfile)SessionCheck.Check(Response, Session["userprofile"])).mAuthObjectValueList.FirstOrDefault(t => t.mAuthObjectName == "REGION").Value1; ht.Add("@tglPanjar-varchar-20", DateTime.Parse(e.NewValues["TglPanjar"].ToString()).ToString("dd/MM/yyyy")); ht.Add("@nama-varchar-99", e.NewValues["Nama"].ToString()); ht.Add("@nip-varchar-30", e.NewValues["nip"].ToString()); ht.Add("@jabatan-varchar-30", e.NewValues["jabatan"].ToString()); ht.Add("@tujuan-varchar-1000", e.NewValues["Tujuan"].ToString()); ht.Add("@keperluan-varchar-1000", e.NewValues["Keperluan"].ToString()); ht.Add("@nilaiPanjar-float", float.Parse(e.NewValues["NilaiPanjar"].ToString())); ht.Add("@program_id-int", Convert.ToInt32(e.NewValues["program_id"])); ht.Add("@tglBerangkat-varchar-20", DateTime.Parse(e.NewValues["TglBerangkat"].ToString()).ToString("dd/MM/yyyy")); ht.Add("@tglKembali-varchar-20", DateTime.Parse(e.NewValues["TglKembali"].ToString()).ToString("dd/MM/yyyy")); ht.Add("@transportBerangkat-float", float.Parse(e.NewValues["TransportBerangkat"].ToString())); ht.Add("@transportKembali-float", float.Parse(e.NewValues["TransportKembali"].ToString())); ht.Add("@dibuatOleh-varchar-20", e.NewValues["DibuatOleh"].ToString()); ht.Add("@user-varchar-99", Session["user"].ToString()); ht.Add("@branch_code-int", Convert.ToInt32(branchCode)); bll.InsertData(ht); log.Type = "S"; log.Description = log.Action + "Sukses oleh id" + ' ' + userName; e.Cancel = true; gvLihatPanjar.CancelEdit(); GetData(); } catch (Exception ex) { log.Type = "E"; log.Description = "Insert Panjar Error : " + ex.Message; } finally { logBll.InsertActivity(log); } }
protected void gvSektorkemitraan_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { ActivityLog log = new ActivityLog(); ActivityLogBll logBll = new ActivityLogBll(); string host = Request.UserHostName; string ipaddress = Request.UserHostAddress; string userName = Session["user"].ToString(); if (String.IsNullOrEmpty(ipaddress)) { ipaddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } log.HostName = host; log.IPAddress = ipaddress; log.Action = "Update"; log.UserName = userName; try { string id = e.Keys["id"].ToString(); string deskripsi = e.NewValues["sector_name"].ToString(); var keterangan = e.NewValues["remarks"]; string modified_by = Page.User.Identity.Name.ToString(); var is_active = e.NewValues["is_active"]; Hashtable ht = new Hashtable(); ht.Add("id-int", id); ht.Add("@sector_name-varchar-50", deskripsi); if (keterangan == null) { ht.Add("@remarks-varchar-1024", ""); } else { ht.Add("@remarks-varchar-1024", keterangan.ToString()); } ht.Add("@modified_by-varchar-99", modified_by); ht.Add("@status-bit", is_active); bll.UpdateData(ht); log.Type = "S"; log.Description = "Update" + ' ' + id + ' ' + "Sukses oleh id" + ' ' + userName; e.Cancel = true; gvSektorkemitraan.CancelEdit(); GetData(); } catch (Exception ex) { log.Type = "E"; log.Description = "Update Error : " + ex.Message; } finally { logBll.InsertActivity(log); } }
protected void gvJenisBinaLingkungan_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { ActivityLog log = new ActivityLog(); ActivityLogBll logBll = new ActivityLogBll(); string host = Request.UserHostName; string ipaddress = Request.UserHostAddress; string userName = Session["user"].ToString(); if (String.IsNullOrEmpty(ipaddress)) { ipaddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } log.HostName = host; log.IPAddress = ipaddress; log.Action = "Insert"; log.UserName = userName; try { Hashtable ht = new Hashtable(); var keterangan = e.NewValues["remarks"]; if (keterangan == null) { ht.Add("@Keterangan-varchar-100", ""); } else { ht.Add("@Keterangan-varchar-100", keterangan.ToString()); } string admin = Session["user"].ToString(); ht.Add("@Deskripsi-varchar-50", e.NewValues["bl_kind"].ToString()); ht.Add("@Status-bit", e.NewValues["is_active"]); ht.Add("@CreateBy-varchar-50", admin.ToString()); bll.InsertData(ht); log.Type = "S"; log.Description = log.Action + ' ' + ' ' + "sukses dengan id" + ' ' + userName; e.Cancel = true; gvJenisBinaLingkungan.CancelEdit(); GetData(); } catch (Exception ex) { log.Type = "E"; log.Description = "Insert Error : " + ex.Message; } finally { logBll.InsertActivity(log); } }
protected void gvNomorAkun_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { ActivityLog log = new ActivityLog(); ActivityLogBll logBll = new ActivityLogBll(); string host = Request.UserHostName; string ipaddress = Request.UserHostAddress; string userName = Session["user"].ToString(); if (String.IsNullOrEmpty(ipaddress)) { ipaddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } log.HostName = host; log.IPAddress = ipaddress; log.Action = "Update"; log.UserName = userName; try { //string no = e.Keys["No"].ToString(); string noAkun = e.Keys["account_id"].ToString(); string deskripsiAkun = e.NewValues["account_name"].ToString(); string grupAkun = e.NewValues["group_id"].ToString(); string keterangan = e.NewValues["debt_cred"].ToString(); string program = e.NewValues["program_id"].ToString(); string parent = e.NewValues["parent_account_id"].ToString(); string modify = Page.User.Identity.Name.ToString(); Hashtable ht = new Hashtable(); ht.Add("@account_id-varchar-50", noAkun); ht.Add("@account_name-varchar-359", deskripsiAkun); ht.Add("@group_id-int", grupAkun); ht.Add("@header_info-char-1", e.NewValues["header_info"].ToString()); ht.Add("@program_id-int", program); ht.Add("@debt_cred-char-2", keterangan); ht.Add("@parrent_account_id-varchar-50", parent); ht.Add("@modified_by-varchar-99", modify); bll.UpdateData(ht); log.Type = "S"; log.Description = log.Action + ' ' + noAkun + ' ' + "sukses oleh id" + ' ' + log.UserName; e.Cancel = true; gvNomorAkun.CancelEdit(); GetData(); InitCombo(); } catch (Exception ex) { log.Type = "E"; log.Description = "Update Error : " + ex.Message; } finally { logBll.InsertActivity(log); } }
protected void btnKoreksi_Click(object sender, EventArgs e) { ActivityLog log = new ActivityLog(); ActivityLogBll logBll = new ActivityLogBll(); string host = Request.UserHostName; string ipaddress = Request.UserHostAddress; string userName = Session["user"].ToString(); if (String.IsNullOrEmpty(ipaddress)) { ipaddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } log.HostName = host; log.IPAddress = ipaddress; log.Action = "Koreksi Jurnal"; log.UserName = userName; try { var data = bll.GetJurnalByNoRef(Session["noBukti"].ToString()); var detail = data["detail"]; Hashtable ht = new Hashtable(); var noBukti = Session["noBukti"].ToString(); ht.Add("@noBukti-varchar-99", noBukti); ht.Add("@user-varchar-99", userName); ht.Add("@tglKoreksi-varchar-15", DateTime.Parse(deTanggal.Text).ToString("dd/MM/yyyy")); bll.InsertKoreksi(ht); log.Type = "S"; log.Description = log.Action + ' ' + noBukti + ' ' + "Sukses oleh id" + ' ' + userName; } catch (Exception ex) { log.Type = "E"; log.Description = "Koreksi Jurnal Gagal : " + ex.Message; } finally { logBll.InsertActivity(log); if (log.Type == "S") { ClientScript.RegisterStartupScript(GetType(), "koreksi", "alert('Koreksi Sukses');", true); string Koreksi = "S"; Session["Koreksi"] = Koreksi; Response.Redirect(Session["Url"].ToString()); } else { ClientScript.RegisterStartupScript(GetType(), "koreksi", "alert('Koreksi Gagal');", true); } } }
protected void btnSimpan_Click(object sender, EventArgs e) { ActivityLog log = new ActivityLog(); ActivityLogBll logBll = new ActivityLogBll(); string host = Request.UserHostName; string ipaddress = Request.UserHostAddress; string userName = Session["user"].ToString(); if (String.IsNullOrEmpty(ipaddress)) { ipaddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } log.HostName = host; log.IPAddress = ipaddress; log.Action = "Detail Pengembalian Pembayaran No. Proposal "; log.UserName = userName; try { var branchCode = ((wcf_auth.GeneralUserProfile)Session["userprofile"]).mAuthObjectValueList.FirstOrDefault(t => t.mAuthObjectName == "REGION").Value1; var mitraid = Session["proposal_number"].ToString(); var data = bll.GetDetailData(mitraid); Hashtable ht = new Hashtable(); ht.Add("@proposal_number-varchar-40", mitraid.ToString()); ht.Add("@pokok-float", float.Parse(txtBayarPokok.Text)); ht.Add("@jasa-float", float.Parse(txtxBayarJasa.Text)); ht.Add("@nilaiAdv-float", float.Parse(txtAdvPayment.Text)); ht.Add("@tglPengembalian-varchar-20", DateTime.Parse(txtTanggal.Text).ToString("dd/MM/yyyy")); ht.Add("@branch_code-int", Convert.ToInt32(branchCode)); ht.Add("@akunKasBank-varchar-40", cbbKasBank.Value); ht.Add("@akunAngsuran-varchar-40", cbbAngsuran.Value); ht.Add("@user-nvarchar-50", Session["user"].ToString()); ht.Add("@AngsuranKe-int", Convert.ToInt32(data["AngsuranKe"])); ht.Add("@Catatan-nvarchar-1000", txtCatatan.Text); bll.InsertPengembalian(ht); log.Type = "S"; log.Description = log.Action + ' ' + mitraid + ' ' + "Sukses oleh id" + ' ' + userName; } catch (Exception ex) { ViewState["msg"] = "Simpan Gagal "; ViewState["color"] = "red"; log.Type = "E"; log.Description = "Detail Pembayaran Gagal : " + ex.Message; } finally { logBll.InsertActivity(log); } }
protected void prosesButton_Click(object sender, EventArgs e) { string id = Session["proposal_number"].ToString(); ActivityLog log = new ActivityLog(); ActivityLogBll logBll = new ActivityLogBll(); string host = Request.UserHostName; string ipaddress = Request.UserHostAddress; string userName = Session["user"].ToString(); if (String.IsNullOrEmpty(ipaddress)) { ipaddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } log.HostName = host; log.IPAddress = ipaddress; log.Action = "get preview jadwal pembayaran"; log.UserName = userName; try { DataTable dt = bll.getPreviewData(id); gvDetailAngsur.DataSource = dt; gvDetailAngsur.DataBind(); int row = 0; int tagih = int.Parse(txtTagihan.Text); int grace = int.Parse(txtGrace.Text); row = tagih > grace ? tagih : grace; txtAngsur.Text = dt.Rows[row - 1]["jumlah"].ToString(); txtHutang.Text = dt.Rows[row - 1]["HutangPokok"].ToString(); txtBungaPokok.Text = dt.Rows[row - 1]["Bunga"].ToString(); txtTanggalTempo.Date = DateTime.Parse(dt.Rows[int.Parse(txtJangkaWaktu.Text) - 1]["TglJatuhTempo"].ToString()); SAVE.Visible = true; BATAL.Visible = true; SAVE.Visible = RoleCheck.CheckRoleView(((wcf_auth.GeneralUserProfile)SessionCheck.Check(Response, Session["userprofile"])).mRoleList, "PK.Penilaian.Edit"); BATAL.Visible = RoleCheck.CheckRoleView(((wcf_auth.GeneralUserProfile)SessionCheck.Check(Response, Session["userprofile"])).mRoleList, "PK.Penilaian.Edit"); log.Type = "S"; log.Description = log.Action + " sukses oleh " + userName; } catch (Exception Ex) { log.Type = "E"; log.Description = log.Action + " error :" + Ex.Message; } finally { logBll.InsertActivity(log); } }
protected void btnConfirmYes_Click(object sender, EventArgs e) { ActivityLog log = new ActivityLog(); ActivityLogBll logBll = new ActivityLogBll(); string host = Request.UserHostName; string ipaddress = Request.UserHostAddress; string userName = Session["user"].ToString(); if (String.IsNullOrEmpty(ipaddress)) { ipaddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } log.HostName = host; log.IPAddress = ipaddress; log.Action = "Detail Pembayaran No. Proposal "; log.UserName = userName; try { Hashtable ht = new Hashtable(); string proposal = Request.QueryString["Proposal"].ToString(); ht.Add("@proposal_number-varchar-99", proposal); ht.Add("@uangMasuk-float", txtJmlPembayaran.Text.ToString()); ht.Add("@NamaAkun-char-99", cbbNamaAkun.Value.ToString()); ht.Add("@deskripsi-nvarchar-1000", txtCatatan.Text.ToString()); ht.Add("@user-varchar-100", Session["user"].ToString()); ht.Add("@COA-varchar-99", cbbLawanAkun.Value.ToString()); string date = DateTime.Parse(deTglBayar.Text.ToString()).ToString("dd/MM/yyyy"); ht.Add("@tglPembayaran-varchar-20", date); ViewState["msg"] = "Berhasil , Pembayaran " + bll.InsertData(ht, chkKoreksi.Checked); ViewState["color"] = "green"; log.Type = "S"; log.Description = log.Action + ' ' + proposal + ' ' + "Sukses oleh id" + ' ' + userName; GetData(); } catch (Exception ex) { ViewState["msg"] = "Simpan Gagal "; ViewState["color"] = "red"; log.Type = "E"; log.Description = "Detail Pembayaran Gagal : " + ex.Message; } finally { puConfirm.ShowOnPageLoad = false; logBll.InsertActivity(log); } }
protected void btnUpload_Click(object sender, EventArgs e) { ActivityLog log = new ActivityLog(); ActivityLogBll logBll = new ActivityLogBll(); string host = Request.UserHostName; string ipaddress = Request.UserHostAddress; string userName = Session["user"].ToString(); if (String.IsNullOrEmpty(ipaddress)) { ipaddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } log.HostName = host; log.IPAddress = ipaddress; log.Action = "upload file"; log.UserName = userName; try { var mitraId = int.Parse(Session["mitraid"].ToString()); Hashtable ht = new Hashtable(); if (fileUpload.HasFile) { string filename = fileUpload.PostedFile.FileName; string extension = System.IO.Path.GetExtension(Server.MapPath(filename)); Stream fileData = fileUpload.PostedFile.InputStream; BinaryReader br = new BinaryReader(fileData); byte[] databyte = br.ReadBytes(fileUpload.PostedFile.ContentLength); ht.Add("@mitra_id-int", mitraId); ht.Add("@FileName-nvarchar-250", filename); ht.Add("@FileExt-nvarchar-250", extension); ht.Add("@FileData-varbinary", databyte); ht.Add("@UploadBy-nvarchar-50", Session["user"]); bll.updateData(ht); log.Type = "S"; log.Description = log.Action + " filename " + filename + " mitra id " + Session["mitraid"].ToString() + " sukses oleh " + userName; getData(); } } catch (Exception ex) { log.Type = "E"; log.Description = log.Action + " error " + ex.Message; } finally { logBll.InsertActivity(log); } }
protected void btnDownload_Click(object sender, EventArgs e) { ActivityLog log = new ActivityLog(); ActivityLogBll logBll = new ActivityLogBll(); string host = Request.UserHostName; string ipaddress = Request.UserHostAddress; string userName = Session["user"].ToString(); if (String.IsNullOrEmpty(ipaddress)) { ipaddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } log.HostName = host; log.IPAddress = ipaddress; log.Action = "Download file"; log.UserName = userName; try { ImageButton btn = (ImageButton)sender; var focusIndex = gvPermohonan.FocusedRowIndex; var rowID = gvPermohonan.GetRowValues(focusIndex, "id").ToString(); var data = bll.GetFilePath(rowID); string original = data.Rows[0]["FileName"].ToString(); byte[] filedata = (byte[])data.Rows[0]["FileData"]; string mime = System.Web.MimeMapping.GetMimeMapping(data.Rows[0]["FileExt"].ToString()); Response.ContentType = mime; Response.AddHeader("Content-Disposition", "attachment;filename=\"" + original); Response.BinaryWrite(filedata); Response.Flush(); Response.End(); log.Type = "S"; log.Description = log.Action + ' ' + original + ' ' + "Sukses oleh id" + ' ' + userName; } catch (Exception ex) { log.Type = "E"; log.Description = "Download Gagal : " + ex.Message; } finally { logBll.InsertActivity(log); } }
protected void gvDetailDiskonJasa_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { ActivityLog log = new ActivityLog(); ActivityLogBll logBll = new ActivityLogBll(); string host = Request.UserHostName; string ipaddress = Request.UserHostAddress; string userName = Session["user"].ToString(); if (String.IsNullOrEmpty(ipaddress)) { ipaddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } log.HostName = host; log.IPAddress = ipaddress; log.Action = "Diskon Jasa"; log.UserName = userName; try { var branchCode = ((wcf_auth.GeneralUserProfile)SessionCheck.Check(Response, Session["userprofile"])).mAuthObjectValueList.FirstOrDefault(t => t.mAuthObjectName == "REGION").Value1; Hashtable ht = new Hashtable(); ht.Add("@proposal_number-varchar-40", Session["proposal_number"].ToString()); ht.Add("@nominal-float", float.Parse(e.NewValues["Bunga"].ToString())); ht.Add("@angsuranKe-int", e.NewValues["AngsuranKe"].ToString()); ht.Add("@tglDiskon-varchar-20", Convert.ToDateTime(e.NewValues["Tanggal"]).ToString("dd/MM/yyyy")); ht.Add("@branch_code-int", Convert.ToInt32(branchCode)); ht.Add("@user-varchar-50", Session["user"].ToString()); bll.InsertDiskon(ht); gvDetailDiskonJasa.JSProperties["cpIsUpdated"] = true; e.Cancel = true; gvDetailDiskonJasa.CancelEdit(); log.Type = "S"; log.Description = log.Action + " " + e.NewValues["mitra_id"].ToString() + " Sukses oleh id " + userName; GetData(); } catch (Exception ex) { log.Type = "E"; log.Description = "Diskon Jasa error : " + ex.Message; } finally { logBll.InsertActivity(log); } }
protected void btnSimpan_Click(object sender, EventArgs e) { ActivityLog log = new ActivityLog(); ActivityLogBll logBll = new ActivityLogBll(); string host = Request.UserHostName; string ipaddress = Request.UserHostAddress; string userName = Session["user"].ToString(); if (String.IsNullOrEmpty(ipaddress)) { ipaddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } log.HostName = host; log.IPAddress = ipaddress; log.Action = "insert penyetujuan"; log.UserName = userName; try { //int Kredit = Convert.ToInt32(txtMaksimalKredit.Text); if (true)//Kredit <= 75000000---Permen sekarang tidak boleh lebih dari 75 juta { Hashtable parameter = new Hashtable(); parameter.Add("@idProposal-int", Convert.ToInt32(Session["proposalID"])); parameter.Add("@jangkaWaktu-int", txtJangkaWaktu.Text); parameter.Add("@SukuBunga-decimal", txtBunga.Text); parameter.Add("@nilaisetuju-float", Convert.ToDecimal(txtMaksimalKredit.Text)); parameter.Add("@status-char-1", cbbSetuju.Value.ToString()); parameter.Add("@tglSetuju-varchar-20", Convert.ToDateTime(deTglPersetujuan.Value).ToString("dd/MM/yyyy")); bll.InsertPersetujuan(parameter); Response.Redirect("PersetujuanSurvey.aspx"); } else { log.Type = "F"; log.Description = "insert penyetujuan proposal error : Nilai lebih besar dari Rp 75.000.000,00 "; ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Nilai Persetujuan tidak boleh lebih dari Rp 75.000.000,00');", true); } } catch (Exception ex) { log.Type = "E"; log.Description = "insert penyetujuan proposal error : " + ex.Message; ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('" + HttpUtility.JavaScriptStringEncode(log.Description) + "');", true); } finally { logBll.InsertActivity(log); } }
protected void btnUpdate_Click(object sender, EventArgs e) { ActivityLog log = new ActivityLog(); ActivityLogBll logBll = new ActivityLogBll(); string host = Request.UserHostName; string ipaddress = Request.UserHostAddress; string userName = Session["user"].ToString(); if (String.IsNullOrEmpty(ipaddress)) { ipaddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } log.HostName = host; log.IPAddress = ipaddress; log.Action = "update data penjamin"; log.UserName = userName; try { Hashtable ht = new Hashtable(); ht.Add("@family_name-varchar-99", txtNamaLengkap.Text ?? ""); ht.Add("@family_address-varchar-99", txtAlamatRumah.Text ?? ""); ht.Add("@family_occupation-varchar-99", txtPekerjaan.Text ?? ""); ht.Add("@family_phone-varchar-99", txtNoTelp.Text ?? ""); ht.Add("@family_city-varchar-99", txtKota.Text ?? ""); ht.Add("@other_name-varchar-99", txtNamaLengkapSaudara.Text ?? ""); ht.Add("@other_occupation-varchar-99", txtPekerjaanSaudara.Text ?? ""); ht.Add("@other_address-varchar-99", txtAlamatRumahSaudara.Text ?? ""); ht.Add("@other_phone-varchar-99", txtNoTelpSaudara.Text ?? ""); ht.Add("@other_city-varchar-99", txtKotaSaudara.Text ?? ""); ht.Add("@mitra_id-int", Session["mitraid"]); ht.Add("@modified_by-varchar-64", Session["user"]); bll.updateData(ht); log.Type = "S"; log.Description = log.Action + " mitra id " + Session["mitraid"].ToString() + " sukses oleh " + userName; getData(); ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('" + HttpUtility.JavaScriptStringEncode(log.Description) + "');", true); } catch (Exception ex) { log.Type = "E"; log.Description = log.Action + " error " + ex.Message; ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('" + HttpUtility.JavaScriptStringEncode(log.Description) + "');", true); } finally { logBll.InsertActivity(log); } }
protected void btnSubmit_Click(object sender, EventArgs e) { ActivityLog log = new ActivityLog(); ActivityLogBll logBll = new ActivityLogBll(); string host = Request.UserHostName; string ipaddress = Request.UserHostAddress; string userName = Session["user"].ToString(); if (String.IsNullOrEmpty(ipaddress)) { ipaddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } log.HostName = host; log.IPAddress = ipaddress; log.Action = "Persetujuan Panjar"; log.UserName = userName; try { Hashtable ht = new Hashtable(); var branchCode = ((wcf_auth.GeneralUserProfile)SessionCheck.Check(Response, Session["userprofile"])).mAuthObjectValueList.FirstOrDefault(t => t.mAuthObjectName == "REGION").Value1; ht.Add("@noPanajar-varchar-50", txtNoref.Text); ht.Add("@tglSetuju-varchar-20", DateTime.Parse(deTanggal.Text).ToString("dd/MM/yyyy")); ht.Add("@approved_amount-float", float.Parse(txtNilai.Text)); ht.Add("@akunkas-varchar-40", cbbKasBank.Value.ToString()); ht.Add("@akunpanjar-varchar-40", cbbPanjar.Value.ToString()); ht.Add("@user-varchar-50", Session["user"].ToString()); ht.Add("@branch_code-varchar-50", branchCode); bll.InsertPersetujuan(ht); log.Type = "S"; log.Description = log.Action + "Sukses oleh id" + ' ' + userName; } catch (Exception ex) { log.Type = "E"; log.Description = "Persetujuan Panjar Error : " + ex.Message; } finally { logBll.InsertActivity(log); if (log.Type == "S") { Session["Panjar"] = "S"; Response.Redirect(Session["Url"].ToString()); } } }
protected void gvClosing_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomButtonCallbackEventArgs e) { if (e.ButtonID == "btnHitungUlang") { Pertamina.PKBL.BLL.Administer.ClosingBll bll = new BLL.Administer.ClosingBll(); ActivityLog log = new ActivityLog(); ActivityLogBll logBll = new ActivityLogBll(); string host = Request.UserHostName; string ipaddress = Request.UserHostAddress; string userName = Session["user"].ToString(); if (String.IsNullOrEmpty(ipaddress)) { ipaddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } log.HostName = host; log.IPAddress = ipaddress; log.Action = "Hitung Ulang Closing Kolektibilitas "; log.UserName = userName; try { var tahun = Convert.ToInt32(gvClosing.GetRowValues(e.VisibleIndex, "tahun").ToString().Trim()); var bulan = Convert.ToInt32(gvClosing.GetRowValues(e.VisibleIndex, "bulan").ToString().Trim()); bll.HitungUlangKolekti(bulan, tahun); gvClosing.DataSource = bll.GetHistoryKolekti(); gvClosing.DataBind(); ViewState["script"] = "<script>alert('hitung ulang closing bulan " + cbbBulan.SelectedItem.Text + " " + cbbTahun.SelectedItem.Value + " sukses'); </script>"; log.Type = "S"; log.Description = log.Action + "Sukses oleh id" + ' ' + userName; } catch (Exception ex) { ViewState["script"] = "<script>alert('hitung ulang closing bulan " + cbbBulan.SelectedItem.Text + " " + cbbTahun.SelectedItem.Value + " gagal'); </script>"; log.Type = "E"; log.Description = "Hitung Ulang Closing Kolektibilitas Gagal : " + ex.Message; } finally { logBll.InsertActivity(log); } } }
protected void btnSubmit_Click(object sender, EventArgs e) { ActivityLog log = new ActivityLog(); ActivityLogBll logBll = new ActivityLogBll(); string host = Request.UserHostName; string ipaddress = Request.UserHostAddress; string userName = Session["user"].ToString(); if (String.IsNullOrEmpty(ipaddress)) { ipaddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } log.HostName = host; log.IPAddress = ipaddress; log.Action = "Insert Perwab"; log.UserName = userName; try { Hashtable ht = new Hashtable(); ht.Add("@noPanajr-varchar-50", Session["Nopanjar"].ToString()); ht.Add("@tglPerwab-varchar-15", DateTime.Parse(deTanggal.Text).ToString("dd/MM/yyyy")); ht.Add("@nilaiSisa-float", float.Parse(txtNilaiPerwab.Text)); ht.Add("@catatan-varchar-1000", txtCatatan.Text); ht.Add("@akunPanjar-varchar-40", cbbAkun.Value.ToString()); ht.Add("@akunLawan-varchar-40", cbbLawan.Value.ToString()); ht.Add("@user-varchar-50", Session["user"].ToString()); bll.InsertPerwab(ht); log.Type = "S"; log.Description = log.Action + "Sukses oleh id" + ' ' + userName; } catch (Exception ex) { log.Type = "E"; log.Description = "Insert Perwab Error : " + ex.Message; } finally { logBll.InsertActivity(log); if (log.Type == "S") { Session["Perwab"] = "S"; Response.Redirect(Session["Url"].ToString()); } } }
protected void btnUpdate_Click(object sender, EventArgs e) { ActivityLog log = new ActivityLog(); ActivityLogBll logBll = new ActivityLogBll(); string host = Request.UserHostName; string ipaddress = Request.UserHostAddress; string userName = Session["user"].ToString(); if (String.IsNullOrEmpty(ipaddress)) { ipaddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } log.HostName = host; log.IPAddress = ipaddress; log.Action = "update data agunan"; log.UserName = userName; try { Hashtable ht = new Hashtable(); ht.Add("@car_mortgaged_object-varchar-99", txtJenis.Text ?? ""); ht.Add("@car_mortgaged_value-decimal", txtNilaiAgunan.Text ?? ""); ht.Add("@car_condition-varchar-200", cbbKondisi.Text.ToString() ?? ""); ht.Add("@motorbike_mortgaged_object-varchar-99", txtJenisMotor.Text ?? ""); ht.Add("@motorbike_mortgaged_value-decimal", txtAgunanMotor.Text ?? ""); ht.Add("@motorbike_condition-varchar-200", cbbKondisiMotor.Text.ToString() ?? ""); ht.Add("@other_mortgaged_object-varchar-99", txtJenisLain.Text ?? ""); ht.Add("@other_mortgaged_value-decimal", txtAgunanLain.Text ?? ""); ht.Add("@other_condition-varchar-200", txtKondisiLain.Text ?? ""); ht.Add("@mortgage_remarks-varchar-500", mmAgunan.Text ?? ""); ht.Add("@mitra_id-int", Session["mitraid"]); ht.Add("@modified_by-varchar-64", Session["user"]); bll.updateData(ht); log.Type = "S"; log.Description = log.Action + " mitra id " + Session["mitraid"].ToString() + " sukses oleh " + userName; getData(); ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('" + HttpUtility.JavaScriptStringEncode(log.Description) + "');", true); } catch (Exception ex) { log.Type = "E"; log.Description = log.Action + " error " + ex.Message; ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('" + HttpUtility.JavaScriptStringEncode(log.Description) + "');", true); } finally { logBll.InsertActivity(log); } }
protected void save_Click(object sender, EventArgs e) { ActivityLog log = new ActivityLog(); ActivityLogBll logBll = new ActivityLogBll(); string host = Dns.GetHostEntry(HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]).HostName; string ipaddress = Request.UserHostAddress; string userName = Session["user"].ToString(); if (String.IsNullOrEmpty(ipaddress)) { ipaddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } log.HostName = host; log.IPAddress = ipaddress; log.Action = "update data supplier"; log.UserName = userName; try { Hashtable ht = new Hashtable(); ht.Add("@id-int", idText.Text == "" ? "0" : idText.Text); ht.Add("@supplier_name-varchar-99", nama.Text); ht.Add("@alamat-varchar-255", alamat.Text); ht.Add("@telepon-varchar-50", telepon.Text); ht.Add("@fax-varchar-50", fax.Text); ht.Add("@keterangan-varchar-255", keterangan.Text); ht.Add("@PIC-varchar-255", pic.Text); ht.Add("@jabatan-varchar-255", jabatan.Text); ht.Add("@branchCode-varchar-4", ddlRegion.SelectedValue.ToString()); ht.Add("@supplier_code-varchar-50", kode.Text); ht.Add("@tglDaftar-varchar-12", tglDaftar.Date.ToShortDateString()); bll.insertSupplier(ht); log.Type = "S"; log.Description = log.Action + ' ' + nama.Text + " sukses oleh " + Session["user"]; ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('" + HttpUtility.JavaScriptStringEncode(log.Description) + "');", true); getData(); } catch (Exception Ex) { log.Type = "E"; log.Description = " update data supplier error : " + Ex.Message; ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('" + HttpUtility.JavaScriptStringEncode(log.Description) + "');", true); } finally { logBll.InsertActivity(log); } }
protected void gvNomorAkun_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { ActivityLog log = new ActivityLog(); ActivityLogBll logBll = new ActivityLogBll(); string host = Request.UserHostName; string ipaddress = Request.UserHostAddress; string userName = Session["user"].ToString(); if (String.IsNullOrEmpty(ipaddress)) { ipaddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } log.HostName = host; log.IPAddress = ipaddress; log.Action = "Insert"; log.UserName = userName; try { Hashtable ht = new Hashtable(); ht.Add("@account_id-varchar-50", e.NewValues["account_id"].ToString()); ht.Add("@account_name-varchar-359", e.NewValues["account_name"].ToString()); ht.Add("@group_id-int", e.NewValues["group_id"].ToString()); //ht.Add("@header_info-varchar-50", e.NewValues["Ket"].ToString()); ht.Add("@header_info-char-1", e.NewValues["header_info"].ToString()); ht.Add("@program_id-int", e.NewValues["program_id"].ToString()); ht.Add("@debt_cred-char-5", e.NewValues["debt_cred"].ToString()); ht.Add("@parrent_account_id-varchar-50", e.NewValues["parent_account_id"].ToString()); ht.Add("@created_by-varchar-50", Page.User.Identity.Name.ToString()); bll.InsertData(ht); log.Type = "S"; log.Description = log.Action + ' ' + "sukses oleh id" + ' ' + log.UserName; e.Cancel = true; gvNomorAkun.CancelEdit(); GetData(); InitCombo(); } catch (Exception ex) { log.Type = "E"; log.Description = "Insert Error : " + ex.Message; } finally { logBll.InsertActivity(log); } }
protected void btnUpdate_Click(object sender, EventArgs e) { ActivityLog log = new ActivityLog(); ActivityLogBll logBll = new ActivityLogBll(); string host = Request.UserHostName; string ipaddress = Request.UserHostAddress; string userName = Session["user"].ToString(); if (String.IsNullOrEmpty(ipaddress)) { ipaddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } log.HostName = host; log.IPAddress = ipaddress; log.Action = "update data pribadi"; log.UserName = userName; try { Hashtable ht = new Hashtable(); ht.Add("@requestor_address-varchar-300", txtAlamat.Text); ht.Add("@address_district-varchar-99", txtKecamatan.Text); ht.Add("@home_ownership_id-int", cbbKepRumah.Value); ht.Add("@requestor_phone1-varchar-64", txtTelepon.Text); ht.Add("@requestor_phone2-varchar-64", txtHandphone.Text); ht.Add("@requestor_email-varchar-64", txtEmail.Text); ht.Add("@marital_status_id-int", cbbStatPernikahan.Value); ht.Add("@education_lv_id-int", cbbPendTerakhir.Value); ht.Add("@proposal_id-int", Session["idProposal"]); ht.Add("@postal_code-varchar-10", txtKodepos.Text); ht.Add("@user-varchar-64", Session["user"]); bll.updateData(ht); log.Type = "S"; log.Description = log.Action + " mitra id " + Session["mitraid"].ToString() + " sukses oleh " + userName; ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('" + HttpUtility.JavaScriptStringEncode(log.Description) + "');", true); getData(); } catch (Exception ex) { log.Type = "E"; log.Description = log.Action + " error " + ex.Message; ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('" + HttpUtility.JavaScriptStringEncode(log.Description) + "');", true); } finally { logBll.InsertActivity(log); } }
protected void gvKota_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { ActivityLog log = new ActivityLog(); ActivityLogBll logBll = new ActivityLogBll(); string host = Request.UserHostName; string ipaddress = Request.UserHostAddress; string userName = Session["user"].ToString(); if (String.IsNullOrEmpty(ipaddress)) { ipaddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } log.HostName = host; log.IPAddress = ipaddress; log.Action = "Update"; log.UserName = userName; try { Hashtable ht = new Hashtable(); //ht.Add("@City_id-varchar-5", city_id); string city_appcode = e.NewValues["city_appcode"].ToString(); string kota = e.NewValues["city_name"].ToString(); string province_code = e.NewValues["province_code"].ToString(); string modify = Session["user"].ToString(); ht.Add("@city_appcode-varchar-9", city_appcode); ht.Add("@city_name-VarChar-200", kota); ht.Add("@province_code-int", province_code); ht.Add("@modified_by-VarChar-99", modify); bll.UpdateData(ht); log.Type = "S"; log.Description = log.Action + ' ' + city_appcode + ' ' + "Sukses oleh id" + ' ' + userName; e.Cancel = true; gvKota.CancelEdit(); GetData(); } catch (Exception ex) { log.Type = "E"; log.Description = "Update Error : " + ex.Message; } finally { logBll.InsertActivity(log); } //string city_id = e.Keys["city_id"].ToString(); }
protected void gvJenisKreditKemitraan_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { ActivityLog log = new ActivityLog(); ActivityLogBll logBll = new ActivityLogBll(); string host = Request.UserHostName; string ipaddress = Request.UserHostAddress; string userName = Session["user"].ToString(); if (String.IsNullOrEmpty(ipaddress)) { ipaddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } log.HostName = host; log.IPAddress = ipaddress; log.Action = "Update"; log.UserName = userName; try { string id = e.Keys["id"].ToString(); string deskripsi = e.NewValues["descr"].ToString(); var status = e.NewValues["is_active"]; string modify = Page.User.Identity.Name.ToString(); Hashtable ht = new Hashtable(); ht.Add("@ID-Int", id); ht.Add("@Deskripsi-VarChar-50", deskripsi); ht.Add("@Status-bit", status); ht.Add("@ModifyBy-VarChar-50", modify); bll.UpdateData(ht); log.Type = "S"; log.Description = log.Action + ' ' + "sukses oleh id" + ' ' + userName; e.Cancel = true; gvJenisKreditKemitraan.CancelEdit(); GetData(); } catch (Exception ex) { log.Type = "E"; log.Description = "Update error : " + ex.Message; } finally { logBll.InsertActivity(log); } }
protected void gvPropinsi_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { ActivityLog log = new ActivityLog(); ActivityLogBll logBll = new ActivityLogBll(); string host = Request.UserHostName; string ipaddress = Request.UserHostAddress; string userName = Session["user"].ToString(); if (String.IsNullOrEmpty(ipaddress)) { ipaddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } log.HostName = host; log.IPAddress = ipaddress; log.Action = "Update"; log.UserName = userName; try { string deleted_by = Session["user"].ToString(); string id = e.Keys["province_code"].ToString(); string provinsi = e.NewValues["province_name"].ToString(); string ibukota = e.NewValues["capital_name"].ToString(); string modified_by = Session["user"].ToString(); Hashtable ht = new Hashtable(); ht.Add("@id-Int", id); ht.Add("@provinsi-VarChar-50", provinsi); ht.Add("@ibukota-VarChar-50", ibukota); ht.Add("@modifyby-VarChar-50", modified_by); bll.UpdateData(ht); log.Type = "S"; log.Description = log.Action + ' ' + id + ' ' + "Sukses oleh id" + ' ' + userName; e.Cancel = true; gvPropinsi.CancelEdit(); GetData(); } catch (Exception ex) { log.Type = "E"; log.Description = "Update Error : " + ex.Message; } finally { logBll.InsertActivity(log); } }
protected void btnSubmit_Click(object sender, EventArgs e) { ActivityLog log = new ActivityLog(); ActivityLogBll logBll = new ActivityLogBll(); string host = Request.UserHostName; string ipaddress = Request.UserHostAddress; string userName = Session["user"].ToString(); if (String.IsNullOrEmpty(ipaddress)) { ipaddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } log.HostName = host; log.IPAddress = ipaddress; log.Action = "Closing Month "; log.UserName = userName; try { Hashtable ht = new Hashtable(); ht.Add("@bulan-int", Convert.ToInt32(cbbBulan.Value)); ht.Add("@tahun-int", Convert.ToInt32(cbbTahun.Value)); ht.Add("@user-varchar-99", Session["user"].ToString()); bll.InsertData(ht); gvClosingMonth.DataSource = bll.GetHistory(); gvClosingMonth.DataBind(); ViewState["script"] = "<script>alert('closing bulan " + cbbBulan.SelectedItem.Text + " " + cbbTahun.SelectedItem.Value + " sukses'); </script>"; log.Type = "S"; log.Description = log.Action + "Sukses oleh id" + ' ' + userName; } catch (Exception ex) { ViewState["script"] = "<script>alert('closing bulan " + cbbBulan.SelectedItem.Text + " " + cbbTahun.SelectedItem.Value + " gagal'); </script>"; log.Type = "E"; log.Description = "Closing Month Gagal : " + ex.Message; } finally { logBll.InsertActivity(log); } }
protected void gvKantorCabang_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { ActivityLog log = new ActivityLog(); ActivityLogBll logBll = new ActivityLogBll(); string host = Request.UserHostName; string ipaddress = Request.UserHostAddress; string userName = Session["user"].ToString(); if (String.IsNullOrEmpty(ipaddress)) { ipaddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } log.HostName = host; log.IPAddress = ipaddress; log.Action = "Insert"; log.UserName = userName; try { Hashtable ht = new Hashtable(); ht.Add("@branch_name-varchar-200", e.NewValues["branch_name"].ToString()); ht.Add("@branch_details-varchar-560", e.NewValues["branch_details"].ToString()); ht.Add("@head_of_branch-varchar-200", e.NewValues["head_of_branch"].ToString()); ht.Add("@head_title-varchar-200", e.NewValues["head_title"].ToString()); ht.Add("@branch_addr-varchar-560", e.NewValues["branch_addr"].ToString()); //ht.Add("@province_code-int", e.NewValues["province_code"].ToString()); ht.Add("@branch_code-varchar-10", e.NewValues["branch_code"].ToString()); ht.Add("@created_by-varchar-99", Session["user"]); bll.InsertData(ht); log.Type = "S"; log.Description = log.Action + ' ' + "Sukses oleh id" + ' ' + userName; e.Cancel = true; gvKantorCabang.CancelEdit(); GetData(); } catch (Exception ex) { log.Type = "E"; log.Description = "Insert Error : " + ex.Message; } finally { logBll.InsertActivity(log); } }