protected void unblock_user(String userid)
        {
            try
            {
                var dataTable = this.conn.GetDataTable("SELECT  * FROM SCALLUSERFLAG where userid='" + userid + "' and SU_REVOKE ='0'", null, this.dbtimeout, true, true);
                if (dataTable.Rows.Count > 0)
                {
                    this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('User not block');", true);
                    return;
                }
                else
                {
                    NameValueCollection nameValueCollectionKey = new NameValueCollection();
                    NameValueCollection nameValueCollection    = new NameValueCollection();
                    StaticFramework.SaveNvc(nameValueCollectionKey, "USERID", userid);
                    StaticFramework.SaveNvc(nameValueCollection, "SU_REVOKE", "0");
                    StaticFramework.SaveNvc(nameValueCollection, "SU_FALSEPWDCOUNT", "0");
                    StaticFramework.Save(nameValueCollection, nameValueCollectionKey, "SCALLUSERFLAG", this.conn);

                    //this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Succes You unblock user ');", true);
                    //return;

                    // Response.Write("<script>alert('Succes You unblock user')</script>");
                    // return;


                    ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Succes You unblock user');", true);
                }
            }
            catch (Exception ex)
            {
                this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Error unblock')", true);
            }
        }
        public void UNIT_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (Session["GROUPID"].ToString().Equals("002PEN"))
            {
                StaticFramework.Reff(this.JENIS, "SELECT REPORTID , REPORTNAME FROM VW_NAMALAPORAN WHERE UNITID ='" + Session["UnitID"].ToString() + "' AND INSTANSIID ='" + INSTANSIID.SelectedValue.ToString() + "'  AND PERIODE ='" + PERIODE.SelectedValue.ToString() + "' and PIC ='" + Session["Userid"].ToString() + "'", null, this.conn, false);
            }
            else if (Session["GROUPID"].ToString().Equals("003HEAD") && Request.QueryString["AP"].ToString().Equals(""))
            {
                StaticFramework.Reff(this.JENIS, "SELECT REPORTID , REPORTNAME FROM VW_NAMALAPORAN WHERE UNITID ='" + Session["UnitID"].ToString() + "' AND INSTANSIID ='" + INSTANSIID.SelectedValue.ToString() + "'  AND PERIODE ='" + PERIODE.SelectedValue.ToString() + "' and DEPTHEAD ='" + Session["Userid"].ToString() + "'", null, this.conn, false);
            }
            //if (Session["GROUPID"].ToString().Equals("002PEN") || (Session["GROUPID"].ToString().Equals("003HEAD") && Request.QueryString["AP"].ToString().Equals("")))
            //{
            //    StaticFramework.Reff(this.JENIS, "SELECT REPORTID , REPORTNAME FROM VW_NAMALAPORAN WHERE UNITID ='" + Session["UnitID"].ToString() + "' AND INSTANSIID ='" + INSTANSIID.SelectedValue.ToString() + "'  AND PERIODE ='" + PERIODE.SelectedValue.ToString() + "'", null, this.conn, false);
            //    L_UNIT = Session["UnitID"].ToString();
            //}

            else
            {
                StaticFramework.Reff(this.JENIS, "SELECT REPORTID , REPORTNAME FROM VW_NAMALAPORAN WHERE UNITID ='" + UNIT.SelectedValue.ToString() + "' AND INSTANSIID ='" + INSTANSIID.SelectedValue.ToString() + "' AND PERIODE ='" + PERIODE.SelectedValue.ToString() + "'", null, this.conn, false);
                L_UNIT = UNIT.SelectedValue.ToString();
            }
            //StaticFramework.Reff(this.JENIS, "SELECT REPORTID , REPORTNAME FROM VW_JENISREPORT WHERE UNITID ='" + UNIT.SelectedValue.ToString() + "' ", null, this.conn, false);

            //StaticFramework.Reff(this.PIC, "SELECT [USERID] , [SU_FULLNAME] FROM  [MRSDATA].[dbo].[VW_USER] WHERE UNIT ='" + UNIT.SelectedValue.ToString() + "' and [GROUPID] ='002PEN'", null, this.conn, false);

            //StaticFramework.Reff(this.DEPTHEAD, "SELECT [USERID] , [SU_FULLNAME] FROM  [MRSDATA].[dbo].[VW_USER] WHERE UNIT ='" + UNIT.SelectedValue.ToString() + "' and [GROUPID] ='003HEAD'", null, this.conn, false);
        }
 public void PERIODE_SelectedIndexChanged(object sender, EventArgs e)
 {
     System.Data.DataTable dt_PERIODE = conn.GetDataTable("SELECT * FROM VW_RFPERIODE where PERIODEID= '" + PERIODE.SelectedValue.ToString() + "' ", null, this.dbtimeout, true, true);
     if (dt_PERIODE.Rows.Count > 0)
     {
         s_periode = dt_PERIODE.Rows[0]["FLAG"].ToString();
         if (dt_PERIODE.Rows[0]["FLAG"].ToString().Equals("1"))
         {
             div_ListPelaporan.Style.Add("display", "");
             div_BulanPelaporan.Style.Add("display", "");
             div_tanggalPelaporan.Style.Add("display", "NONE");
             StaticFramework.Reff(this.TANGGAL_PERIODE, Q_TANGGAL, null, this.conn, false);
             StaticFramework.Reff(this.BULAN_PERIODE, Q_BULAN, null, this.conn, false);
             Bind_DataList();
         }
         else if (dt_PERIODE.Rows[0]["FLAG"].ToString().Equals("2"))
         {
             div_BulanPelaporan.Style.Add("display", "NONE");
             div_ListPelaporan.Style.Add("display", "NONE");
             div_tanggalPelaporan.Style.Add("display", "NONE");
         }
         else
         {
             div_BulanPelaporan.Style.Add("display", "NONE");
             div_ListPelaporan.Style.Add("display", "NONE");
             div_tanggalPelaporan.Style.Add("display", "");
             StaticFramework.Reff(this.DATETIMELIMIT, Q_TANGGAL, null, this.conn, false);
         }
     }
 }
        protected void edit_data()
        {
            try
            {
                NameValueCollection nameValueCollectionKey = new NameValueCollection();
                NameValueCollection nameValueCollection    = new NameValueCollection();
                StaticFramework.SaveNvc(nameValueCollectionKey, "USERID", NIK);
                StaticFramework.SaveNvc(nameValueCollection, "GROUPID", GROUP);
                StaticFramework.SaveNvc(nameValueCollection, "SU_FULLNAME", FULLNAME);
                StaticFramework.SaveNvc(nameValueCollection, "SU_EMAIL", email);
                StaticFramework.SaveNvc(nameValueCollection, "SU_EMAIL_2", email2);
                //StaticFramework.SaveNvc(nameValueCollection, "SU_EMAIL_KADIV", emailDivisi);
                //StaticFramework.SaveNvc(nameValueCollection, "SU_EMAIL_DEPHEAD", emailDevHead);
                //StaticFramework.SaveNvc(nameValueCollection, "SU_EMAIL_DIREKTUR", emailDirektur);
                //StaticFramework.SaveNvc(nameValueCollection, "SU_REGISTERBY", "TEST");
                StaticFramework.SaveNvc(nameValueCollection, "SU_HPNUM", NOUSER.Value.Replace("-", "").Replace(" ", ""));
                //StaticFramework.SaveNvc(nameValueCollection, "SU_HPNUM_DEPHEAD", NODEVHEAD.Value.Replace("-", "").Replace(" ", ""));
                //StaticFramework.SaveNvc(nameValueCollection, "SU_HPNUM_KADIV", NOKADIV.Value.Replace("-", ""));
                //StaticFramework.SaveNvc(nameValueCollection, "SU_HPNUM_DIREKTUR", NODIREKTUR.Value.Replace("-", "").Replace(" ", ""));
                //StaticFramework.SaveNvc(nameValueCollection, "SU_PWD", hash_password);
                // StaticFramework.SaveNvc(nameValueCollection, "SU_REGISTERDATE", DateTime.Now);
                //StaticFramework.SaveNvc(nameValueCollection, "SU_PWDEXPDATE", DateTime.Now.AddYears(5));
                // StaticFramework.SaveNvc(nameValueCollection, "SU_ACTIVE", "1");
                StaticFramework.SaveNvc(nameValueCollection, "UNIT", UNIT);

                if (GROUP.SelectedValue.Equals("003HEAD"))
                {
                    //StaticFramework.SaveNvc(nameValueCollection, "SU_EMAIL_KADIV", emailDivisi);
                    //StaticFramework.SaveNvc(nameValueCollection, "SU_EMAIL_DEPHEAD", emailDevHead);
                    StaticFramework.SaveNvc(nameValueCollection, "SU_UPLINER", SU_UPLINER);
                    //StaticFramework.SaveNvc(nameValueCollection, "SU_HPNUM_DEPHEAD", NODEVHEAD.Value.Replace("-", "").Replace(" ", ""));
                    //StaticFramework.SaveNvc(nameValueCollection, "SU_HPNUM_KADIV", NOKADIV.Value.Replace("-", ""));
                }
                else if (GROUP.SelectedValue.Equals("002PEN"))
                {
                    StaticFramework.SaveNvc(nameValueCollection, "USER_DELEGATE", PIC2);
                    StaticFramework.SaveNvc(nameValueCollection, "SU_UPLINER", SU_UPLINER);
                }
                else if (GROUP.SelectedValue.Equals("004KADIV"))
                {
                    StaticFramework.SaveNvc(nameValueCollection, "SU_EMAIL_DIREKTUR", emailDirektur);
                    StaticFramework.SaveNvc(nameValueCollection, "SU_HPNUM_DIREKTUR", NODIREKTUR.Value.Replace("-", "").Replace(" ", ""));
                }

                StaticFramework.Save(nameValueCollection, nameValueCollectionKey, "SCALLUSER", this.conn);

                NameValueCollection nameValueCollectionKey1 = new NameValueCollection();
                NameValueCollection nameValueCollection1    = new NameValueCollection();
                StaticFramework.SaveNvc(nameValueCollectionKey1, "USERID", NIK);
                StaticFramework.SaveNvc(nameValueCollection1, "SU_LOGON", cb_login);

                StaticFramework.Save(nameValueCollection1, nameValueCollectionKey1, "SCALLUSERFLAG", this.conn);
            }
            catch (Exception e)
            {
                var page = HttpContext.Current.CurrentHandler as Page;
                ScriptManager.RegisterStartupScript(page, page.GetType(), "alert", "alert('error save');", true);
            }
        }
