protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["LANG"] == null)
     {
         Session["LANG"] = "EN";
     }
     if (!IsPostBack)
     {
         load_info();
     }
     if (AuthCookieParse.UserStatus() == "0")
     {
         Loginlbl.Text = AuthCookieParse.UserFIO();
     }
     else if (AuthCookieParse.UserStatus() == "1")
     {
         Loginlbl.Text = AuthCookieParse.UserFIO() + " (Operator)";
     }
     else if (AuthCookieParse.UserStatus() == "2")
     {
         Loginlbl.Text = AuthCookieParse.UserFIO() + " (Admin)";
     }
     else if (AuthCookieParse.UserStatus() == "3")
     {
         Loginlbl.Text = AuthCookieParse.UserFIO() + " (SuperAdmin)";
     }
     Loginlbl.Text = " " + Loginlbl.Text;
 }
Exemple #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (AuthCookieParse.UserStatus() != ConfigurationManager.AppSettings["SuperAdmin"])
        {
            Response.Redirect("Default.aspx");
            return;
        }


        Amount_txt.Text = "0";

        if (!IsPostBack)
        {
            //----- Load elements----------------
            username_sql.ConnectionString = ConfigurationManager.ConnectionStrings["DBPath"].ConnectionString;
            username_sql.SelectCommand    = @"SELECT ID,(FNAME+' '+LNAME) NAME FROM VENDOR_USERS WHERE ACTIVE=1";

            Package_type_sql.ConnectionString = ConfigurationManager.ConnectionStrings["DBPath"].ConnectionString;
            Package_type_sql.SelectCommand    = @"SELECT ID,NAME FROM PACKAGE_TYPE";

            payment_type_sql.ConnectionString = ConfigurationManager.ConnectionStrings["DBPath"].ConnectionString;
            payment_type_sql.SelectCommand    = @"SELECT ID,NAME FROM PAYMENT_TYPE";

            Chart_fill();
            //----------------------------------
        }
    }
Exemple #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (AuthCookieParse.UserStatus() == ConfigurationManager.AppSettings["Vendor_user"])
        {
            Response.Redirect("Default.aspx");
            return;
        }

        category_sql.ConnectionString = ConfigurationManager.ConnectionStrings["DBPath"].ConnectionString;

        category_sql.SelectCommand = @"SELECT ID,AZ_NAME,EN_NAME,RU_NAME FROM CATEGORY";
    }
 protected void SignOut_btn_Click(object sender, EventArgs e)
 {
     if (AuthCookieParse.UserStatus() == "1")
     {
         Response.Redirect("defaultadmin.aspx");
     }
     else
     {
         Response.Redirect("default.aspx");
     }
     Response.Redirect("default.aspx");
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (AuthCookieParse.UserStatus() == ConfigurationManager.AppSettings["Vendor_user"])
        {
            Response.Redirect("Default.aspx");
            return;
        }

        users_sql.ConnectionString = ConfigurationManager.ConnectionStrings["DBPath"].ConnectionString;

        users_sql.SelectCommand = @"SELECT ID,(FNAME+' '+LNAME) FIO,PHONENUMBER,EMAIL FROM VENDOR_USERS";
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (AuthCookieParse.UserStatus() == "1")
     {
         users_lb.Visible  = true;
         report_lb.Visible = true;
     }
     else
     {
         users_lb.Visible  = false;
         report_lb.Visible = false;
     }
 }
