Example #1
0
        protected void btn_Click(object sender, System.EventArgs e)
        {
            string Username = Cf.Str(username.Text);

            if (IsExist(Username))
            {
                string strSql = "SELECT "
                                + " UserID, Pass, SecLevel, GantiPass "
                                + " FROM USERNAME WHERE UserID = '" + Username + "'";
                DataTable rs = Db.Rs(strSql);

                string UserID    = rs.Rows[0]["UserID"].ToString();
                string Pass      = rs.Rows[0]["Pass"].ToString();
                string SecLevel  = rs.Rows[0]["SecLevel"].ToString();
                bool   GantiPass = (bool)rs.Rows[0]["GantiPass"];

                if (rs.Rows[0]["Pass"].ToString() != pass.Text)
                {
                    SalahPass(UserID);
                }
                else
                {
                    //if (IsInside(UserID))
                    //{
                    //    //Double Login
                    //    Db.Execute("EXEC spAppDoubleLogin "
                    //        + " '" + UserID + "'"
                    //        + ",'" + Act.IP + "'"
                    //        );

                    //    Js.Alert(
                    //        this
                    //        , "Double Login.\\n"
                    //        + "Masih ada user lain di dalam aplikasi dengan username anda.\\n"
                    //        + "Silakan mencoba untuk login kembali 5 menit lagi."
                    //        , "document.getElementById('pass').focus();"
                    //        + "document.getElementById('pass').select();"
                    //        );
                    //}
                    //else
                    //{
                    LogIn(UserID, SecLevel, GantiPass);
                    //}
                }
            }
        }
Example #2
0
        public static string inSql(CheckBoxList cb)
        {
            StringBuilder x = new StringBuilder();

            for (int i = 0; i < cb.Items.Count; i++)
            {
                if (cb.Items[i].Selected)
                {
                    if (x.ToString() != "")
                    {
                        x.Append(",");
                    }

                    x.Append("'" + Cf.Str(cb.Items[i].Value) + "'");
                }
            }

            return(x.ToString());
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable rs = Db.Rs("SELECT * FROM REF_PROJECT");

            //Daily Report
            LibApi.DeleteReport(LibApi.TipeReport(1));
            LibApi.DeleteFolderPDF(Param.FolderPDF + LibApi.TipeReport(1));

            //Laporan Penjualan
            LibApi.DeleteReport(LibApi.TipeReport(2));
            LibApi.DeleteFolderPDF(Param.FolderPDF + LibApi.TipeReport(2));

            //Laporan Batal Kontrak
            LibApi.DeleteReport(LibApi.TipeReport(3));
            LibApi.DeleteFolderPDF(Param.FolderPDF + LibApi.TipeReport(3));

            //Management Report
            LibApi.DeleteReport(LibApi.TipeReport(4));
            LibApi.DeleteFolderPDF(Param.FolderPDF + LibApi.TipeReport(4));

            for (int i = 0; i < rs.Rows.Count; i++)
            {
                string project = Cf.Str(rs.Rows[i]["Project"]).ToString();

                //Daily Report
                LibApi.CreateFilePDFDailyReport(DateTime.Today.AddDays(-1), "server", project, true);

                //Laporan Penjualan
                LibApi.CreateFilePDFLapPenjualan("server", "SEMUA", "SEMUA", "SEMUA", Cf.AwalBulan(), Cf.AkhirBulan(), project, true);

                //Laporan Batal Kontrak
                LibApi.CreateFilePDFLapBatalKontrak("server", "SEMUA", "SEMUA", Cf.AwalBulan(), Cf.AkhirBulan(), project, true);

                //Management Report
                LibApi.CreateFilePDFManagementReport(DateTime.Today.AddDays(-1), "server", project, true);
            }
        }
Example #4
0
 //Driver
 public static string GetParam(string ParamID)
 {
     return(Db.SingleString("SELECT Value FROM REF_PARAM WHERE ParamID = '" + Cf.Str(ParamID) + "'"));
 }