Пример #5
0
 protected void RetrieveData()
 {
     System.Data.DataTable dataTable = this.conn.GetDataTable("SELECT  * FROM [VW_RFINSTANSI] where INSTANSIID='" + ID + "' ", null, this.dbtimeout, true, true);
     if (dataTable.Rows.Count > 0)
     {
         StaticFramework.Retrieve(dataTable, INSTANSIID);
         StaticFramework.Retrieve(dataTable, INSTANSINAME);
     }
 }
        protected void edit_Click(object sender, EventArgs e)
        {
            Button btn = (Button)sender;

            //BULAN_PERIODE.SelectedValue = btn.CommandArgument.ToString().Split(':')[0].ToString();
            //TANGGAL_PERIODE.SelectedValue = btn.CommandArgument.ToString().Split(':')[1].ToString();
            StaticFramework.Retrieve(btn.CommandArgument.ToString().Split(':')[0].ToString(), BULAN_PERIODE);
            StaticFramework.Retrieve(btn.CommandArgument.ToString().Split(':')[1].ToString(), KETERANGAN);
        }
        public void UNIT_SelectedIndexChanged(object sender, EventArgs e)
        {
            //            StaticFramework.Reff(this.JENIS, "SELECT REPORTID , REPORTNAME FROM VW_JENISREPORT WHERE UNITID ='" + UNIT.SelectedValue.ToString() + "' AND INSTANSIID ='" + INSTANSIID.SelectedValue.ToString() + "'", null, this.conn, false);

            //StaticFramework.Reff(this.JENIS, "SELECT REPORTID , REPORTNAME FROM VW_JENISREPORT WHERE UNITID ='" + UNIT.SelectedValue.ToString() + "' ", null, this.conn, false);

            StaticFramework.Reff(this.PIC, "SELECT [USERID] , [SU_FULLNAME] FROM  [MRSDATA].[dbo].[VW_USER] WHERE UNIT ='" + ddl_UNIT.SelectedValue.ToString() + "' and [GROUPID] ='002PEN'", null, this.conn, false);

            StaticFramework.Reff(this.DEPTHEAD, "SELECT [USERID] , [SU_FULLNAME] FROM  [MRSDATA].[dbo].[VW_USER] WHERE UNIT ='" + ddl_UNIT.SelectedValue.ToString() + "' and [GROUPID] ='003HEAD'", null, this.conn, false);
        }
        protected void save_data()
        {
            try
            {
                for (int i = 0; i < INSTANSIID.Items.Count; i++)
                {
                    if (INSTANSIID.Items[i].Selected)
                    {
                        NameValueCollection nameValueCollectionKey = new NameValueCollection();
                        NameValueCollection nameValueCollection    = new NameValueCollection();
                        StaticFramework.SaveNvc(nameValueCollectionKey, "AP_REGNO", IdGenerate);
                        StaticFramework.SaveNvc(nameValueCollectionKey, "INSTANSIID", INSTANSIID.Items[i].Value.ToString());
                        StaticFramework.SaveNvc(nameValueCollectionKey, "UNIT", UNIT);
                        StaticFramework.SaveNvc(nameValueCollectionKey, "JENIS", JENIS);
                        StaticFramework.SaveNvc(nameValueCollection, "DEPTHEAD", DEPTHEAD);
                        StaticFramework.SaveNvc(nameValueCollection, "PIC", PIC);
                        StaticFramework.SaveNvc(nameValueCollectionKey, "PERIODE", PERIODE);

                        StaticFramework.SaveNvc(nameValueCollection, JENISREPORT);
                        StaticFramework.SaveNvc(nameValueCollection, "KETERANGAN", KETERANGAN);
                        StaticFramework.SaveNvc(nameValueCollection, "SANkSI_KET", Sanksi_ket);
                        StaticFramework.SaveNvc(nameValueCollection, "Sanksi", Sanksi.Value.ToString().Replace(",", ""));
                        //StaticFramework.SaveNvc(nameValueCollection, "Sanksi", Sanksi.Value.Replace(".", ""));
                        StaticFramework.SaveNvc(nameValueCollection, "USERCREATED", this.Session["UserID"].ToString());
                        StaticFramework.SaveNvc(nameValueCollection, "DATECREATED", DateTime.Now);
                        StaticFramework.SaveNvc(nameValueCollection, "STATUS", "1");
                        if (s_periode.Equals("0"))
                        {
                            StaticFramework.SaveNvc(nameValueCollection, DATETIMELIMIT);
                        }

                        StaticFramework.Save(nameValueCollection, nameValueCollectionKey, "DATA_COMPLIANCE", this.conn);
                    }
                }

                if (!Request.QueryString["IN"].ToString().Equals(""))
                {
                    var page = HttpContext.Current.CurrentHandler as Page;
                    ScriptManager.RegisterStartupScript(page, page.GetType(), "alert", "alert('Update Success');window.location ='Report_DataAlert.aspx';", true);
                }
                else
                {
                    var page = HttpContext.Current.CurrentHandler as Page;
                    ScriptManager.RegisterStartupScript(page, page.GetType(), "alert", "alert('Save Success');", true);
                }
                cleardata();
                IdGenerate = generateID();
            }
            catch (Exception e)
            {
                var page = HttpContext.Current.CurrentHandler as Page;
                ScriptManager.RegisterStartupScript(page, page.GetType(), "alert", "alert('error save');", true);
            }
        }
 private void RetreivedataDDL()
 {
     try
     {
         StaticFramework.Reff(this.ddl_UNIT, Q_UNIT, null, this.conn, false);
     }
     catch (Exception e)
     {
         ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('error : getdata')", true);
     }
 }
 public void PERIODE_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (Session["GROUPID"].ToString().Equals("002PEN"))
     {
         StaticFramework.Reff(this.JENIS, "SELECT REPORTID , REPORTNAME FROM VW_NAMALAPORAN WHERE UNITID ='" + Session["UnitID"].ToString() + "' AND INSTANSIID ='" + INSTANSIID.SelectedValue.ToString() + "'  AND PERIODE ='" + PERIODE.SelectedValue.ToString() + "' and PIC ='" + Session["Userid"].ToString() + "'", null, this.conn, false);
     }
     else if (Session["GROUPID"].ToString().Equals("003HEAD") && Request.QueryString["AP"].ToString().Equals(""))
     {
         StaticFramework.Reff(this.JENIS, "SELECT REPORTID , REPORTNAME FROM VW_NAMALAPORAN WHERE UNITID ='" + Session["UnitID"].ToString() + "' AND INSTANSIID ='" + INSTANSIID.SelectedValue.ToString() + "'  AND PERIODE ='" + PERIODE.SelectedValue.ToString() + "' and DEPTHEAD ='" + Session["Userid"].ToString() + "'", null, this.conn, false);
     }
     else
     {
         StaticFramework.Reff(this.JENIS, "SELECT distinct REPORTID , REPORTNAME FROM VW_NAMALAPORAN WHERE UNITID ='" + UNIT.SelectedValue.ToString() + "' AND INSTANSIID ='" + INSTANSIID.SelectedValue.ToString() + "' AND PERIODE ='" + PERIODE.SelectedValue.ToString() + "'", null, this.conn, false);
     }
 }
Пример #11
0
 protected void save_data_periode()
 {
     try
     {
         if (BULAN_PERIODE.SelectedValue.ToString().Equals(""))
         {
             var page = HttpContext.Current.CurrentHandler as Page;
             ScriptManager.RegisterStartupScript(page, page.GetType(), "alert", "alert('Pilih item pada daftar Bulan Pelaporan ');", true);
             BULAN_PERIODE.Focus();
         }
         else if (TANGGAL_PERIODE.SelectedValue.ToString().Equals(""))
         {
             var page = HttpContext.Current.CurrentHandler as Page;
             ScriptManager.RegisterStartupScript(page, page.GetType(), "alert", "alert('Pilih item pada daftar Tanggal Pelaporan ');", true);
             TANGGAL_PERIODE.Focus();
         }
         else
         {
             for (int i = 0; i < INSTANSIID.Items.Count; i++)
             {
                 if (INSTANSIID.Items[i].Selected)
                 {
                     NameValueCollection nameValueCollectionKey = new NameValueCollection();
                     NameValueCollection nameValueCollection    = new NameValueCollection();
                     StaticFramework.SaveNvc(nameValueCollectionKey, "AP_REGNO", IdGenerate);
                     StaticFramework.SaveNvc(nameValueCollectionKey, "INSTANSIID", INSTANSIID.Items[i].Value.ToString());
                     StaticFramework.SaveNvc(nameValueCollectionKey, "UNIT", UNIT);
                     StaticFramework.SaveNvc(nameValueCollectionKey, "BULAN", BULAN_PERIODE);
                     StaticFramework.SaveNvc(nameValueCollectionKey, "TANGGAL", TANGGAL_PERIODE);
                     StaticFramework.SaveNvc(nameValueCollectionKey, PERIODE);
                     StaticFramework.SaveNvc(nameValueCollection, "USERCREATED", this.Session["UserID"].ToString());
                     StaticFramework.SaveNvc(nameValueCollection, "DATECREATED", DateTime.Now);
                     StaticFramework.Save(nameValueCollection, nameValueCollectionKey, "DATA_PERIODE", this.conn);
                 }
             }
             Bind_DataList();
         }
     }
     catch (Exception e)
     {
         var page = HttpContext.Current.CurrentHandler as Page;
         ScriptManager.RegisterStartupScript(page, page.GetType(), "alert", "alert('error insert periode');", true);
     }
 }
Пример #12
0
 private void RetreivedataDDL()
 {
     try
     {
         if (Session["groupid"].ToString().Equals("00") || Session["groupid"].ToString().Equals("001COM"))
         {
             StaticFramework.Reff(this.FORWARD, "select USERID, SU_FULLNAME  from VW_FORWARD where GROUPID in('003HEAD','004KADIV')  ", null, this.conn, false);
         }
         else
         {
             StaticFramework.Reff(this.FORWARD, "select USERID, SU_FULLNAME  from VW_FORWARD where UNIT = '" + Session["Unitid"].ToString() + "'and GROUPID in('003HEAD','004KADIV')  and USERID not in (select distinct DEPTHEAD from DATA_COMPLIANCE where pic = '" + Session["userid"].ToString() + "')", null, this.conn, false);
         }
         StaticFramework.Reff(this.INSTANSIID, Q_INSTANSI, null, this.conn, false);
     }
     catch (Exception e)
     {
         ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('error : getdata')", true);
     }
 }
