Exemple #1
0
        protected void upload_Click(object sender, System.EventArgs e)
        {
            namapeta.Text = Cf.FileSafe(namapeta.Text);

            if (namapeta.Text == "" ||
                !file1.PostedFile.FileName.EndsWith(".jpg"))
            {
                Js.Alert(
                    this
                    , "Proses Upload Gagal.\\n"
                    + "1. Nama Peta tidak boleh kosong.\\n"
                    + "2. Extension file peta utama hanya boleh JPG.\\n"
                    //+ "3. Extension file peta nomor hanya boleh PNG\\n"
                    , "document.getElementById('namapeta').focus();"
                    + "document.getElementById('namapeta').select();"
                    );
            }
            else
            {
                string NamaPeta = Cf.FileSafe(namapeta.Text);

                string pdasar = Request.PhysicalApplicationPath.Replace("admin", "marketing")
                                + "FP\\Base\\" + Tower + "\\" + NamaPeta + ".jpg"; //file dasar
                string pstatus = Request.PhysicalApplicationPath.Replace("admin", "marketing")
                                 + "FP\\" + NamaPeta + ".jpg";                     //file status

                //string pnomor = Request.PhysicalApplicationPath.Replace("admin", "marketing")
                //    + "FP\\" + NamaPeta + ".png"; //file nomor

                Dfc.UploadFile(".jpg", pdasar, file1);
                //Dfc.UploadFile(".png", pnomor, file2);

                Dfc.CopyFile(pdasar, pstatus);//Copy dari base ke status

                //Logfile
                string Ket = "***UPLOAD FLOOR PLAN : " + NamaPeta;

                Db.Execute("EXEC spLogUnit"
                           + " 'FP'"
                           + ",'" + Act.UserID + "'"
                           + ",'" + Act.IP + "'"
                           + ",'" + Ket + "'"
                           + ",''"
                           );

                feed.Text = "<img src='/Media/db.gif' align=absmiddle> "
                            + "Upload Berhasil...";
            }
        }
Exemple #2
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            Act.Pass();
            Act.NoCache();

            if (File.Exists(Request.PhysicalApplicationPath + "FP\\UnitLokasi\\" + Cf.FileSafe(NoUnit) + ".jpg"))
            {
                unit.ImageUrl = "PetaBesar.aspx?f=FP/UnitLokasi/" + Cf.FileSafe(NoUnit) + ".jpg";
                noimg.Visible = false;
            }
            else
            {
                unit.Visible  = false;
                noimg.Visible = true;
            }
        }
Exemple #3
0
        /// <summary>
        /// Redrawing process
        /// </summary>
        public static void GenerateFP(string Peta)
        {
            if (Peta != "")
            {
                string loc = System.Web.HttpContext.Current.Request.PhysicalApplicationPath
                             + "FP\\";
                string Src    = loc + "Base\\" + Cf.FileSafe(Peta) + ".jpg";
                string Target = loc + Cf.FileSafe(Peta) + ".jpg";

                if (System.IO.File.Exists(Src))
                {
                    Bitmap   objBitmap   = new Bitmap(Src);
                    Graphics objGraphics = Graphics.FromImage(objBitmap);

                    string strSql = "SELECT Status, Koordinat, NoStock"
                                    + " FROM MS_UNIT "
                                    + " WHERE Peta = '" + Peta + "'";

                    DataTable rs = Db.Rs(strSql);
                    for (int i = 0; i < rs.Rows.Count; i++)
                    {
                        if (!System.Web.HttpContext.Current.Response.IsClientConnected)
                        {
                            break;
                        }

                        string Coordinate = rs.Rows[i]["Koordinat"].ToString();
                        string status     = rs.Rows[i]["Status"].ToString();
                        string NoStock    = rs.Rows[i]["NoStock"].ToString();

                        string[] arrCoordinate = Coordinate.Split(new char[] { ',' });
                        System.Collections.ArrayList myPointList = new System.Collections.ArrayList();

                        for (int ix = 0; ix < arrCoordinate.GetUpperBound(0); ix = ix + 2)
                        {
                            myPointList.Add(new Point(
                                                Convert.ToInt32(arrCoordinate[ix])
                                                , Convert.ToInt32(arrCoordinate[ix + 1])));
                        }

                        Point[] ArrPoint = new Point[myPointList.Count];

                        for (int jx = 0; jx < myPointList.Count; jx++)
                        {
                            ArrPoint[jx] = (Point)myPointList[jx];
                        }

                        Color ColorPoly = new Color();
                        Color myColor   = Color.FromArgb(50, Color.White);

                        if (status == "B")
                        {
                            int c = Db.SingleInteger("SELECT COUNT(*) FROM MS_KONTRAK WHERE Status = 'A' AND NoStock = '" + NoStock + "'");
                            if (c != 0)
                            {
                                ColorPoly = Color.Red; //sold
                            }
                            else
                            {
                                ColorPoly = Color.Orange; //hold internal
                            }
                        }
                        else
                        {
                            int c = Db.SingleInteger("SELECT COUNT(*) FROM MS_RESERVASI WHERE Status = 'A' AND NoStock = '" + NoStock + "'");
                            if (c != 0)
                            {
                                ColorPoly = Color.Blue; //booked
                            }
                            else
                            {
                                ColorPoly = Color.Green; //available
                            }
                        }

                        objGraphics.FillPolygon(
                            new HatchBrush(HatchStyle.DarkUpwardDiagonal, ColorPoly, myColor)
                            , ArrPoint);
                    }

                    objBitmap.Save(Target);

                    objGraphics.Dispose();
                    objBitmap.Dispose();
                }
            }
        }
