private void Tampil() { list.Visible = true; reprint.Visible = false; Js.AutoPrint(this); //increment Db.Execute("UPDATE MS_RESERVASI SET PrintWL = PrintWL + 1 WHERE NoReservasi = " + NoReservasi); //Logfile DataTable rs = Db.Rs("SELECT " + " MS_RESERVASI.NoUnit AS [Unit]" + ",MS_CUSTOMER.Nama AS [Customer]" + ",PrintWL AS [Print Counter]" + " FROM MS_RESERVASI INNER JOIN MS_CUSTOMER ON MS_RESERVASI.NoCustomer = MS_CUSTOMER.NoCustomer" + " WHERE MS_RESERVASI.NoReservasi = " + NoReservasi ); Db.Execute("EXEC spLogReservasi" + " 'P-WL'" + ",'" + Act.UserID + "'" + ",'" + Act.IP + "'" + ",'" + Cf.LogCapture(rs) + "'" + ",'" + NoReservasi.ToString().PadLeft(5, '0') + "'" ); decimal LogID = Db.SingleDecimal("SELECT TOP 1 LogID FROM MS_RESERVASI_LOG ORDER BY LogID DESC"); string Project = Db.SingleString("SELECT Project FROM MS_UNIT WHERE NoStock = (SELECT NoStock FROM MS_RESERVASI WHERE NoReservasi = '" + NoReservasi + "')"); Db.Execute("UPDATE MS_RESERVASI_LOG SET Project = '" + Project + "' WHERE LogID = " + LogID); }
protected void Page_Load(object sender, System.EventArgs e) { Act.Pass(); Act.NoCache(); Act.CekInt("NoReservasi"); DataTable rs = Db.Rs( "SELECT * FROM MS_RESERVASI WHERE NoReservasi = " + NoReservasi); if (rs.Rows.Count == 0) { Response.Redirect("/CustomError/Deleted.html"); } else { DataTable rsDetail = Db.Rs("SELECT " + " MS_RESERVASI.NoUnit AS [Unit]" + ",MS_RESERVASI.NoStock AS [No. Stock]" + ",MS_RESERVASI.NoUrut AS [No. Urut]" + ",MS_CUSTOMER.Nama AS [Customer]" + ",MS_AGENT.Nama + ' ' + MS_AGENT.Principal AS [Agent]" + ",CONVERT(varchar,MS_RESERVASI.Tgl,106) AS [Tanggal]" + ",CONVERT(varchar,MS_RESERVASI.TglExpire,100) AS [Batas Waktu]" + ",MS_RESERVASI.Netto AS [Nilai Pengikatan]" + ",MS_RESERVASI.Skema AS [Skema]" + " FROM MS_RESERVASI INNER JOIN MS_CUSTOMER ON MS_RESERVASI.NoCustomer = MS_CUSTOMER.NoCustomer" + " INNER JOIN MS_AGENT ON MS_RESERVASI.NoAgent = MS_AGENT.NoAgent" + " WHERE MS_RESERVASI.NoReservasi = " + NoReservasi ); Db.Execute("EXEC spReservasiPromote " + NoReservasi); //Log Db.Execute("EXEC spLogReservasi " + " 'PWL'" + ",'" + Act.UserID + "'" + ",'" + Act.IP + "'" + ",'" + Cf.LogCapture(rsDetail) + "'" + ",'" + NoReservasi.ToString().PadLeft(5, '0') + "'" ); decimal LogID = Db.SingleDecimal("SELECT TOP 1 LogID FROM MS_RESERVASI_LOG ORDER BY LogID DESC"); string Project = Db.SingleString("SELECT Project FROM MS_UNIT WHERE NoStock = (SELECT NoStock FROM MS_RESERVASI WHERE NoReservasi = '" + NoReservasi + "')"); Db.Execute("UPDATE MS_RESERVASI_LOG SET Project = '" + Project + "' WHERE LogID = " + LogID); Response.Redirect("UnitWL.aspx?NoStock=" + rs.Rows[0]["NoStock"]); } }
private void Valid(string Username) { Session["SalahPass"] = null; //Logfile otorisasi DataTable rs = Db.Rs("SELECT " + " NoReservasi AS [No. Reservasi]" + ",NoUnit AS [Unit]" + ",NoUrut AS [No. Urut]" + ",NoStock AS [No. Stock]" + ",MS_CUSTOMER.Nama AS [Customer]" + ",MS_AGENT.Nama + ' ' + MS_AGENT.Principal AS [Agent]" + ",CONVERT(varchar,Tgl,106) AS [Tanggal]" + ",CONVERT(varchar,TglExpire,100) AS [Batas Waktu]" + ",Netto AS [Nilai Pengikatan]" + ",MS_RESERVASI.Skema AS [Skema]" + ",NoQueue AS [NUP]" + ",MS_RESERVASI.NoRefferatorAgent" + ",MS_RESERVASI.NoRefferatorCustomer" + " FROM MS_RESERVASI INNER JOIN MS_CUSTOMER ON MS_RESERVASI.NoCustomer = MS_CUSTOMER.NoCustomer" + " INNER JOIN MS_AGENT ON MS_RESERVASI.NoAgent = MS_AGENT.NoAgent" + " WHERE NoReservasi = " + NoReservasi ); Db.Execute("EXEC spLogReservasi" + " 'R-BFORM'" + ",'" + Act.UserID + "'" + ",'" + Act.IP + "'" + ",'" + Cf.LogCapture(rs) + "'" + ",'" + NoReservasi.ToString().PadLeft(5, '0') + "'" ); decimal LogID = Db.SingleDecimal("SELECT TOP 1 LogID FROM MS_RESERVASI_LOG ORDER BY LogID DESC"); Db.Execute("UPDATE MS_RESERVASI_LOG SET Project = '" + Project + "' WHERE LogID = " + LogID); Tampil(); //string file = Param.PathFilePDFMarketingJual + NoReservasi.Replace("/", "_").Replace("\\", "_") + Project + "_BF.pdf"; //bool exist = System.IO.File.Exists(file); //if (exist) //{ // System.IO.File.Delete(file); //} //ConvertPdf(); //Response.Redirect("http://" + Request.Url.Host + ":" + Request.Url.Port // + Param.PathLinkFilePDFMarketingJual + NoReservasi.Replace("/", "_").Replace("\\", "_") + Project + "_BF.pdf"); }
protected void delbtn_Click(object sender, System.EventArgs e) { DataTable rs = Db.Rs( "SELECT * FROM MS_RESERVASI WHERE NoReservasi = " + NoReservasi); if (rs.Rows.Count == 0) { Response.Redirect("/CustomError/Deleted.html"); } else { string Ket = "***Alasan Delete :<br>" + Cf.Str(ket.Text) + "<br><br>***Data Sebelum Delete :<br>" + Cf.LogCapture(rs); Db.Execute("EXEC spReservasiDel " + NoReservasi); int c = Db.SingleInteger( "SELECT COUNT(*) FROM MS_RESERVASI WHERE NoReservasi = " + NoReservasi); if (c == 0) { //Log Db.Execute("EXEC spLogReservasi " + " 'DELETE'" + ",'" + Act.UserID + "'" + ",'" + Act.IP + "'" + ",'" + Ket + "'" + ",'" + NoReservasi.ToString().PadLeft(5, '0') + "'" ); decimal LogID = Db.SingleDecimal("SELECT TOP 1 LogID FROM MS_RESERVASI_LOG ORDER BY LogID DESC"); string Project = Db.SingleString("SELECT Project FROM MS_UNIT WHERE NoStock = (SELECT NoStock FROM MS_RESERVASI WHERE NoReservasi = '" + NoReservasi + "')"); Db.Execute("UPDATE MS_RESERVASI_LOG SET Project = '" + Project + "' WHERE LogID = " + LogID); Js.Close(this); } else { //Tidak bisa dihapus frm.Visible = false; nodel.Visible = true; } } }
private void Tampil() { list.Visible = true; reprint.Visible = false; Js.AutoPrint(this); //increment Db.Execute("UPDATE MS_RESERVASI SET PrintBForm = PrintBForm + 1 WHERE NoReservasi = '" + NoReservasi + "'"); //Logfile DataTable rs = Db.Rs("SELECT " + " NoReservasi AS [No. Reservasi]" + ",NoUnit AS [Unit]" + ",NoUrut AS [No. Urut]" + ",NoStock AS [No. Stock]" + ",MS_CUSTOMER.Nama AS [Customer]" + ",MS_AGENT.Nama + ' ' + MS_AGENT.Principal AS [Agent]" + ",CONVERT(varchar,Tgl,106) AS [Tanggal]" + ",CONVERT(varchar,TglExpire,100) AS [Batas Waktu]" + ",Netto AS [Nilai Pengikatan]" + ",MS_RESERVASI.Skema AS [Skema]" + ",NoQueue AS [NUP]" + ",MS_RESERVASI.NoRefferatorAgent" + ",MS_RESERVASI.NoRefferatorCustomer" + " FROM MS_RESERVASI INNER JOIN MS_CUSTOMER ON MS_RESERVASI.NoCustomer = MS_CUSTOMER.NoCustomer" + " INNER JOIN MS_AGENT ON MS_RESERVASI.NoAgent = MS_AGENT.NoAgent" + " WHERE NoReservasi = " + NoReservasi ); Db.Execute("EXEC spLogReservasi" + " 'P-BFORM'" + ",'" + Act.UserID + "'" + ",'" + Act.IP + "'" + ",'" + Cf.LogCapture(rs) + "'" + ",'" + NoReservasi.ToString().PadLeft(5, '0') + "'" ); decimal LogID = Db.SingleDecimal("SELECT TOP 1 LogID FROM MS_RESERVASI_LOG ORDER BY LogID DESC"); Db.Execute("UPDATE MS_RESERVASI_LOG SET Project = '" + Project + "' WHERE LogID = " + LogID); }
private void Valid(string Username) { Session["SalahPass"] = null; //Logfile otorisasi DataTable rs = Db.Rs("SELECT " + " MS_RESERVASI.NoUnit AS [Unit]" + ",MS_CUSTOMER.Nama AS [Customer]" + " FROM MS_RESERVASI INNER JOIN MS_CUSTOMER ON MS_RESERVASI.NoCustomer = MS_CUSTOMER.NoCustomer" + " WHERE MS_RESERVASI.NoReservasi = " + NoReservasi ); Db.Execute("EXEC spLogReservasi" + " 'R-WL'" + ",'" + Username + "'" + ",'" + Act.IP + "'" + ",'" + Cf.LogCapture(rs) + "'" + ",'" + NoReservasi.ToString().PadLeft(5, '0') + "'" ); decimal LogID = Db.SingleDecimal("SELECT TOP 1 LogID FROM MS_RESERVASI_LOG ORDER BY LogID DESC"); string Project = Db.SingleString("SELECT Project FROM MS_UNIT WHERE NoStock = (SELECT NoStock FROM MS_RESERVASI WHERE NoReservasi = '" + NoReservasi + "')"); Db.Execute("UPDATE MS_RESERVASI_LOG SET Project = '" + Project + "' WHERE LogID = " + LogID); Tampil(); string file = Param.PathFilePDFMarketingJual + NoReservasi + "_WL.pdf"; bool exist = System.IO.File.Exists(file); if (exist) { System.IO.File.Delete(file); } ConvertPdf(); Response.Redirect(Param.PathLinkFilePDFMarketingJual + NoReservasi + "_WL.pdf"); }
private void Fill() { btnlog.Attributes["onclick"] = "location.href='LogPk.aspx?Tb=MS_RESERVASI_LOG&Pk=" + NoReservasi.ToString().PadLeft(5, '0') + "'"; btndel.Attributes["onclick"] = "location.href='ReservasiDel.aspx?NoReservasi=" + NoReservasi + "'"; DataTable rs = Db.Rs("SELECT a.*, b.NoCustomer, b.Nama, DateDiff(Day,a.Tgl,a.TglExpire) as SisaWaktu " + " FROM MS_RESERVASI a" + " INNER JOIN MS_CUSTOMER b" + " ON a.NoCustomer = b.NoCustomer" + " WHERE a.NoReservasi = " + NoReservasi ); if (rs.Rows.Count == 0) { Response.Redirect("/CustomError/Deleted.html"); } else { wl.Attributes["onclick"] = "location.href='UnitWL.aspx?NoStock=" + rs.Rows[0]["NoStock"] + "'"; if (rs.Rows[0]["Status"].ToString() == "A") { status.ForeColor = Color.Green; status.Text = "Aktif"; } else { status.ForeColor = Color.Red; status.Text = "Expire"; } noreservasi.Text = rs.Rows[0]["NoReservasi"].ToString(); noreservasifull.Text = rs.Rows[0]["NoReservasi2"].ToString(); int totalwl = Db.SingleInteger( "SELECT COUNT(*) FROM MS_RESERVASI WHERE NoStock = '" + rs.Rows[0]["NoStock"] + "'"); nourut.Text = rs.Rows[0]["NoUrut"] + "/" + totalwl; tgl.Text = Cf.Day(rs.Rows[0]["Tgl"]); batas.Text = Cf.Date(rs.Rows[0]["TglExpire"]); sisawaktu.Text = Cf.NumBulat(rs.Rows[0]["SisaWaktu"]); noqueue.Text = rs.Rows[0]["NoQueue"].ToString(); nilai.Text = Cf.Num(rs.Rows[0]["Netto"]); skema.SelectedValue = rs.Rows[0]["Skema"].ToString(); skema.Enabled = false; agent.Items.Add(new ListItem( "Tidak Berubah : " + rs.Rows[0]["NoAgent"].ToString().PadLeft(5, '0') , rs.Rows[0]["NoAgent"].ToString())); agent.SelectedValue = rs.Rows[0]["NoAgent"].ToString(); agent.Enabled = false; supervisor.Text = rs.Rows[0]["Supervisor"].ToString(); manager.Text = rs.Rows[0]["Manager"].ToString(); //tanggal input, edit dan follow-up tglInput.Text = Cf.Date(rs.Rows[0]["TglInput"]); tglEdit.Text = Cf.Date(rs.Rows[0]["TglEdit"]); printWL.InnerHtml = printWL.InnerHtml + " (" + rs.Rows[0]["PrintWL"] + ")"; printJadwalTagihan.InnerHtml = printJadwalTagihan.InnerHtml + " (" + rs.Rows[0]["PrintJadwalTagihan"] + ")"; printbform.InnerHtml = printbform.InnerHtml + " (" + rs.Rows[0]["printbform"] + ")"; string Project = Db.SingleString("SELECT Project FROM " + Mi.DbPrefix + "MARKETINGJUAL..MS_UNIT WHERE NoStock = '" + rs.Rows[0]["NoStock"] + "'"); printWL.HRef = "PrintWL.aspx?NoReservasi=" + NoReservasi + "&project=" + Project; printJadwalTagihan.HRef = "PrintJadwalTagihanReservasi.aspx?NoReservasi=" + NoReservasi + "&project=" + Project; printbform.HRef = "PrintBForm.aspx?NoReservasi=" + NoReservasi + "&project=" + Project; //req panahome int countTTS = Db.SingleInteger("select Count(*) from " + Mi.DbPrefix + "FINANCEAR..MS_TTS where NoReservasi = '" + NoReservasi + "' and Project = '" + Project + "'"); if (countTTS != 0) { int NoTTS = Db.SingleInteger("select ISNULL(NoTTS, 0) from " + Mi.DbPrefix + "FINANCEAR..MS_TTS where NoReservasi = '" + NoReservasi + "' and Project = '" + Project + "'"); int PrintTTS = Db.SingleInteger("select ISNULL(PrintTTS, 0) from " + Mi.DbPrefix + "FINANCEAR..MS_TTS where NoReservasi = '" + NoReservasi + "' and Project = '" + Project + "'"); printtts.HRef = "PrintTTS.aspx?NoTTS=" + NoTTS + "&project=" + Project; printtts.InnerHtml = printtts.InnerHtml + " (" + PrintTTS + ")"; } else { printtts.Visible = true; } } }
private bool Save() { if (valid()) { string Project = Db.SingleString("SELECT Project FROM MS_UNIT WHERE NoStock = (SELECT NoStock FROM MS_RESERVASI WHERE NoReservasi = '" + NoReservasi + "')"); DateTime Tgl = Convert.ToDateTime(tgl.Text); DateTime TglExpire = Convert.ToDateTime(batas.Text); int NoQueue = Convert.ToInt32(noqueue.Text); decimal Netto = Convert.ToDecimal(nilai.Text); string Skema = Cf.Str(skema.Text); int NoAgent = Convert.ToInt32(agent.SelectedValue); string Supervisor = Cf.Str(supervisor.Text); string Manager = Cf.Str(manager.Text); DataTable rsBef = Db.Rs("SELECT" + " CONVERT(varchar,MS_RESERVASI.Tgl,106) AS [Tanggal]" + ",CONVERT(varchar,MS_RESERVASI.TglExpire,100) AS [Batas Waktu]" + ",MS_RESERVASI.Netto AS [Nilai Pengikatan]" + ",MS_RESERVASI.Skema AS [Skema]" + ",MS_AGENT.Nama + ' ' + MS_AGENT.Principal AS Agent" + ",NoQueue AS [NUP]" + ",Supervisor AS [Supervisor]" + ",MS_AGENT.Manager AS [Manager]" + " FROM MS_RESERVASI" + " INNER JOIN MS_AGENT" + " ON MS_RESERVASI.NoAgent = MS_AGENT.NoAgent" + " WHERE NoReservasi = " + NoReservasi ); Db.Execute("EXEC spReservasiEdit" + " " + NoReservasi + ", " + NoAgent + ",'" + Tgl + "'" + ",'" + TglExpire + "'" + ", " + Netto + ",'" + Skema + "'" + ", " + NoQueue ); Db.Execute("UPDATE MS_RESERVASI SET " + " Supervisor ='" + Supervisor + "'" + ",Manager ='" + Manager + "'" + " WHERE NoReservasi = '" + NoReservasi + "'" ); DataTable rsAft = Db.Rs("SELECT" + " CONVERT(varchar,MS_RESERVASI.Tgl,106) AS [Tanggal]" + ",CONVERT(varchar,MS_RESERVASI.TglExpire,100) AS [Batas Waktu]" + ",MS_RESERVASI.Netto AS [Nilai Pengikatan]" + ",MS_RESERVASI.Skema AS [Skema]" + ",MS_AGENT.Nama + ' ' + MS_AGENT.Principal AS Agent" + ",NoQueue AS [NUP]" + ",Supervisor AS [Supervisor]" + ",MS_AGENT.Manager AS [Manager]" + " FROM MS_RESERVASI" + " INNER JOIN MS_AGENT" + " ON MS_RESERVASI.NoAgent = MS_AGENT.NoAgent" + " WHERE NoReservasi = " + NoReservasi ); Db.Execute("EXEC spLogReservasi" + " 'EDIT'" + ",'" + Act.UserID + "'" + ",'" + Act.IP + "'" + ",'" + Cf.LogCompare(rsBef, rsAft) + "'" + ",'" + NoReservasi.ToString().PadLeft(5, '0') + "'" ); decimal LogID = Db.SingleDecimal("SELECT TOP 1 LogID FROM MS_RESERVASI_LOG ORDER BY LogID DESC"); Db.Execute("UPDATE MS_RESERVASI_LOG SET Project = '" + Project + "' WHERE LogID = " + LogID); return(true); } else { return(false); } }