Пример #13
0
        protected void RetrieveData()
        {
            object[] param = new object[]
            {
                ID
            };

            System.Data.DataTable dataTable = this.conn.GetDataTable("SELECT  * FROM [VW_JENISREPORT] where REPORTID =@1", param, this.dbtimeout, true, true);
            if (dataTable.Rows.Count > 0)
            {
                UNIT.Enabled  = false;
                UNIT.CssClass = "form-control";
                StaticFramework.Retrieve(dataTable, REPORTID);
                StaticFramework.Retrieve(dataTable, REPORTNAME);
                StaticFramework.Retrieve(dataTable, "UNITID", UNIT);
                StaticFramework.Retrieve(dataTable, INSTANSIID);
                StaticFramework.Retrieve(dataTable, PERIODE);
            }
        }
        protected void reset_user(String userid)
        {
            try
            {
                hash_password = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile("bankmantap1", "sha1");

                NameValueCollection nameValueCollectionKey = new NameValueCollection();
                NameValueCollection nameValueCollection    = new NameValueCollection();
                StaticFramework.SaveNvc(nameValueCollectionKey, "USERID", userid);
                StaticFramework.SaveNvc(nameValueCollection, "SU_PWD", hash_password);
                StaticFramework.SaveNvc(nameValueCollection, "SU_ACTIVE", "1");
                StaticFramework.Save(nameValueCollection, nameValueCollectionKey, "SCALLUSER", this.conn);

                this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Succes You reset password. Password changed to bankmantap1 ');", true);
            }
            catch (Exception ex)
            {
                this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Error Delete')", true);
            }
        }
Пример #15
0
 private void RetreivedataDDL()
 {
     try
     {
         //StaticFramework.Reff(this.INSTANSIID, Q_RFINSTANSI, null, this.conn, false);
         StaticFramework.Reff(this.PERIODE, Q_PERIODE, null, this.conn, false);
         StaticFramework.Reff(this.UNIT, Q_UNIT, null, this.conn, false);
         System.Data.DataTable dt = this.conn.GetDataTable(Q_RFINSTANSI, null, this.dbtimeout, true, true);
         if (dt.Rows.Count > 0)
         {
             INSTANSIID.DataValueField = "INSTANSIID";
             INSTANSIID.DataTextField  = "INSTANSINAME";
             INSTANSIID.DataSource     = dt;
             INSTANSIID.DataBind();
         }
     }
     catch (Exception e)
     {
         ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('error getdata')", true);
     }
 }
Пример #16
0
        protected void save_data()
        {
            try
            {
                if (base.Request.QueryString["ID"].ToString().Equals(""))
                {
                    NameValueCollection nameValueCollectionKey = new NameValueCollection();
                    NameValueCollection nameValueCollection    = new NameValueCollection();
                    StaticFramework.SaveNvc(nameValueCollectionKey, INSTANSIID);
                    StaticFramework.SaveNvc(nameValueCollection, INSTANSINAME);
                    StaticFramework.SaveNvc(nameValueCollection, "DATECREATED", DateTime.Now);

                    StaticFramework.Save(nameValueCollection, nameValueCollectionKey, "RFINSTANSI", this.conn);
                }
            }
            catch (Exception e)
            {
                var page = HttpContext.Current.CurrentHandler as Page;
                ScriptManager.RegisterStartupScript(page, page.GetType(), "alert", "alert('error input data');", true);
            }
        }
Пример #17
0
        protected void save_data()
        {
            try
            {
                NameValueCollection nameValueCollectionKey = new NameValueCollection();
                NameValueCollection nameValueCollection    = new NameValueCollection();
                StaticFramework.SaveNvc(nameValueCollectionKey, REPORTID);
                StaticFramework.SaveNvc(nameValueCollection, REPORTNAME);
                StaticFramework.SaveNvc(nameValueCollection, "UNITID", UNIT);
                StaticFramework.SaveNvc(nameValueCollection, INSTANSIID);
                StaticFramework.SaveNvc(nameValueCollection, "ACTIVE", "1");
                StaticFramework.SaveNvc(nameValueCollection, PERIODE);
                StaticFramework.SaveNvc(nameValueCollection, "DATECREATED", DateTime.Now);

                StaticFramework.Save(nameValueCollection, nameValueCollectionKey, "JENISREPORT", this.conn);
            }
            catch (Exception e)
            {
                var page = HttpContext.Current.CurrentHandler as Page;
                ScriptManager.RegisterStartupScript(page, page.GetType(), "alert", "alert('error insert data');", true);
            }
        }
Пример #18
0
        public void INSTANSIID_SelectedIndexChanged(object sender, EventArgs e)
        {
            instansi = "";
            int index = 0;

            for (int i = 0; i < INSTANSIID.Items.Count; i++)
            {
                if (INSTANSIID.Items[i].Selected)
                {
                    if (index == 0)
                    {
                        instansi += INSTANSIID.Items[i].Value.ToString();
                    }
                    else
                    {
                        instansi += "," + INSTANSIID.Items[i].Value.ToString();
                    }
                    index += 1;
                }
            }

            StaticFramework.Reff(this.JENIS, "SELECT REPORTID , REPORTNAME FROM VW_JENISREPORT WHERE UNITID ='" + UNIT.SelectedValue.ToString() + "' AND INSTANSIID in (SELECT SPLITDATA FROM [dbo].[fnSplitString]('" + instansi + "',','))", null, this.conn, false);
            //StaticFramework.Reff(this.JENIS, "SELECT REPORTID , REPORTNAME FROM VW_JENISREPORT WHERE UNITID ='" + UNIT.SelectedValue.ToString() + "' ", null, this.conn, false);
        }
        public void GROUP_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (GROUP.SelectedValue.Equals("003HEAD"))
            {
                div_role.Visible     = true;
                div_penerima.Visible = false;
                div_kadiv.Visible    = false;
                StaticFramework.Reff(this.SU_UPLINER, "SELECT USERID,SU_FULLNAME FROM VW_KADIV WHERE UNIT='" + UNIT.SelectedValue.ToString() + "'", null, this.conn, false);

                lb_judul.Text = "Kepala Divisi";
            }
            else if (GROUP.SelectedValue.Equals("002PEN"))
            {
                div_penerima.Visible = true;
                div_role.Visible     = true;
                div_kadiv.Visible    = false;
                lb_judul.Text        = "Approval";

                StaticFramework.Reff(this.SU_UPLINER, "SELECT USERID,SU_FULLNAME FROM [VW_HEAD] WHERE UNIT='" + UNIT.SelectedValue.ToString() + "'", null, this.conn, false);

                StaticFramework.Reff(this.PIC2, "SELECT USERID,SU_FULLNAME FROM VW_PIC2 WHERE UNIT='" + UNIT.SelectedValue.ToString() + "' and USERID not in('" + NIK.Value.ToString() + "')", null, this.conn, false);
            }
            else if (GROUP.SelectedValue.Equals("004KADIV"))
            {
                div_penerima.Visible = false;
                div_role.Visible     = false;
                div_kadiv.Visible    = true;
            }

            else
            {
                div_kadiv.Visible    = false;
                div_role.Visible     = false;
                div_penerima.Visible = false;
            }
        }
Пример #20
0
 public void DEPTHEAD_SelectedIndexChanged(object sender, EventArgs e)
 {
     StaticFramework.Reff(this.PIC, "SELECT [USERID] , [SU_FULLNAME] FROM  [MRSDATA].[dbo].[VW_USER] WHERE UNIT ='" + UNIT.SelectedValue.ToString() + "' and SU_UPLINER='" + DEPTHEAD.SelectedValue.ToString() + "'  and [GROUPID] ='002PEN'", null, this.conn, false);
 }
