Esempio n. 1
0
        protected void btnClosing_Click(object sender, EventArgs e)
        {
            Pertamina.PKBL.BLL.Administer.ClosingBll bll = new BLL.Administer.ClosingBll();

            bll.Kolektabilitas(Convert.ToInt32(cbbBulan.SelectedItem.Value), Convert.ToInt32(cbbTahun.SelectedItem.Value));

            gvClosing.DataSource = bll.GetHistoryKolekti();
            gvClosing.DataBind();

            ViewState["script"] = string.Format("<script>alert('klosing kolektibilitas bulan {0} tahun {1} sukses');</script>", cbbBulan.SelectedItem.Text, cbbTahun.SelectedItem.Value);
        }
Esempio n. 2
0
        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);
                }
            }
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DataTable tahun = new DataTable();
                tahun.Columns.Add("tahun");

                for (int i = DateTime.Today.Year; i > 1993; i--)
                {
                    var nr = tahun.NewRow();
                    nr["tahun"] = i;
                    tahun.Rows.Add(nr);
                }

                DataTable bulan = new DataTable();
                bulan.Columns.Add("value");
                bulan.Columns.Add("text");

                bulan.Rows.Add(1, "Januari");
                bulan.Rows.Add(2, "Februari");
                bulan.Rows.Add(3, "Maret");
                bulan.Rows.Add(4, "April");
                bulan.Rows.Add(5, "Mei");
                bulan.Rows.Add(6, "Juni");
                bulan.Rows.Add(7, "Juli");
                bulan.Rows.Add(8, "Agustus");
                bulan.Rows.Add(9, "September");
                bulan.Rows.Add(10, "Oktober");
                bulan.Rows.Add(11, "November");
                bulan.Rows.Add(12, "Desember");


                cbbBulan.DataSource = bulan;
                cbbBulan.TextField  = "text";
                cbbBulan.ValueField = "value";
                cbbBulan.DataBind();


                cbbTahun.DataSource = tahun;
                cbbTahun.TextField  = "tahun";
                cbbTahun.ValueField = "tahun";
                cbbTahun.DataBind();

                Pertamina.PKBL.BLL.Administer.ClosingBll bll = new BLL.Administer.ClosingBll();

                gvClosing.DataSource = bll.GetHistoryKolekti();
                gvClosing.DataBind();
            }
        }
Esempio n. 4
0
        protected void btnSave_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 Pembayaran PK";
            log.UserName  = userName;

            try
            {
                DateTime lastclose = new BLL.Administer.ClosingBll().GetLastClose();

                if (lastclose > deTglBayar.Date)
                {
                    lblKeterangan.ForeColor = System.Drawing.Color.Red;
                    lblKeterangan.Text      = "Tanggal bayar sudah di closing";
                    log.Type        = "F";
                    log.Description = "Tanggal realisasi sudah di closing";
                    return;
                }


                var data = (DataTable)Session["oktouploadpembayaran"];

                try
                {
                    data.Columns.Remove("Message");
                }
                catch (Exception)
                {
                }

                Hashtable parameters = new Hashtable();

                parameters.Add("@coaBank-varchar-50", cbbCoa.SelectedItem.Value);
                parameters.Add("@coaLawan-varchar-50", cbbLawanAkun.SelectedItem.Value);
                parameters.Add("@tglPembayaran-varchar-20", deTglBayar.Date.ToString("dd/MM/yyyy"));
                parameters.Add("@deskripsi-varchar-1000", txtDeskripsi.Text);
                parameters.Add("@createdBy-varchar-300", Session["user"].ToString());


                bll.UploadPembayaran(parameters, data);

                ViewState["msg"] = "<script>alert('Upload " + data.Rows.Count.ToString() + " data pembayaran kemitraan berhasil');</script>";

                lblKeterangan.ForeColor = System.Drawing.Color.Green;
                lblKeterangan.Text      = "Upload Data Berhasil";
                btnSave.Visible         = false;

                log.Type        = "S";
                log.Description = log.Action + ' ' + data.Rows.Count.ToString() + ' ' + "Row, Sukses oleh id" + ' ' + userName;
            }
            catch (Exception ex)
            {
                log.Type        = "E";
                log.Description = "Upload Pembayaran PK Error : " + ex.Message;
            }
            finally
            {
                logBll.InsertActivity(log);
            }
        }
Esempio n. 5
0
        protected void btnSave_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 Penyaluran BL";
            log.UserName  = userName;

            try
            {
                DateTime lastclose = new BLL.Administer.ClosingBll().GetLastClose();

                if (lastclose > deTglRealisasi.Date)
                {
                    lblKeterangan.ForeColor = System.Drawing.Color.Red;
                    lblKeterangan.Text      = "Tanggal realisasi sudah di closing";
                    log.Type        = "F";
                    log.Description = "Tanggal realisasi sudah di closing";
                    return;
                }

                var data = (DataTable)Session["bloktoupload"];

                try
                {
                    data.Columns.Remove("Message");
                }
                catch (Exception)
                {
                }

                System.Collections.Hashtable parameters = new System.Collections.Hashtable();

                parameters.Add("@coaBank-varchar-50", cbbNamaAkun.SelectedItem.Value);
                parameters.Add("@tglPenyaluran-varchar-30", deTglRealisasi.Date.ToString("dd/MM/yyyy"));
                parameters.Add("@user-varchar-200", Session["user"].ToString());
                parameters.Add("@branch_code-int", ((wcf_auth.GeneralUserProfile)SessionCheck.Check(Response, Session["userprofile"])).mAuthObjectValueList.FirstOrDefault(t => t.mAuthObjectName == "REGION").Value1);

                bll.UploadData(parameters, data);

                ViewState["msg"] = "<script>alert('Upload " + data.Rows.Count.ToString() + " data penyaluran BL berhasil');</script>";

                lblKeterangan.ForeColor = System.Drawing.Color.Green;
                lblKeterangan.Text      = "Upload Data Berhasil";
                btnSave.Visible         = false;

                log.Type        = "S";
                log.Description = log.Action + ' ' + data.Rows.Count.ToString() + ' ' + "Row, Sukses oleh id" + ' ' + userName;
            }
            catch (Exception ex)
            {
                log.Type        = "E";
                log.Description = "Upload Penyaluran BL Error : " + ex.Message;
            }
            finally
            {
                logBll.InsertActivity(log);
            }
        }