Exemple #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (AuthCookieParse.UserStatus() != ConfigurationManager.AppSettings["SuperAdmin"])
        {
            Response.Redirect("Default.aspx");
            return;
        }

        category_sql.ConnectionString = ConfigurationManager.ConnectionStrings["DBPath"].ConnectionString;
        category_sql.SelectCommand    = @"SELECT CC.ID,PT.NAME TYPE,P.NAME PACKAGE,CC.CODE FROM CARD_CODES CC,PACKAGE_TYPE PT,PACKAGE P
        WHERE CC.PACKAGE_TYPE=PT.ID AND CC.PACKAGE_ID=P.ID AND CC.ACTIVE=1";

        Package_type_sql.ConnectionString = ConfigurationManager.ConnectionStrings["DBPath"].ConnectionString;
        Package_type_sql.SelectCommand    = @"SELECT ID,NAME FROM PACKAGE_TYPE";
    }
 void info()
 {
     if (AuthCookieParse.UserStatus() == "2")
     {
         status_ddl.SelectedIndex = 1;
         status_ddl.Enabled       = false;
     }
     else if (AuthCookieParse.UserStatus() == "3")
     {
         status_ddl.Enabled = true;
     }
     else
     {
         Response.Redirect("Default.aspx");
     }
 }
Exemple #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (AuthCookieParse.UserStatus() == ConfigurationManager.AppSettings["Vendor_user"])
        {
            Response.Redirect("Default.aspx");
            return;
        }
        orderlist_sql.ConnectionString = ConfigurationManager.ConnectionStrings["DBPath"].ConnectionString;
        orderlist_sql.SelectCommand    = @"	SELECT O.ID,CONVERT(NVARCHAR,TIME_TO_CONNECT,104) 'DATE',TEAMVIEWER_CODE 'TEAMVIEWER_CODE',TEAMVIEWER_LOGIN,(VU.FNAME+' '+VU.LNAME ) 'USER_FIO' FROM ORDERS O 
                                        LEFT JOIN VENDOR_USERS VU ON O.CREATE_BY=VU.ID     
                                        
                                        WHERE O.STATUS_TYPE=1 
                                        ORDER BY O.ID DESC";

        order_type_sql.ConnectionString = ConfigurationManager.ConnectionStrings["DBPath"].ConnectionString;
        order_type_sql.SelectCommand    = @"SELECT ID,NAME FROM ORDER_TYPE";
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (AuthCookieParse.UserStatus() == ConfigurationManager.AppSettings["Vendor_user"] || AuthCookieParse.UserStatus() == ConfigurationManager.AppSettings["Operator"])
        {
            Response.Redirect("Default.aspx");
            return;
        }


        packages_sql.ConnectionString = ConfigurationManager.ConnectionStrings["DBPath"].ConnectionString;

        packages_sql.SelectCommand = @"SELECT P.ID,P.NAME,(CONVERT(nvarchar,P.PRICE) + ' ' + V.NAME) as PRICE,POINT FROM PACKAGE as P
                                                                        LEFT JOIN VALYUTA AS V ON P.VALYUTA_ID=V.ID";

        valyuta_sql.ConnectionString = ConfigurationManager.ConnectionStrings["DBPath"].ConnectionString;

        valyuta_sql.SelectCommand = @"SELECT ID,NAME FROM VALYUTA";
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (AuthCookieParse.UserStatus() == ConfigurationManager.AppSettings["Vendor_user"])
        {
            Response.Redirect("Default.aspx");
            return;
        }
        subcategory_sql.ConnectionString = ConfigurationManager.ConnectionStrings["DBPath"].ConnectionString;
        subcategory_sql.SelectCommand    = @"SELECT SUB_CATEGORY.ID,SUB_CATEGORY.EN_NAME,SUB_CATEGORY.AZ_NAME,SUB_CATEGORY.RU_NAME,CATEGORY.EN_NAME AS CATEGORY,(CONVERT(NVARCHAR,PRICE)+' ' +V.NAME) PRICE FROM SUB_CATEGORY
                                         LEFT JOIN CATEGORY ON SUB_CATEGORY.CATEGORY_ID=CATEGORY.ID
                                            LEFT JOIN VALYUTA V ON SUB_CATEGORY.VALYUTA_ID=V.ID";

        category_sql.ConnectionString = ConfigurationManager.ConnectionStrings["DBPath"].ConnectionString;
        category_sql.SelectCommand    = @"SELECT ID,EN_NAME AS 'NAME' FROM CATEGORY";

        SqlDataSource4.ConnectionString = ConfigurationManager.ConnectionStrings["DBPath"].ConnectionString;
        SqlDataSource4.SelectCommand    = @"SELECT ID,NAME FROM VALYUTA";
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (AuthCookieParse.UserStatus() != ConfigurationManager.AppSettings["SuperAdmin"])
        {
            Response.Redirect("Default.aspx");
            return;
        }

        if (!IsPostBack)
        {
            //----- Load elements----------------
            username_sql.ConnectionString = ConfigurationManager.ConnectionStrings["DBPath"].ConnectionString;
            username_sql.SelectCommand    = @"SELECT ID,(FNAME+' '+LNAME) NAME FROM VENDOR_USERS WHERE ACTIVE=1";

            operator_sql.ConnectionString = ConfigurationManager.ConnectionStrings["DBPath"].ConnectionString;
            operator_sql.SelectCommand    = @"SELECT ID,(FNAME+' '+LNAME) NAME  FROM USERS WHERE STATUS=1";

            order_type_sql.ConnectionString = ConfigurationManager.ConnectionStrings["DBPath"].ConnectionString;
            order_type_sql.SelectCommand    = @"SELECT ID,NAME FROM ORDER_TYPE";
            //----------------------------------
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (Session["qeydiyyat12_1"].ToString() != "ok")
            {
                Response.Redirect("Default.aspx");
            }
        }
        catch (Exception)
        {
            Response.Redirect("Default.aspx");
        }
        if (AuthCookieParse.UserStatus() == "1")
        {
            Session["adminsession"] = "okay";
        }

        if (!IsPostBack)
        {
            using (SqlConnection Conn = new SqlConnection())
            {
                Conn.ConnectionString = ConfigurationManager.ConnectionStrings["DBPath"].ConnectionString;

                SqlCommand Comm = new SqlCommand();
                Comm.Connection = Conn;

                Conn.Open();
                //------Gender--------
                Comm.CommandText = @" SELECT COUNT(ID) FROM CLIENTS WHERE GENDER=@G_ID";//if G_ID=1 then man and G_ID=2 then woman

                Comm.Parameters.Add("@G_ID", SqlDbType.Int);
                Comm.Parameters["@G_ID"].Value = 1;//MAN Count

                Man = Convert.ToInt32(Comm.ExecuteScalar());

                Comm.Parameters["@G_ID"].Value = 2;//WOMAN Count

                Woman = Convert.ToInt32(Comm.ExecuteScalar());

                string GenderTestItem = "['{0} ( {1} )', {1}],";

                Gender += string.Format(GenderTestItem, "Kishi", Man.ToString());

                Gender += string.Format(GenderTestItem, "Qadin", Woman.ToString());

                Gender = Gender.Remove(Gender.Length - 1, 1);
                //-----------------------------------------------

                //---------Source
                Comm.CommandText = @"SELECT COUNT(ID) FROM CLIENTS WHERE SOURCE_TYPE=@S_ID";//if S_ID=1 then Costumer and S_ID=2 then Business

                Comm.Parameters.Add("@S_ID", SqlDbType.Int);
                Comm.Parameters["@S_ID"].Value = 1;

                Costumer = Convert.ToInt32(Comm.ExecuteScalar());

                Comm.Parameters["@S_ID"].Value = 2;

                Business = Convert.ToInt32(Comm.ExecuteScalar());

                string SourceItem = "['{0} ( {1} )', {1}],";

                Source += string.Format(SourceItem, "Küçə", Costumer.ToString());

                Source += string.Format(SourceItem, "Biznes", Business.ToString());

                Source = Source.Remove(Source.Length - 1, 1);
                //-----------------------------------------------

                //----------------AGE interval-----------------

                Comm.CommandText = @" SELECT COUNT(ID) FROM CLIENTS WHERE AGE_INTERVAL=@AGE_id"; //if age_id=1 --> 10-18 & age_id=2--> 18-25 & age_id=3 25-40

                Comm.Parameters.Add("@AGE_ID", SqlDbType.Int);
                Comm.Parameters["@AGE_ID"].Value = 1;

                from10to18      = Convert.ToInt32(Comm.ExecuteScalar());
                from10to18Count = from10to18;

                Comm.Parameters["@AGE_ID"].Value = 2;

                from18to25      = Convert.ToInt32(Comm.ExecuteScalar());
                from18to25Count = from18to25;

                Comm.Parameters["@AGE_ID"].Value = 3;

                from25to40      = Convert.ToInt32(Comm.ExecuteScalar());
                from25to40Count = from25to40;
                //----------------------------------------------------------------------------------------------------

                //----------------------PACKAGES---------------------------------------

                Comm.CommandText = @"SELECT  PP.ID,PP.NAME AS 'NAME', 
                                                           PACKAGESCOUNT = (SELECT COUNT(TP.Id) FROM TRANZACTIONS_PACKAGES TP  WHERE TP.PACKAGES_ID = PP.Id)
                                                      FROM PRICE_PACKAGES PP ";
                SqlDataReader reader = Comm.ExecuteReader();

                string PackagesItem = "['{0} ( {1} )', {1}],";

                while (reader.Read())
                {
                    Packages += string.Format(PackagesItem, reader["NAME"].ToString(), reader["PACKAGESCOUNT"].ToString());
                }
                reader.Close();
                Packages = Packages.Remove(Packages.Length - 1, 1);

                //-----------------------------------------------

                //----------------------CATEGORY---------------------------------------

                Comm.CommandText = @"      SELECT  DC.ID,DC.NAME as 'NAME', 
                                      CATEGORYCOUNT = (SELECT COUNT(TC.Id) FROM  TRANZACTIONS_CATEGORY  TC WHERE TC.DAVICE_CATEGORY= DC.Id)
                                      FROM DEVICE_CATEGORY DC  ";
                reader           = Comm.ExecuteReader();

                string CategoryItem = "['{0} ( {1} )', {1}],";

                while (reader.Read())
                {
                    Category += string.Format(CategoryItem, reader["NAME"].ToString(), reader["CATEGORYCOUNT"].ToString());
                }
                Category = Category.Remove(Category.Length - 1, 1);
                reader.Close();

                //-----------------------------------------------

                //----------------------DEVICE---------------------------------------

                Comm.CommandText = @"   SELECT  D.ID,D.NAME, 
                                                  DEVICECOUNT = (SELECT COUNT(TD.DEVICE_ID) FROM  TRANZACTIONS_DEVICE  TD WHERE TD.DEVICE_ID=D.Id)
                                              FROM DEVICES D   ";
                reader           = Comm.ExecuteReader();

                string DeviceItem = "['{0} ( {1} )', {1}],";

                while (reader.Read())
                {
                    Device += string.Format(DeviceItem, reader["NAME"].ToString(), reader["DEVICECOUNT"].ToString());
                }
                Device = Device.Remove(Device.Length - 1, 1);
                reader.Close();

                //-----------------------------------------------

                //----------------------GAMES---------------------------------------

                Comm.CommandText = @"         SELECT  G.NAME as 'NAME', 
                                      GAMESCOUNT = (SELECT COUNT(TG.GAME_ID) FROM  TRANZACTIONS_GAME TG WHERE TG.GAME_ID= G.NAME)
                                      FROM GAMES G  ";
                reader           = Comm.ExecuteReader();

                string GameItem = "['{0} ( {1} )', {1}],";

                while (reader.Read())
                {
                    Games += string.Format(GameItem, reader["NAME"].ToString(), reader["GAMESCOUNT"].ToString());
                }
                Games = Games.Remove(Games.Length - 1, 1);

                //-----------------------------------------------
            }
        }
    }
    void load_info()
    {
        if (AuthCookieParse.UserID().ToString() == "-1")
        {
            Response.Redirect("default.aspx");
        }

        else if (AuthCookieParse.UserStatus() == "1")
        {
            category_li.Visible       = true;
            subcategory_li.Visible    = true;
            users_li.Visible          = false;
            vendorusers_li.Visible    = true;
            orderlist_li.Visible      = true;
            Problem_list.Visible      = true;
            card_generator.Visible    = false;
            Tranzactions_list.Visible = false;
            Report_list.Visible       = false;
            Doneorders_li.Visible     = true;
            createorder_li.Visible    = false;
            myorders_li.Visible       = false;
        }
        else
        if (AuthCookieParse.UserStatus() == "0")
        {
            category_li.Visible       = false;
            subcategory_li.Visible    = false;
            users_li.Visible          = false;
            card_generator.Visible    = false;
            Tranzactions_list.Visible = false;
            Report_list.Visible       = false;
            vendorusers_li.Visible    = false;
            orderlist_li.Visible      = false;
            Doneorders_li.Visible     = false;
            createorder_li.Visible    = true;
            myorders_li.Visible       = true;
            pricing_li.Visible        = true;
        }
        else if (AuthCookieParse.UserStatus() == "3")
        {
            category_li.Visible       = true;
            subcategory_li.Visible    = true;
            users_li.Visible          = true;
            vendorusers_li.Visible    = true;
            orderlist_li.Visible      = true;
            Problem_list.Visible      = true;
            card_generator.Visible    = true;
            Tranzactions_list.Visible = true;
            Report_list.Visible       = true;
            Doneorders_li.Visible     = true;
        }
        else if (AuthCookieParse.UserStatus() == "2")
        {
            category_li.Visible       = true;
            subcategory_li.Visible    = true;
            users_li.Visible          = true;
            vendorusers_li.Visible    = true;
            orderlist_li.Visible      = true;
            Problem_list.Visible      = true;
            card_generator.Visible    = false;
            Tranzactions_list.Visible = true;
            Report_list.Visible       = true;
            Doneorders_li.Visible     = true;
        }

        string point = "";

        string package = "";

        string info = "";

        string time = "";

        using (SqlConnection Conn = new SqlConnection())
        {
            Conn.ConnectionString = ConfigurationManager.ConnectionStrings["DBPath"].ConnectionString;

            SqlCommand Comm = new SqlCommand();

            Comm.Connection = Conn;

            Conn.Open();

            Comm.CommandText = @"
                                SELECT AP.POINT,PAY_DATE,P.NAME AS PACKAGE,PT.NAME AS TYPE,PACKAGE_ID FROM USER_PACKAGE AS AP
								LEFT JOIN PACKAGE AS P ON AP.PACKAGE_ID=P.ID
								LEFT JOIN PACKAGE_TYPE AS PT ON P.TYPE_ID=PT.ID WHERE AP.USER_ID=@ID AND USING_CHECK=1"                                ;

            Comm.Parameters.Add("@ID", SqlDbType.Int);
            Comm.Parameters["@ID"].Value = AuthCookieParse.UserID();

            SqlDataReader reader = Comm.ExecuteReader();

            if (reader.Read())
            {
                info = reader["TYPE"] + ": " + reader["PACKAGE"];

                point = reader["POINT"].ToString();

                package = reader["PACKAGE_ID"].ToString();

                time = reader["PAY_DATE"].ToString();
            }

            reader.Close();
        }

        package_info.InnerText = info;

        point_info.InnerText += point;

        if (package == "4" || package == "7")
        {
            time_info.InnerText += Convert.ToDateTime(time).AddHours(24).ToString();
        }
        else
        if (package == "5" || package == "8")
        {
            time_info.InnerText += Convert.ToDateTime(time).AddDays(7);
        }

        else
        if (package == "6" || package == "9")
        {
            time_info.InnerText += Convert.ToDateTime(time).AddMonths(1);
        }
    }