Пример #21
0
        protected void save_Click(object sender, EventArgs e)
        {
            try
            {
                if (FORWARD.SelectedValue.Equals(""))
                {
                    var page11 = HttpContext.Current.CurrentHandler as Page;
                    ScriptManager.RegisterStartupScript(page11, page11.GetType(), "alert", "alert('Pilih item pada Forward');", true);

                    FORWARD.Focus();
                }
                else if (KET.Value.ToString().Equals(""))
                {
                    var page11 = HttpContext.Current.CurrentHandler as Page;
                    ScriptManager.RegisterStartupScript(page11, page11.GetType(), "alert", "alert('Harap isi keterangan');", true);

                    KET.Focus();
                }
                else
                {
                    int a = 0;
                    foreach (GridViewRow row in DataList.Rows)
                    {
                        CheckBox cb = (CheckBox)row.FindControl("chkCheck");
                        if (cb.Checked == true)
                        {
                            if (cb != null)
                            {
                                NameValueCollection nameValueCollectionKey = new NameValueCollection();
                                NameValueCollection nameValueCollection    = new NameValueCollection();
                                StaticFramework.SaveNvc(nameValueCollectionKey, "AP_REGINPUT", row.Cells[2].Text.ToString());
                                StaticFramework.SaveNvc(nameValueCollection, "USERFORWARD", FORWARD);
                                StaticFramework.SaveNvc(nameValueCollection, "KETERANGAN", KET);
                                StaticFramework.SaveNvc(nameValueCollection, "DATECREATED", DateTime.Now);
                                StaticFramework.SaveNvc(nameValueCollection, "USERCREATED", Session["Userid"].ToString());

                                StaticFramework.Save(nameValueCollection, nameValueCollectionKey, "DATA_FORWARD", this.conn);
                            }
                            a++;
                        }
                    }

                    if (a > 0)
                    {
                        var page11 = HttpContext.Current.CurrentHandler as Page;
                        ScriptManager.RegisterStartupScript(page11, page11.GetType(), "alert", "alert('Berhasil Forward');", true);
                        Bind_DataList();
                        f_forward.Visible    = false;
                        f_keterangan.Visible = false;
                        f_save.Visible       = false;
                        FORWARD.ClearSelection();
                        KET.Value = "";
                    }
                    else
                    {
                        var page11 = HttpContext.Current.CurrentHandler as Page;
                        ScriptManager.RegisterStartupScript(page11, page11.GetType(), "alert", "alert('Pilih data untuk Forward');", true);
                    }
                }
            }
            catch (Exception)
            {
                var page11 = HttpContext.Current.CurrentHandler as Page;
                ScriptManager.RegisterStartupScript(page11, page11.GetType(), "alert", "alert('Gagal Forward');", true);
            }
        }
        protected void RetrieveData()
        {
            object[] param = new object[]
            {
                IdGenerate
            };
            var dataTable = this.conn.GetDataTable("SELECT userid,UNIT,INSTANSIID,NOSURAT, convert(varchar,TGLSURAT,126) as TGLSURAT,PERIHAL,convert(varchar,DATETIMELIMIT,126) as DATETIMELIMIT,KETERANGAN,Sanksi, UNIT,convert(varchar,TGLINPUT,126) as TGLINPUT, UPLOADFILE,JENIS,PERIODE,JENISREPORT,SANKSI_KET FROM VW_APPMRS where AP_REGINPUT =@1", param, this.dbtimeout, true, true);

            if (dataTable.Rows.Count > 0)
            {
                StaticFramework.Retrieve(dataTable, this.INSTANSIID);
                StaticFramework.Retrieve(dataTable, this.NOSURAT);
                //StaticFramework.Retrieve(dataTable, this.TGLSURAT);
                if (!dataTable.Rows[0]["TGLSURAT"].ToString().Equals(""))
                {
                    dtime          = DateTime.ParseExact(dataTable.Rows[0]["TGLSURAT"].ToString(), "yyyy-MM-d", CultureInfo.InvariantCulture);
                    TGLSURAT.Value = dtime.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture);
                }
                StaticFramework.Retrieve(dataTable, this.PERIHAL);
                //StaticFramework.Retrieve(dataTable, this.DATETIMELIMIT);
                if (!dataTable.Rows[0]["DATETIMELIMIT"].ToString().Equals(""))
                {
                    dtime = DateTime.ParseExact(dataTable.Rows[0]["DATETIMELIMIT"].ToString(), "yyyy-MM-d", CultureInfo.InvariantCulture);
                    DATETIMELIMIT.Value = dtime.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture);
                }

                StaticFramework.Retrieve(dataTable, this.JENISREPORT);
                StaticFramework.Retrieve(dataTable, this.SANKSI_KET);
                StaticFramework.Retrieve(dataTable, this.PERIODE);
                StaticFramework.Retrieve(dataTable, this.KETERANGAN);
                //StaticFramework.Retrieve(dataTable, this.TGLINPUT);
                if (!dataTable.Rows[0]["TGLINPUT"].ToString().Equals(""))
                {
                    dtime          = DateTime.ParseExact(dataTable.Rows[0]["TGLINPUT"].ToString(), "yyyy-MM-d", CultureInfo.InvariantCulture);
                    TGLINPUT.Value = dtime.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture);
                }
                fileupload.Text = dataTable.Rows[0]["UPLOADFILE"].ToString();

                //Sanksi.Value = string.Format("{0:#,00}", Convert.ToDecimal(dataTable.Rows[0]["Sanksi"].ToString().Replace(",00", "").Replace(",", "")));
                if (!dataTable.Rows[0]["Sanksi"].ToString().Equals(""))
                {
                    Sanksi.Value = String.Format(CultureInfo.InvariantCulture, "{0:0,0}", Convert.ToDecimal(dataTable.Rows[0]["Sanksi"].ToString().Replace(",00", "").Replace(",", "")));
                }
                if (Session["GROUPID"].ToString().Equals("002PEN"))
                {
                    StaticFramework.Reff(this.JENIS, "SELECT REPORTID , REPORTNAME FROM VW_NAMALAPORAN WHERE UNITID ='" + Session["UnitID"].ToString() + "' AND INSTANSIID ='" + INSTANSIID.SelectedValue.ToString() + "'  AND PERIODE ='" + PERIODE.SelectedValue.ToString() + "' and PIC ='" + Session["Userid"].ToString() + "'", null, this.conn, false);
                    s_user = dataTable.Rows[0]["userid"].ToString();
                }
                else if (Session["GROUPID"].ToString().Equals("003HEAD") && Request.QueryString["AP"].ToString().Equals(""))
                {
                    StaticFramework.Reff(this.JENIS, "SELECT REPORTID , REPORTNAME FROM VW_NAMALAPORAN WHERE UNITID ='" + Session["UnitID"].ToString() + "' AND INSTANSIID ='" + INSTANSIID.SelectedValue.ToString() + "'  AND PERIODE ='" + PERIODE.SelectedValue.ToString() + "' and DEPTHEAD ='" + Session["Userid"].ToString() + "'", null, this.conn, false);
                    s_user = dataTable.Rows[0]["userid"].ToString();
                }
                else if (Session["GROUPID"].ToString().Equals("00"))
                {
                    StaticFramework.Retrieve(dataTable, this.UNIT);
                    StaticFramework.Reff(this.JENIS, "SELECT REPORTID , REPORTNAME FROM VW_NAMALAPORAN WHERE UNITID ='" + UNIT.SelectedValue.ToString() + "' AND INSTANSIID ='" + INSTANSIID.SelectedValue.ToString() + "' AND PERIODE ='" + PERIODE.SelectedValue.ToString() + "'", null, this.conn, false);
                    s_user = dataTable.Rows[0]["userid"].ToString();
                }
                else
                {
                    StaticFramework.Retrieve(dataTable, this.UNIT);
                    StaticFramework.Reff(this.JENIS, "SELECT REPORTID , REPORTNAME FROM VW_NAMALAPORAN WHERE UNITID ='" + UNIT.SelectedValue.ToString() + "' AND INSTANSIID ='" + INSTANSIID.SelectedValue.ToString() + "' AND PERIODE ='" + PERIODE.SelectedValue.ToString() + "'", null, this.conn, false);
                }
                StaticFramework.Retrieve(dataTable, this.JENIS);
            }
        }
        protected void RetrieveData()
        {
            object[] param = new object[]
            {
                ID,
                this.USERID
            };

            System.Data.DataTable dataTable = this.conn.GetDataTable("SELECT  * FROM [VW_USER] where USERID =@1", param, this.dbtimeout, true, true);
            if (dataTable.Rows.Count > 0)
            {
                StaticFramework.Retrieve(dataTable, "USERID", NIK);
                StaticFramework.Retrieve(dataTable, "SU_FULLNAME", FULLNAME);
                StaticFramework.Retrieve(dataTable, "UNIT", this.UNIT);
                StaticFramework.Retrieve(dataTable, "SU_HPNUM", this.NOUSER);
                StaticFramework.Retrieve(dataTable, "SU_EMAIL", this.email);
                StaticFramework.Retrieve(dataTable, "SU_EMAIL_2", this.email2);

                //StaticFramework.Retrieve(dataTable, "SU_HPNUM_DEPHEAD", this.NODEVHEAD);
                //StaticFramework.Retrieve(dataTable, "SU_EMAIL_DEPHEAD", this.emailDevHead);
                //StaticFramework.Retrieve(dataTable, "SU_HPNUM_KADIV", this.NOKADIV);
                //StaticFramework.Retrieve(dataTable, "SU_EMAIL_KADIV", this.emailDivisi);
                //StaticFramework.Retrieve(dataTable, "SU_HPNUM_DIREKTUR", this.NODIREKTUR);
                //StaticFramework.Retrieve(dataTable, "SU_EMAIL_DIREKTUR",this.emailDirektur);
                StaticFramework.Retrieve(dataTable, "GROUPID", this.GROUP);
                //email.Value = dataTable.Rows[0]["SU_EMAIL"].ToString();
                //emailDevHead.Value = dataTable.Rows[0]["SU_EMAIL_DEPHEAD"].ToString();
                //emailDivisi.Value = dataTable.Rows[0]["SU_EMAIL_KADIV"].ToString();
                //emailDirektur.Value = dataTable.Rows[0]["SU_EMAIL_DIREKTUR"].ToString();
                if (GROUP.SelectedValue.Equals("003HEAD"))
                {
                    div_role.Visible     = true;
                    div_kadiv.Visible    = false;
                    div_penerima.Visible = false;
                    // StaticFramework.Retrieve(dataTable, "SU_HPNUM_KADIV", this.NOKADIV);
                    // StaticFramework.Retrieve(dataTable, "SU_EMAIL_KADIV", this.emailDivisi);

                    StaticFramework.Reff(this.SU_UPLINER, "SELECT USERID,SU_FULLNAME FROM VW_KADIV WHERE UNIT='" + UNIT.SelectedValue.ToString() + "'", null, this.conn, false);
                    StaticFramework.Retrieve(dataTable, "SU_UPLINER", SU_UPLINER);
                    lb_judul.Text = "Kepala Divisi";
                }
                else if (GROUP.SelectedValue.Equals("002PEN"))
                {
                    div_penerima.Visible = true;
                    div_role.Visible     = true;
                    lb_judul.Text        = "Approval";
                    div_kadiv.Visible    = false;

                    StaticFramework.Reff(this.SU_UPLINER, "SELECT USERID,SU_FULLNAME FROM [VW_HEAD] WHERE UNIT='" + UNIT.SelectedValue.ToString() + "'", null, this.conn, false);
                    StaticFramework.Retrieve(dataTable, "SU_UPLINER", SU_UPLINER);

                    StaticFramework.Reff(this.PIC2, "SELECT USERID,SU_FULLNAME FROM VW_PIC2 WHERE UNIT='" + UNIT.SelectedValue.ToString() + "' and USERID not in('" + NIK.Value.ToString() + "')", null, this.conn, false);
                    StaticFramework.Retrieve(dataTable, "USER_DELEGATE", this.PIC2);
                }
                else if (GROUP.SelectedValue.Equals("004KADIV"))
                {
                    div_kadiv.Visible    = true;
                    div_role.Visible     = false;
                    div_penerima.Visible = false;
                    StaticFramework.Retrieve(dataTable, "SU_HPNUM_DIREKTUR", this.NODIREKTUR);
                    StaticFramework.Retrieve(dataTable, "SU_EMAIL_DIREKTUR", this.emailDirektur);
                }
                else
                {
                    div_role.Visible     = false;
                    div_kadiv.Visible    = false;
                    div_penerima.Visible = false;
                }

                System.Data.DataTable dataTable1 = this.conn.GetDataTable("select SU_LOGON from SCALLUSERFLAG  where USERID =@1", param, this.dbtimeout, true, true);
                if (dataTable1.Rows.Count > 0)
                {
                    StaticFramework.Retrieve(dataTable1, "SU_LOGON", this.cb_login);
                    if (cb_login.Checked)
                    {
                        cb_login.Text = "Sedang Login";
                    }
                    else
                    {
                        cb_login.Text = "Tidak Login";
                    }
                }
                div_login.Visible = true;
            }
        }