Exemple #4
0
        /// <summary>
        /// Redrawing process
        /// </summary>
        public static void GenerateFP(string Peta)
        {
            if (Peta != "")
            {
                string loc = System.Web.HttpContext.Current.Request.PhysicalApplicationPath.Replace("admin", "marketing")
                             + "FP\\";
                string Src    = loc + "Base\\" + Cf.FileSafe(Peta) + ".jpg";
                string Target = loc + Cf.FileSafe(Peta) + ".jpg";

                if (System.IO.File.Exists(Src))
                {
                    Bitmap   objBitmap   = new Bitmap(Src);
                    Graphics objGraphics = Graphics.FromImage(objBitmap);

                    string strSql = "SELECT Status, Koordinat"
                                    + " FROM MS_UNIT "
                                    + " WHERE Peta = '" + Peta + "'";

                    DataTable rs = Db.Rs(strSql);
                    for (int i = 0; i < rs.Rows.Count; i++)
                    {
                        if (!System.Web.HttpContext.Current.Response.IsClientConnected)
                        {
                            break;
                        }

                        string Coordinate = rs.Rows[i]["Koordinat"].ToString();
                        string status     = rs.Rows[i]["Status"].ToString();

                        string[] arrCoordinate = Coordinate.Split(new char[] { ',' });
                        System.Collections.ArrayList myPointList = new System.Collections.ArrayList();

                        for (int ix = 0; ix < arrCoordinate.GetUpperBound(0); ix = ix + 2)
                        {
                            myPointList.Add(new Point(
                                                Convert.ToInt32(arrCoordinate[ix])
                                                , Convert.ToInt32(arrCoordinate[ix + 1])));
                        }

                        Point[] ArrPoint = new Point[myPointList.Count];

                        for (int jx = 0; jx < myPointList.Count; jx++)
                        {
                            ArrPoint[jx] = (Point)myPointList[jx];
                        }

                        if (status == "B")
                        {
                            Color ColorPoly = new Color();
                            ColorPoly = Color.Red;

                            Color myColor = Color.FromArgb(100, Color.White);

                            objGraphics.FillPolygon(
                                new HatchBrush(HatchStyle.ForwardDiagonal, ColorPoly, myColor)
                                , ArrPoint);
                        }
                    }

                    objBitmap.Save(Target);

                    objGraphics.Dispose();
                    objBitmap.Dispose();
                }
            }
        }