Esempio n. 6
0
        protected void btnSave_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 Realisasi Kemitraan";
            log.UserName  = userName;

            try
            {
                var numberRegex = @"^[0-9]*$";

                if (txtPeriode.Text.Trim().Equals("") || txtDeskripsi.Text.Trim().Equals("") || txtBunga.Text.Trim().Equals(""))
                {
                    if (!Regex.IsMatch(txtPeriode.Text, numberRegex) || !Regex.IsMatch(txtGracePeriod.Text, numberRegex))
                    {
                        lblKeterangan.ForeColor = System.Drawing.Color.Red;
                        lblKeterangan.Text      = "Terdapat Kesalahan Input";
                        log.Type        = "F";
                        log.Description = "Terdapat Kesalahan Input";
                        return;
                    }
                    else
                    {
                        if (decimal.Parse(txtPeriode.Text.Trim()) <= 0)
                        {
                            lblKeterangan.ForeColor = System.Drawing.Color.Red;
                            lblKeterangan.Text      = "Periode Tidak Boleh kurang dari atau samadengan nol";
                            log.Type        = "F";
                            log.Description = "Periode Tidak Boleh kurang dari atau samadengan nol";
                            return;
                        }
                    }


                    lblKeterangan.ForeColor = System.Drawing.Color.Red;
                    lblKeterangan.Text      = "Lengkapi Field Terlebih Dahulu";
                    log.Type        = "F";
                    log.Description = "Lengkapi Field Terlebih Dahulu";
                    return;
                }



                DateTime lastclose = new BLL.Administer.ClosingBll().GetLastClose();

                if (lastclose > deTglRealisasi.Date)
                {
                    lblKeterangan.ForeColor = System.Drawing.Color.Red;
                    lblKeterangan.Text      = "Tanggal realisasi sudah di closing";
                    log.Type        = "F";
                    log.Description = "Tanggal realisasi sudah di closing";
                    return;
                }

                var data = (DataTable)Session["oktoupload"];

                try
                {
                    data.Columns.Remove("Message");
                }
                catch (Exception)
                {
                }



                System.Collections.Hashtable parameters = new System.Collections.Hashtable();


                parameters.Add("@tglPermohonan-varchar-20", deTglPermohonan.Date.ToString("dd/MM/yyyy"));
                parameters.Add("@tglPersetujuan-varchar-20", deTglPersetujuan.Date.ToString("dd/MM/yyyy"));
                parameters.Add("@tglRealisasi-varchar-20", deTglRealisasi.Date.ToString("dd/MM/yyyy"));
                parameters.Add("@coaBank-varchar-30", cbbCOABank.SelectedItem.Value.ToString());
                parameters.Add("@sector_id-int", cbbSector.SelectedItem.Value.ToString());
                parameters.Add("@periode-int", txtPeriode.Text.Trim());
                parameters.Add("@isYarnen-bit", cbIsYarnen.Checked);
                parameters.Add("@createdBy-varchar-100", Session["user"].ToString());
                parameters.Add("@branch_code-int", ((wcf_auth.GeneralUserProfile)SessionCheck.Check(Response, Session["userprofile"])).mAuthObjectValueList.FirstOrDefault(t => t.mAuthObjectName == "REGION").Value1);
                parameters.Add("@suplier_id-int", (cbbSuplier.SelectedItem == null)? DBNull.Value:cbbSuplier.SelectedItem.Value);
                parameters.Add("@company_kind_id-int", cbbCompanyKind.SelectedItem.Value);
                parameters.Add("@jkr-int", cbbJkr.SelectedItem.Value);
                parameters.Add("@bunga-decimal", Convert.ToDecimal(txtBunga.Text.Trim()));
                parameters.Add("@jenisJasa-int", cbbJenisJasa.SelectedItem.Value);
                parameters.Add("@graceperiod-int", txtGracePeriod.Text.Trim());
                parameters.Add("@deskripsiPencairan-varchar-1000", txtDeskripsi.Text.Trim());

                bll.UploadPencairan(parameters, data);

                ViewState["msg"] = "<script>alert('Upload " + data.Rows.Count.ToString() + " data realisasi kemitraan berhasil');</script>";

                lblKeterangan.ForeColor = System.Drawing.Color.Green;
                lblKeterangan.Text      = "Upload Data Berhasil";
                btnSave.Visible         = false;

                log.Type        = "S";
                log.Description = log.Action + ' ' + data.Rows.Count.ToString() + ' ' + "Row, Sukses oleh id" + ' ' + userName;
            }
            catch (Exception ex)
            {
                log.Type        = "E";
                log.Description = "Upload Realisasi Kemitraan Error : " + ex.Message;
            }
            finally
            {
                logBll.InsertActivity(log);
            }
        }