Пример #24
0
 public void INSTANSIID_SelectedIndexChanged(object sender, EventArgs e)
 {
     StaticFramework.Reff(this.JENIS, "SELECT REPORTID , REPORTNAME FROM VW_JENISREPORT WHERE UNITID ='" + UNIT.SelectedValue.ToString() + "' AND INSTANSIID ='" + INSTANSIID.SelectedValue.ToString() + "'", null, this.conn, false);
 }
        protected void save_data()
        {
            try
            {
                if (base.Request.QueryString["ID"].ToString().Equals(""))
                {
                    System.Data.DataTable dt = this.conn.GetDataTable("select * FROM [MRSDATA].[dbo].[LOGINPARAM]", null, this.dbtimeout, true, true);
                    if (dt.Rows.Count > 0)
                    {
                        PWDEXPDAY = int.Parse(dt.Rows[0]["PWDEXPDAY"].ToString());
                    }

                    object[] param = new object[]
                    {
                        NIK.Value.ToString().ToUpper()
                    };
                    System.Data.DataTable dataTableSms = this.conn.GetDataTable(Q_USER, param, this.dbtimeout, true, true);
                    if (dataTableSms.Rows.Count > 0)
                    {
                        if (dataTableSms.Rows[0]["USERID"].ToString().ToUpper().Equals(NIK.Value.ToString().ToUpper()))
                        {
                            var page1 = HttpContext.Current.CurrentHandler as Page;
                            ScriptManager.RegisterStartupScript(page1, page1.GetType(), "alert", "alert('User id atau NIK : " + NIK.Value.ToString() + " sudah terdaftar');", true);
                            MyPage.SetFocus(this, this.NIK);
                        }
                        else
                        {
                            hash_password = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile("bankmantap1", "sha1");

                            NameValueCollection nameValueCollectionKey = new NameValueCollection();
                            NameValueCollection nameValueCollection    = new NameValueCollection();
                            StaticFramework.SaveNvc(nameValueCollectionKey, "USERID", NIK);
                            StaticFramework.SaveNvc(nameValueCollection, "GROUPID", GROUP);
                            StaticFramework.SaveNvc(nameValueCollection, "SU_FULLNAME", FULLNAME);
                            StaticFramework.SaveNvc(nameValueCollection, "SU_EMAIL", email);
                            StaticFramework.SaveNvc(nameValueCollection, "SU_EMAIL_2", email2);
                            StaticFramework.SaveNvc(nameValueCollection, "SU_REGISTERBY", Session["UserID"].ToString());
                            StaticFramework.SaveNvc(nameValueCollection, "SU_HPNUM", NOUSER.Value.Replace("-", "").Replace(" ", ""));
                            StaticFramework.SaveNvc(nameValueCollection, "SU_PWD", hash_password);
                            StaticFramework.SaveNvc(nameValueCollection, "SU_REGISTERDATE", DateTime.Now);

                            StaticFramework.SaveNvc(nameValueCollection, "SU_PWDEXPDATE", DateTime.Now.AddDays(PWDEXPDAY));

                            StaticFramework.SaveNvc(nameValueCollection, "SU_ACTIVE", "1");
                            StaticFramework.SaveNvc(nameValueCollection, "UNIT", UNIT);

                            if (GROUP.SelectedValue.Equals("003HEAD"))
                            {
                                //StaticFramework.SaveNvc(nameValueCollection, "SU_EMAIL_KADIV", emailDivisi);
                                //StaticFramework.SaveNvc(nameValueCollection, "SU_EMAIL_DEPHEAD", emailDevHead);
                                StaticFramework.SaveNvc(nameValueCollection, "SU_UPLINER", SU_UPLINER);
                                //StaticFramework.SaveNvc(nameValueCollection, "SU_HPNUM_DEPHEAD", NODEVHEAD.Value.Replace("-", "").Replace(" ", ""));
                                //StaticFramework.SaveNvc(nameValueCollection, "SU_HPNUM_KADIV", NOKADIV.Value.Replace("-", ""));
                            }
                            else if (GROUP.SelectedValue.Equals("002PEN"))
                            {
                                StaticFramework.SaveNvc(nameValueCollection, "USER_DELEGATE", PIC2);
                                StaticFramework.SaveNvc(nameValueCollection, "SU_UPLINER", SU_UPLINER);
                            }
                            else if (GROUP.SelectedValue.Equals("004KADIV"))
                            {
                                StaticFramework.SaveNvc(nameValueCollection, "SU_EMAIL_DIREKTUR", emailDirektur);
                                StaticFramework.SaveNvc(nameValueCollection, "SU_HPNUM_DIREKTUR", NODIREKTUR.Value.Replace("-", "").Replace(" ", ""));
                            }

                            StaticFramework.Save(nameValueCollection, nameValueCollectionKey, "SCALLUSER", this.conn);

                            var page = HttpContext.Current.CurrentHandler as Page;
                            ScriptManager.RegisterStartupScript(page, page.GetType(), "alert", "alert('Save Data Success');", true);


                            NameValueCollection nameValueCollectionKeyflag = new NameValueCollection();
                            NameValueCollection nameValueCollectionflag    = new NameValueCollection();
                            StaticFramework.SaveNvc(nameValueCollectionKeyflag, "USERID", NIK);
                            StaticFramework.SaveNvc(nameValueCollectionflag, "SU_LOGON", "0");
                            StaticFramework.SaveNvc(nameValueCollectionflag, "SU_REVOKE", "0");
                            StaticFramework.SaveNvc(nameValueCollectionflag, "SU_FALSEPWDCOUNT", "0");

                            StaticFramework.Save(nameValueCollectionflag, nameValueCollectionKeyflag, "scalluserflag", this.conn);
                            clear();
                        }
                    }
                    else
                    {
                        hash_password = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile("bankmantap1", "sha1");

                        NameValueCollection nameValueCollectionKey = new NameValueCollection();
                        NameValueCollection nameValueCollection    = new NameValueCollection();
                        StaticFramework.SaveNvc(nameValueCollectionKey, "USERID", NIK);
                        StaticFramework.SaveNvc(nameValueCollection, "GROUPID", GROUP);
                        StaticFramework.SaveNvc(nameValueCollection, "SU_FULLNAME", FULLNAME);
                        StaticFramework.SaveNvc(nameValueCollection, "SU_EMAIL", email);
                        StaticFramework.SaveNvc(nameValueCollection, "SU_EMAIL_2", email2);
                        StaticFramework.SaveNvc(nameValueCollection, "SU_REGISTERBY", Session["UserID"].ToString());
                        StaticFramework.SaveNvc(nameValueCollection, "SU_HPNUM", NOUSER.Value.Replace("-", "").Replace(" ", ""));
                        StaticFramework.SaveNvc(nameValueCollection, "SU_PWD", hash_password);
                        StaticFramework.SaveNvc(nameValueCollection, "SU_REGISTERDATE", DateTime.Now);
                        StaticFramework.SaveNvc(nameValueCollection, "SU_PWDEXPDATE", DateTime.Now.AddDays(PWDEXPDAY));
                        StaticFramework.SaveNvc(nameValueCollection, "SU_ACTIVE", "1");
                        StaticFramework.SaveNvc(nameValueCollection, "UNIT", UNIT);

                        if (GROUP.SelectedValue.Equals("003HEAD"))
                        {
                            //StaticFramework.SaveNvc(nameValueCollection, "SU_EMAIL_KADIV", emailDivisi);
                            //StaticFramework.SaveNvc(nameValueCollection, "SU_EMAIL_DEPHEAD", emailDevHead);
                            StaticFramework.SaveNvc(nameValueCollection, "SU_UPLINER", SU_UPLINER);
                            //StaticFramework.SaveNvc(nameValueCollection, "SU_HPNUM_DEPHEAD", NODEVHEAD.Value.Replace("-", "").Replace(" ", ""));
                            //StaticFramework.SaveNvc(nameValueCollection, "SU_HPNUM_KADIV", NOKADIV.Value.Replace("-", ""));
                        }
                        else if (GROUP.SelectedValue.Equals("002PEN"))
                        {
                            StaticFramework.SaveNvc(nameValueCollection, "USER_DELEGATE", PIC2);
                            StaticFramework.SaveNvc(nameValueCollection, "SU_UPLINER", SU_UPLINER);
                        }
                        else if (GROUP.SelectedValue.Equals("004KADIV"))
                        {
                            StaticFramework.SaveNvc(nameValueCollection, "SU_EMAIL_DIREKTUR", emailDirektur);
                            StaticFramework.SaveNvc(nameValueCollection, "SU_HPNUM_DIREKTUR", NODIREKTUR.Value.Replace("-", "").Replace(" ", ""));
                        }

                        StaticFramework.Save(nameValueCollection, nameValueCollectionKey, "SCALLUSER", this.conn);

                        var page = HttpContext.Current.CurrentHandler as Page;
                        ScriptManager.RegisterStartupScript(page, page.GetType(), "alert", "alert('Save Data Success');", true);

                        NameValueCollection nameValueCollectionKeyflag = new NameValueCollection();
                        NameValueCollection nameValueCollectionflag    = new NameValueCollection();
                        StaticFramework.SaveNvc(nameValueCollectionKeyflag, "USERID", NIK);
                        StaticFramework.SaveNvc(nameValueCollectionflag, "SU_LOGON", "0");
                        StaticFramework.SaveNvc(nameValueCollectionflag, "SU_REVOKE", "0");
                        StaticFramework.SaveNvc(nameValueCollectionflag, "SU_FALSEPWDCOUNT", "0");

                        StaticFramework.Save(nameValueCollectionflag, nameValueCollectionKeyflag, "scalluserflag", this.conn);

                        clear();
                    }
                }
            }
            catch (Exception e)
            {
                var page = HttpContext.Current.CurrentHandler as Page;
                ScriptManager.RegisterStartupScript(page, page.GetType(), "alert", "alert('error save');", true);
            }
        }