Exemple #5
0
        protected void save_Click(object sender, System.EventArgs e)
        {
            if (datavalid() && BFLunas())
            {
                DateTime TglPPJB             = new DateTime();
                DateTime TglSuratKuasa       = new DateTime();
                DateTime TglSuratPersetujuan = new DateTime();

                if (tglppjb.Text != "")
                {
                    TglPPJB = Convert.ToDateTime(tglppjb.Text);
                }

                if (tglskuasa.Text != "")
                {
                    TglSuratKuasa = Convert.ToDateTime(tglskuasa.Text);
                }

                if (tglspersetujuan.Text != "")
                {
                    TglSuratPersetujuan = Convert.ToDateTime(tglspersetujuan.Text);
                }

                string Sebagai    = Cf.Str(seb.SelectedValue);
                string kAkta      = Cf.Str(Cf.FileSafe(akta.Text));
                string kSK        = Cf.Str(Cf.FileSafe(nosk.Text));
                string kNama      = Cf.Str(Cf.FileSafe(nama.Text));
                string kKedudukan = Cf.Str(Cf.FileSafe(kedudukan.Text));
                string kAlamat    = Cf.Str(Cf.FileSafe(alamat.Text));
                string kRT        = Cf.Str(Cf.FileSafe(rt.Text));
                string kRW        = Cf.Str(Cf.FileSafe(rw.Text));
                string kKel       = Cf.Str(Cf.FileSafe(kel.Text));
                string kKec       = Cf.Str(Cf.FileSafe(kec.Text));
                string kKomad     = Cf.Str(Cf.FileSafe(komad.Text));
                string kProv      = Cf.Str(Cf.FileSafe(prov.Text));

                string NoPPJB = Db.SingleString("SELECT NoPPJB FROM MS_KONTRAK WHERE NoKontrak = '" + NoKontrak + "'");
                if (NoPPJB == "")
                {
                    NoPPJB = AutoID();
                }

                Db.Execute("EXEC spKontrakPPJB "
                           + " '" + NoKontrak + "'"
                           + ",'" + NoPPJB + "'"
                           + ",'" + TglPPJB + "'"
                           );

                //Notes : Data-data PPJB ini dibuat by request, tapi pada akhirnya tidak digunakan. (Per 10 Juni 2015 - Himawan)
                Db.Execute("UPDATE MS_KONTRAK"
                           + " SET NilaiRealisasiKPR = " + Convert.ToDecimal(nilaikpa.Text)
                           + ", RekeningCairKPR = '" + rekcair.SelectedValue + "'"
                           + ", PPJBSuratKuasaTgl = '" + TglSuratKuasa + "'"
                           + ", PPJBSuratPersetujuanTgl = '" + TglSuratPersetujuan + "'"
                           + ", PPJBSebagai = '" + Sebagai + "'"
                           + ", PPJBSebagaiNoAkta = '" + kAkta + "'"
                           + ", PPJBSebagaiNoSK = '" + kSK + "'"
                           + ", PPJBSebagaiNama = '" + kNama + "'"
                           + ", PPJBSebagaiKedudukan = '" + kKedudukan + "'"
                           + ", PPJBSebagaiAlamat = '" + kAlamat + "'"
                           + ", PPJBSebagaiRT = '" + kRT + "'"
                           + ", PPJBSebagaiRW = '" + kRW + "'"
                           + ", PPJBSebagaiKel = '" + kKel + "'"
                           + ", PPJBSebagaiKec = '" + kKec + "'"
                           + ", PPJBSebagaiKomad = '" + kKomad + "'"
                           + ", PPJBSebagaiProv = '" + kProv + "'"
                           + " WHERE NoKontrak = '" + NoKontrak + "'"
                           );

                DataTable rs = Db.Rs("SELECT"
                                     + " MS_KONTRAK.NoKontrak AS [No. Kontrak]"
                                     + ",MS_KONTRAK.NoUnit AS [Unit]"
                                     + ",MS_CUSTOMER.Nama AS [Customer]"
                                     + ",NoPPJB AS [No. PPJB]"
                                     + ",CONVERT(varchar, TglPPJB, 106) AS [Tanggal PPJB]"
                                     + ",PersenLunas AS [Prosentase Pelunasan]"
                                     + " FROM MS_KONTRAK INNER JOIN MS_CUSTOMER"
                                     + " ON MS_KONTRAK.NoCustomer = MS_CUSTOMER.NoCustomer"
                                     + " WHERE MS_KONTRAK.NoKontrak = '" + NoKontrak + "'");

                decimal NilaiBiaya = Convert.ToDecimal(nilaibiaya.Text);
                if (NilaiBiaya != 0)
                {
                    Db.Execute("EXEC spTagihanDaftar "
                               + " '" + NoKontrak + "'"
                               + ",'BIAYA ADM. PPJB'"
                               + ",'" + TglPPJB + "'"
                               + ", " + NilaiBiaya
                               + ",'ADM'"
                               );
                }

                string ket = Cf.LogCapture(rs)
                             + "<br>Biaya Administrasi : " + Cf.Num(NilaiBiaya)
                ;

                Db.Execute("EXEC spLogKontrak "
                           + " 'PPJB'"
                           + ",'" + Act.UserID + "'"
                           + ",'" + Act.IP + "'"
                           + ",'" + ket + "'"
                           + ",'" + NoKontrak + "'"
                           );

                decimal LogID   = Db.SingleDecimal("SELECT TOP 1 LogID FROM MS_KONTRAK_LOG ORDER BY LogID DESC");
                string  Project = Db.SingleString("SELECT Project FROM MS_KONTRAK WHERE NoKontrak = '" + NoKontrak + "'");
                Db.Execute("UPDATE MS_KONTRAK_LOG SET Project = '" + Project + "' WHERE LogID  = " + LogID);

                if (dariReminder.Checked)
                {
                    Response.Redirect("ReminderPPJB.aspx?done=" + NoKontrak);
                }
                else
                {
                    Response.Redirect("KontrakPPJB.aspx?done=" + NoKontrak);
                }
            }
        }