Пример #26
0
        protected void RetrieveData()
        {
            //String AP_REGNO = EncryptAndDecrypt.Decrypt(base.Request.QueryString["IN"].ToString()).ToString();
            // String UNIT = EncryptAndDecrypt.Decrypt(base.Request.QueryString["UN"].ToString()).ToString();
            // String JENIS = EncryptAndDecrypt.Decrypt(base.Request.QueryString["JN"].ToString()).ToString();
            String UNIT  = base.Request.QueryString["UN"].ToString().ToString();
            String JENIS = base.Request.QueryString["JN"].ToString().ToString();

            object[] param = new object[]
            {
                IdGenerate
            };
            //System.Data.DataTable dataTable = this.conn.GetDataTable("SELECT INSTANSIID,JENIS, DATETIMELIMIT,KETERANGAN,Sanksi, UNIT,convert(varchar,DATECREATED,126) as DATECREATED,USERCREATED,STATUS FROM DATA_COMPLIANCE where INSTANSIID =@1 and UNIT=@2 and JENIS =@3", param, this.dbtimeout, true, true);
            System.Data.DataTable dataTable = conn.GetDataTable("SELECT UNIT,JENIS, DATETIMELIMIT,KETERANGAN,Sanksi,Sanksi_ket, convert(varchar,DATECREATED,126) as DATECREATED,DEPTHEAD,PIC,PERIODE,USERCREATED,STATUS,JENISREPORT FROM VW_DATAALERT where AP_REGNO = @1 ", param, this.dbtimeout, true, true);
            if (dataTable.Rows.Count > 0)
            {
                StaticFramework.Retrieve(dataTable, this.UNIT);
                StaticFramework.Retrieve(dataTable, this.KETERANGAN);
                StaticFramework.Reff(this.JENIS, "SELECT REPORTID , REPORTNAME FROM VW_JENISREPORT WHERE UNITID ='" + UNIT + "'AND INSTANSIID in (SELECT SPLITDATA FROM [dbo].[fnSplitString]('" + instansi + "',','))", null, this.conn, false);
                //StaticFramework.Reff(this.PIC, "SELECT [USERID] , [SU_FULLNAME] FROM  [MRSDATA].[dbo].[VW_USER] WHERE UNIT ='" + UNIT + "' and [GROUPID] ='002PEN'", null, this.conn, false);
                StaticFramework.Reff(this.DEPTHEAD, "SELECT [USERID] , [SU_FULLNAME] FROM  [MRSDATA].[dbo].[VW_HEAD] WHERE UNIT ='" + UNIT + "'", null, this.conn, false);

                System.Data.DataTable dt = conn.GetDataTable("SELECT * FROM VW_GETINSTANSI where AP_REGNO = @1 ", param, this.dbtimeout, true, true);
                if (dt.Rows.Count > 0)
                {
                    for (int a = 0; a < dt.Rows.Count; a++)
                    {
                        for (int i = 0; i < INSTANSIID.Items.Count; i++)
                        {
                            if (dt.Rows[a]["INSTANSIID"].ToString() == INSTANSIID.Items[i].Value.ToString())
                            {
                                INSTANSIID.Items[i].Selected = true;
                            }
                        }
                    }
                }


                StaticFramework.Retrieve(dataTable, DEPTHEAD);

                StaticFramework.Reff(this.PIC, "SELECT [USERID] , [SU_FULLNAME] FROM  [MRSDATA].[dbo].[VW_USER] WHERE UNIT ='" + UNIT + "' and SU_UPLINER='" + DEPTHEAD.SelectedValue.ToString() + "'  and [GROUPID] ='002PEN'", null, this.conn, false);

                StaticFramework.Retrieve(dataTable, PIC);
                StaticFramework.Retrieve(dataTable, PERIODE);

                System.Data.DataTable dt_PERIODE = conn.GetDataTable("SELECT * FROM VW_RFPERIODE where PERIODEID= '" + PERIODE.SelectedValue.ToString() + "' ", null, this.dbtimeout, true, true);
                if (dt_PERIODE.Rows.Count > 0)
                {
                    s_periode = dt_PERIODE.Rows[0]["FLAG"].ToString();
                    if (dt_PERIODE.Rows[0]["FLAG"].ToString().Equals("1"))
                    {
                        div_ListPelaporan.Style.Add("display", "");
                        div_BulanPelaporan.Style.Add("display", "");
                        div_tanggalPelaporan.Style.Add("display", "NONE");
                        StaticFramework.Reff(this.TANGGAL_PERIODE, Q_TANGGAL, null, this.conn, false);
                        StaticFramework.Reff(this.BULAN_PERIODE, Q_BULAN, null, this.conn, false);
                        Bind_DataList();
                    }
                    else
                    if (dt_PERIODE.Rows[0]["FLAG"].ToString().Equals("2"))
                    {
                        div_BulanPelaporan.Style.Add("display", "NONE");
                        div_ListPelaporan.Style.Add("display", "NONE");
                        div_tanggalPelaporan.Style.Add("display", "NONE");
                    }
                    else
                    {
                        div_BulanPelaporan.Style.Add("display", "NONE");
                        div_ListPelaporan.Style.Add("display", "NONE");
                        div_tanggalPelaporan.Style.Add("display", "");
                        StaticFramework.Reff(this.DATETIMELIMIT, Q_TANGGAL, null, this.conn, false);
                        StaticFramework.Retrieve(dataTable, DATETIMELIMIT);
                    }
                }

                StaticFramework.Retrieve(dataTable, JENISREPORT);
                StaticFramework.Reff(this.JENIS, "SELECT REPORTID , REPORTNAME FROM VW_JENISREPORT WHERE UNITID ='" + UNIT + "' ", null, this.conn, false);

                StaticFramework.Retrieve(dataTable, this.JENIS);
                //StaticFramework.Retrieve(dataTable, this.Sanksi);
                Sanksi.Value = String.Format(CultureInfo.InvariantCulture, "{0:0,0}", Convert.ToDecimal(dataTable.Rows[0]["Sanksi"].ToString().Replace(",00", "").Replace(",", "")));
                //Sanksi.Value = string.Format("{0:###,###}", Convert.ToDecimal(dataTable.Rows[0]["Sanksi"].ToString().Replace(",00", "")));

                //Sanksi.Value=String.Format(((Math.Round(Convert.ToDouble(dataTable.Rows[0]["Sanksi"].ToString().Replace(",00", ""))) == Convert.ToDouble(dataTable.Rows[0]["Sanksi"].ToString().Replace(",00", ""))) ? "{0:0}" : "{0:###,00}"), Convert.ToDouble(dataTable.Rows[0]["Sanksi"].ToString().Replace(",00", ""))); ;
                StaticFramework.Retrieve(dataTable, Sanksi_ket);
            }
        }
        public void JENIS_SelectedIndexChanged(object sender, EventArgs e)
        {
            //StaticFramework.Reff(this.JENIS, "SELECT REPORTID , REPORTNAME FROM JENISREPORT WHERE UNITID ='" + Session["UnitID"].ToString() + "' AND INSTANSIID ='" + INSTANSIID.SelectedValue.ToString() + "'", null, this.conn, false);

            object[] param = new object[]
            {
                INSTANSIID.SelectedValue.ToString(),
                     L_UNIT,
                     JENIS.SelectedValue.ToString(),
                     PERIODE.SelectedValue.ToString()
            };
            var dataTable = this.conn.GetDataTable("SELECT * FROM VW_LIMIT where INSTANSIID =@1 and UNIT=@2 and JENIS=@3 AND PERIODE=@4", param, this.dbtimeout, true, true);

            if (dataTable.Rows.Count > 0)
            {
                //StaticFramework.Retrieve(dataTable, this.DATETIMELIMIT);
                if (!dataTable.Rows[0]["DATETIMELIMIT"].ToString().Equals(""))
                {
                    dtime = DateTime.ParseExact(dataTable.Rows[0]["DATETIMELIMIT"].ToString(), "yyyy-MM-d", CultureInfo.InvariantCulture);
                    DATETIMELIMIT.Value = dtime.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture);
                }

                StaticFramework.Retrieve(dataTable, this.SANKSI_KET);
                //StaticFramework.Retrieve(dataTable, this.Sanksi);
                //Sanksi.Value = string.Format("{0:#,00}", Convert.ToDecimal(dataTable.Rows[0]["Sanksi"].ToString().Replace(",00", "")));

                //Sanksi.Value = string.Format("{0:#,00}", Convert.ToDecimal(dataTable.Rows[0]["Sanksi"].ToString().Replace(",00", "").Replace(",", "")));
                if (!dataTable.Rows[0]["Sanksi"].ToString().Equals(""))
                {
                    Sanksi.Value = String.Format(CultureInfo.InvariantCulture, "{0:0,0}", Convert.ToDecimal(dataTable.Rows[0]["Sanksi"].ToString().Replace(",00", "").Replace(",", "")));
                }
            }
            else
            {
                DATETIMELIMIT.Value = "";
                SANKSI_KET.Value    = "";
                Sanksi.Value        = "";
            }

            //if (Session["GROUPID"].ToString().Equals("002PEN") || (Session["GROUPID"].ToString().Equals("003HEAD") && Request.QueryString["AP"].ToString().Equals("")))
            //{
            //    var dataTable1 = this.conn.GetDataTable("SELECT JENISREPORT FROM VW_NAMALAPORAN WHERE UNITID ='" + Session["UnitID"].ToString() + "' AND INSTANSIID ='" + INSTANSIID.SelectedValue.ToString() + "'  AND PERIODE ='" + PERIODE.SelectedValue.ToString() + "' and REPORTID='" + JENIS.SelectedValue.ToString() + "'", null, this.dbtimeout, true, true);
            //    if (dataTable1.Rows.Count > 0)
            //    {
            //        JENISREPORT.SelectedValue = dataTable1.Rows[0]["JENISREPORT"].ToString();
            //    }

            //}

            if (Session["GROUPID"].ToString().Equals("002PEN"))
            {
                var dataTable1 = this.conn.GetDataTable("SELECT JENISREPORT FROM VW_NAMALAPORAN WHERE UNITID ='" + Session["UnitID"].ToString() + "' AND INSTANSIID ='" + INSTANSIID.SelectedValue.ToString() + "'  AND PERIODE ='" + PERIODE.SelectedValue.ToString() + "' and PIC ='" + Session["Userid"].ToString() + "'", null, this.dbtimeout, true, true);
                if (dataTable1.Rows.Count > 0)
                {
                    JENISREPORT.SelectedValue = dataTable1.Rows[0]["JENISREPORT"].ToString();
                }
            }
            else if (Session["GROUPID"].ToString().Equals("003HEAD") && Request.QueryString["AP"].ToString().Equals(""))
            {
                var dataTable1 = this.conn.GetDataTable("SELECT JENISREPORT FROM VW_NAMALAPORAN WHERE UNITID ='" + Session["UnitID"].ToString() + "' AND INSTANSIID ='" + INSTANSIID.SelectedValue.ToString() + "'  AND PERIODE ='" + PERIODE.SelectedValue.ToString() + "' and DEPTHEAD ='" + Session["Userid"].ToString() + "'", null, this.dbtimeout, true, true);
                if (dataTable1.Rows.Count > 0)
                {
                    JENISREPORT.SelectedValue = dataTable1.Rows[0]["JENISREPORT"].ToString();
                }
            }

            else
            {
                var dataTable1 = this.conn.GetDataTable("SELECT distinct JENISREPORT FROM VW_NAMALAPORAN WHERE UNITID ='" + UNIT.SelectedValue.ToString() + "' AND INSTANSIID ='" + INSTANSIID.SelectedValue.ToString() + "' AND PERIODE ='" + PERIODE.SelectedValue.ToString() + "' and REPORTID='" + JENIS.SelectedValue.ToString() + "'", null, this.dbtimeout, true, true);
                if (dataTable1.Rows.Count > 0)
                {
                    JENISREPORT.SelectedValue = dataTable1.Rows[0]["JENISREPORT"].ToString();
                }
            }
        }
        protected void save_data()
        {
            try
            {
                String h_fileupload = "";
                if (UPLOADFILE.Value.Equals(""))
                {
                    h_fileupload = fileupload.Text.ToString();
                }
                else
                {
                    h_fileupload = UPLOADFILE.Value.ToString();
                }

                NameValueCollection nameValueCollectionKey = new NameValueCollection();
                NameValueCollection nameValueCollection    = new NameValueCollection();
                if (Session["GROUPID"].ToString().Equals("002PEN") || (Session["GROUPID"].ToString().Equals("003HEAD") && Request.QueryString["AP"].ToString().Equals("")))
                {
                    StaticFramework.SaveNvc(nameValueCollection, "UNIT", Session["UNITid"].ToString());
                }
                else
                {
                    StaticFramework.SaveNvc(nameValueCollection, UNIT);
                }
                StaticFramework.SaveNvc(nameValueCollectionKey, "AP_REGINPUT", IdGenerate);
                StaticFramework.SaveNvc(nameValueCollection, INSTANSIID);
                StaticFramework.SaveNvc(nameValueCollection, PERIODE);
                StaticFramework.SaveNvc(nameValueCollection, JENIS);
                StaticFramework.SaveNvc(nameValueCollection, JENISREPORT);
                if (!DATETIMELIMIT.Value.ToString().Equals(""))
                {
                    StaticFramework.SaveNvc(nameValueCollection, "DATETIMELIMIT", DateTime.Parse(DATETIMELIMIT.Value.ToString()));
                }
                StaticFramework.SaveNvc(nameValueCollection, NOSURAT);
                if (!TGLSURAT.Value.ToString().Equals(""))
                {
                    StaticFramework.SaveNvc(nameValueCollection, "TGLSURAT", DateTime.Parse(TGLSURAT.Value.ToString()));
                }
                StaticFramework.SaveNvc(nameValueCollection, PERIHAL);
                StaticFramework.SaveNvc(nameValueCollection, KETERANGAN);
                StaticFramework.SaveNvc(nameValueCollection, "Sanksi", Sanksi.Value.Replace(".", ""));
                StaticFramework.SaveNvc(nameValueCollection, SANKSI_KET);
                StaticFramework.SaveNvc(nameValueCollection, "UPLOADFILE", h_fileupload);

                if (!TGLINPUT.Value.ToString().Equals(""))
                {
                    StaticFramework.SaveNvc(nameValueCollection, "TGLINPUT", DateTime.Parse(TGLINPUT.Value.ToString()));
                }

                if (Session["GROUPID"].ToString().Equals("00") || (Session["GROUPID"].ToString().Equals("003HEAD") && Request.QueryString["AP"].ToString().Equals("")))
                {
                    StaticFramework.SaveNvc(nameValueCollection, "USERCREATED", s_user);
                }
                else
                {
                    StaticFramework.SaveNvc(nameValueCollection, "USERCREATED", Session["Userid"].ToString());
                }



                StaticFramework.SaveNvc(nameValueCollection, "STATUSAPPROVE", "0");
                StaticFramework.SaveNvc(nameValueCollection, "DATECREATED", DateTime.Now);
                StaticFramework.Save(nameValueCollection, nameValueCollectionKey, "APP_MRS", this.conn);



                if (!UPLOADFILE.Value.ToString().Equals(""))
                {
                    //string folderPath = Server.MapPath("~/Upload/" + UNIT.SelectedValue + "/" + INSTANSIID.SelectedValue + "/");

                    //string path = Server.MapPath("~/Upload/" + UNIT.SelectedValue + "/" + INSTANSIID.SelectedValue + "/" + fileupload.Text.ToString());


                    string folderPath = Server.MapPath("~/Upload/" + L_UNIT + "/" + INSTANSIID.SelectedValue + "/");

                    string path = Server.MapPath("~/Upload/" + L_UNIT + "/" + INSTANSIID.SelectedValue + "/" + fileupload.Text.ToString());
                    if (File.Exists(path))
                    {
                        File.Delete(path);
                    }

                    if (!Directory.Exists(folderPath))
                    {
                        Directory.CreateDirectory(folderPath);
                    }

                    UPLOADFILE.PostedFile.SaveAs(folderPath + UPLOADFILE.Value.ToString());
                }

                //FileStream fStream = File.OpenRead(ConfigurationSettings.AppSettings["PATHUPLOAD"].ToString() + L_UNIT + "\\"+ INSTANSIID.SelectedValue +"\\"+ UPLOADFILE.Value.ToString()+"");
                //byte[] contents = new byte[fStream.Length];
                //fStream.Read(contents, 0, (int)fStream.Length);
                //fStream.Close();


                //if (fileUpload1.HasFile) {
                //    FileInfo fi = new FileInfo(fileUpload1.FileName);
                //    String name = fi.Name;
                //    byte[] documentContent = fileUpload1.FileBytes;
                //    StaticFramework.SaveNvc(nameValueCollection, "FILE_UPLOAD", documentContent);
                //}

                StaticFramework.Save(nameValueCollection, nameValueCollectionKey, "APP_MRS", this.conn);

                if (!Request.QueryString["NS"].ToString().Equals("") && Session["GROUPID"].ToString().Equals("002PEN"))
                {
                    var page = HttpContext.Current.CurrentHandler as Page;
                    ScriptManager.RegisterStartupScript(page, page.GetType(), "alert", "alert('Update Success');window.location ='ReportMRS.aspx';", true);
                }
                else if ((!Request.QueryString["NS"].ToString().Equals("") && Session["GROUPID"].ToString().Equals("00")) || (Session["GROUPID"].ToString().Equals("003HEAD") && Request.QueryString["AP"].ToString().Equals("")))
                {
                    var page = HttpContext.Current.CurrentHandler as Page;
                    ScriptManager.RegisterStartupScript(page, page.GetType(), "alert", "alert('Update Success');window.location ='Report_Approval.aspx';", true);
                }
                else
                {
                    var page = HttpContext.Current.CurrentHandler as Page;
                    ScriptManager.RegisterStartupScript(page, page.GetType(), "alert", "alert('Save Success');", true);
                    IdGenerate = generateID();
                }


                cleardata();
            }
            catch (Exception e)
            {
                var page = HttpContext.Current.CurrentHandler as Page;
                ScriptManager.RegisterStartupScript(page, page.GetType(), "alert", "alert('Gagal Save');", true);
                return;
            }
        }
Пример #29
0
        private void Retreivedata()
        {
            try
            {
                System.Data.DataTable dt = null;



                if (Session["GROUPID"].ToString().Equals("002PEN"))
                {
                    Q_RFINSTANSI      = "SELECT * FROM VW_DASBOARD_COUNT_USER where USERCREATED ='" + Session["userid"].ToString() + "'";
                    Q_RFINSTANSICOUNT = "SELECT * FROM [VW_DASBOARD_COUNT_USER1] where USERCREATED ='" + Session["userid"].ToString() + "'";

                    dt = this.conn.GetDataTable("SELECT distinct [INSTANSIID],[PIC],[UNIT] FROM [MRSDATA].[dbo].[DATA_COMPLIANCE] where PIC='" + Session["Userid"].ToString() + "'", null, this.dbtimeout, true, true);

                    if (dt.Rows.Count > 0)
                    {
                        for (int a = 0; a < dt.Rows.Count; a++)
                        {
                            if (dt.Rows[a]["INSTANSIID"].ToString().Equals("IN001"))
                            {
                                IN001.Visible = true;
                            }
                            if (dt.Rows[a]["INSTANSIID"].ToString().Equals("IN002"))
                            {
                                IN002.Visible = true;
                            }
                            if (dt.Rows[a]["INSTANSIID"].ToString().Equals("IN003"))
                            {
                                IN003.Visible = true;
                            }
                            if (dt.Rows[a]["INSTANSIID"].ToString().Equals("IN004"))
                            {
                                IN004.Visible = true;
                            }
                            if (dt.Rows[a]["INSTANSIID"].ToString().Equals("IN005"))
                            {
                                IN005.Visible = true;
                            }
                            if (dt.Rows[a]["INSTANSIID"].ToString().Equals("IN006"))
                            {
                                IN006.Visible = true;
                            }
                            if (dt.Rows[a]["INSTANSIID"].ToString().Equals("IN007"))
                            {
                                IN007.Visible = true;
                            }
                        }
                    }
                }
                else if (Session["GROUPID"].ToString().Equals("003HEAD"))
                {
                    Q_RFINSTANSI = "SELECT * FROM VW_DASBOARD_COUNT_UNIT where UNIT ='" + Session["UnitID"].ToString() + "' and (DEPTHEAD='" + Session["Userid"].ToString() + "') ";

                    Q_RFINSTANSICOUNT = "SELECT * FROM VW_DASBOARD_COUNT_UNIT1 where UNIT ='" + Session["UnitID"].ToString() + "' and (DEPTHEAD='" + Session["Userid"].ToString() + "') ";

                    dt = this.conn.GetDataTable("SELECT distinct [INSTANSIID],[DEPTHEAD],[UNIT] FROM [MRSDATA].[dbo].[DATA_COMPLIANCE] where DEPTHEAD='" + Session["Userid"].ToString() + "'", null, this.dbtimeout, true, true);

                    if (dt.Rows.Count > 0)
                    {
                        for (int a = 0; a < dt.Rows.Count; a++)
                        {
                            if (dt.Rows[a]["INSTANSIID"].ToString().Equals("IN001"))
                            {
                                IN001.Visible = true;
                            }
                            if (dt.Rows[a]["INSTANSIID"].ToString().Equals("IN002"))
                            {
                                IN002.Visible = true;
                            }
                            if (dt.Rows[a]["INSTANSIID"].ToString().Equals("IN003"))
                            {
                                IN003.Visible = true;
                            }
                            if (dt.Rows[a]["INSTANSIID"].ToString().Equals("IN004"))
                            {
                                IN004.Visible = true;
                            }
                            if (dt.Rows[a]["INSTANSIID"].ToString().Equals("IN005"))
                            {
                                IN005.Visible = true;
                            }
                            if (dt.Rows[a]["INSTANSIID"].ToString().Equals("IN006"))
                            {
                                IN006.Visible = true;
                            }
                            if (dt.Rows[a]["INSTANSIID"].ToString().Equals("IN007"))
                            {
                                IN007.Visible = true;
                            }
                        }
                    }
                }
                else if (Session["GROUPID"].ToString().Equals("004KADIV"))
                {
                    Q_RFINSTANSI      = "SELECT * FROM [VW_DASBOARD_COUNT_KADIV] where UNIT ='" + Session["UnitID"].ToString() + "' and (USERID='" + Session["Userid"].ToString() + "') ";
                    Q_RFINSTANSICOUNT = "SELECT * FROM VW_DASBOARD_COUNT_UNIT1 where UNIT ='" + Session["UnitID"].ToString() + "' and (DEPTHEAD in (select USERID from SCALLUSER where SU_UPLINER='" + Session["Userid"].ToString() + "')) ";

                    dt = this.conn.GetDataTable("SELECT distinct [INSTANSIID],[DEPTHEAD],[UNIT] FROM [MRSDATA].[dbo].[DATA_COMPLIANCE] where DEPTHEAD IN (select USERID from SCALLUSER where SU_UPLINER ='" + Session["Userid"].ToString() + "' and UNIT='" + Session["uNITiD"].ToString() + "') and UNIT='" + Session["uNITiD"].ToString() + "'", null, this.dbtimeout, true, true);

                    if (dt.Rows.Count > 0)
                    {
                        for (int a = 0; a < dt.Rows.Count; a++)
                        {
                            if (dt.Rows[a]["INSTANSIID"].ToString().Equals("IN001"))
                            {
                                IN001.Visible = true;
                            }
                            if (dt.Rows[a]["INSTANSIID"].ToString().Equals("IN002"))
                            {
                                IN002.Visible = true;
                            }
                            if (dt.Rows[a]["INSTANSIID"].ToString().Equals("IN003"))
                            {
                                IN003.Visible = true;
                            }
                            if (dt.Rows[a]["INSTANSIID"].ToString().Equals("IN004"))
                            {
                                IN004.Visible = true;
                            }
                            if (dt.Rows[a]["INSTANSIID"].ToString().Equals("IN005"))
                            {
                                IN005.Visible = true;
                            }
                            if (dt.Rows[a]["INSTANSIID"].ToString().Equals("IN006"))
                            {
                                IN006.Visible = true;
                            }
                            if (dt.Rows[a]["INSTANSIID"].ToString().Equals("IN007"))
                            {
                                IN007.Visible = true;
                            }
                        }
                    }
                }
                else
                {
                    Q_RFINSTANSI  = "SELECT * FROM VW_DASBOARD_COUNT";
                    IN001.Visible = true;
                    IN002.Visible = true;
                    IN003.Visible = true;
                    IN004.Visible = true;
                    IN005.Visible = true;
                    IN006.Visible = true;
                    IN007.Visible = true;
                }


                System.Data.DataTable dataTable = this.conn.GetDataTable(Q_RFINSTANSI, null, this.dbtimeout, true, true);

                if (dataTable.Rows.Count > 0)
                {
                    StaticFramework.Retrieve(dataTable, this.count_BI);
                    StaticFramework.Retrieve(dataTable, this.count_OJK);
                    StaticFramework.Retrieve(dataTable, this.count_OJK_PASARMODAL);
                    StaticFramework.Retrieve(dataTable, this.count_PAJAK);
                    StaticFramework.Retrieve(dataTable, this.count_PPATK);
                    StaticFramework.Retrieve(dataTable, this.count_REGULATOR_LAIN);
                    StaticFramework.Retrieve(dataTable, this.count_MANDIRI);

                    StaticFramework.Retrieve(dataTable, this.BI_7);
                    StaticFramework.Retrieve(dataTable, this.BI_3);
                    StaticFramework.Retrieve(dataTable, this.BI_1);
                    StaticFramework.Retrieve(dataTable, this.OJK_7);
                    StaticFramework.Retrieve(dataTable, this.OJK_3);
                    StaticFramework.Retrieve(dataTable, this.OJK_1);
                    StaticFramework.Retrieve(dataTable, this.OJKPASARMODAL_7);
                    StaticFramework.Retrieve(dataTable, this.OJKPASARMODAL_3);
                    StaticFramework.Retrieve(dataTable, this.OJKPASARMODAL_1);
                    StaticFramework.Retrieve(dataTable, this.PAJAK_7);
                    StaticFramework.Retrieve(dataTable, this.PAJAK_3);
                    StaticFramework.Retrieve(dataTable, this.PAJAK_1);
                    StaticFramework.Retrieve(dataTable, this.PPATK_7);
                    StaticFramework.Retrieve(dataTable, this.PPATK_3);
                    StaticFramework.Retrieve(dataTable, this.PPATK_1);
                    StaticFramework.Retrieve(dataTable, this.MANDIRI_7);
                    StaticFramework.Retrieve(dataTable, this.MANDIRI_3);
                    StaticFramework.Retrieve(dataTable, this.MANDIRI_1);
                    StaticFramework.Retrieve(dataTable, this.REGULATOR_7);
                    StaticFramework.Retrieve(dataTable, this.REGULATOR_3);
                    StaticFramework.Retrieve(dataTable, this.REGULATOR_1);
                }
                else
                {
                    count_BI.Text             = "0";
                    count_OJK.Text            = "0";
                    count_OJK_PASARMODAL.Text = "0";
                    count_PAJAK.Text          = "0";
                    count_PPATK.Text          = "0";
                    count_REGULATOR_LAIN.Text = "0";
                    count_MANDIRI.Text        = "0";

                    BI_7.Text            = "0";
                    BI_3.Text            = "0";
                    BI_1.Text            = "0";
                    OJK_7.Text           = "0";
                    OJK_3.Text           = "0";
                    OJK_1.Text           = "0";
                    OJKPASARMODAL_7.Text = "0";
                    OJKPASARMODAL_3.Text = "0";
                    OJKPASARMODAL_1.Text = "0";
                    PAJAK_7.Text         = "0";
                    PAJAK_3.Text         = "0";
                    PAJAK_1.Text         = "0";
                    PPATK_7.Text         = "0";
                    PPATK_3.Text         = "0";
                    PPATK_1.Text         = "0";
                    MANDIRI_7.Text       = "0";
                    MANDIRI_3.Text       = "0";
                    MANDIRI_1.Text       = "0";
                    REGULATOR_7.Text     = "0";
                    REGULATOR_3.Text     = "0";
                    REGULATOR_1.Text     = "0";
                }

                if (!Q_RFINSTANSICOUNT.Equals("") && dataTable.Rows.Count <= 0)
                {
                    System.Data.DataTable dataTable1 = this.conn.GetDataTable(Q_RFINSTANSICOUNT, null, this.dbtimeout, true, true);

                    if (dataTable1.Rows.Count > 0)
                    {
                        StaticFramework.Retrieve(dataTable1, this.BI_7);
                        StaticFramework.Retrieve(dataTable1, this.BI_3);
                        StaticFramework.Retrieve(dataTable1, this.BI_1);
                        StaticFramework.Retrieve(dataTable1, this.OJK_7);
                        StaticFramework.Retrieve(dataTable1, this.OJK_3);
                        StaticFramework.Retrieve(dataTable1, this.OJK_1);
                        StaticFramework.Retrieve(dataTable1, this.OJKPASARMODAL_7);
                        StaticFramework.Retrieve(dataTable1, this.OJKPASARMODAL_3);
                        StaticFramework.Retrieve(dataTable1, this.OJKPASARMODAL_1);
                        StaticFramework.Retrieve(dataTable1, this.PAJAK_7);
                        StaticFramework.Retrieve(dataTable1, this.PAJAK_3);
                        StaticFramework.Retrieve(dataTable1, this.PAJAK_1);
                        StaticFramework.Retrieve(dataTable1, this.PPATK_7);
                        StaticFramework.Retrieve(dataTable1, this.PPATK_3);
                        StaticFramework.Retrieve(dataTable1, this.PPATK_1);
                        StaticFramework.Retrieve(dataTable1, this.MANDIRI_7);
                        StaticFramework.Retrieve(dataTable1, this.MANDIRI_3);
                        StaticFramework.Retrieve(dataTable1, this.MANDIRI_1);
                        StaticFramework.Retrieve(dataTable1, this.REGULATOR_7);
                        StaticFramework.Retrieve(dataTable1, this.REGULATOR_3);
                        StaticFramework.Retrieve(dataTable1, this.REGULATOR_1);
                    }
                    else
                    {
                        BI_7.Text            = "0";
                        BI_3.Text            = "0";
                        BI_1.Text            = "0";
                        OJK_7.Text           = "0";
                        OJK_3.Text           = "0";
                        OJK_1.Text           = "0";
                        OJKPASARMODAL_7.Text = "0";
                        OJKPASARMODAL_3.Text = "0";
                        OJKPASARMODAL_1.Text = "0";
                        PAJAK_7.Text         = "0";
                        PAJAK_3.Text         = "0";
                        PAJAK_1.Text         = "0";
                        PPATK_7.Text         = "0";
                        PPATK_3.Text         = "0";
                        PPATK_1.Text         = "0";
                        MANDIRI_7.Text       = "0";
                        MANDIRI_3.Text       = "0";
                        MANDIRI_1.Text       = "0";
                        REGULATOR_7.Text     = "0";
                        REGULATOR_3.Text     = "0";
                        REGULATOR_1.Text     = "0";
                    }
                }
            }
            catch (Exception e)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('error : get data')", true);
            }
        }