public List <ProfileMCT> Read_profile_MCT()
        {
            List <ProfileMCT> result = new List <ProfileMCT>();
            SQLiteDataReader  sqlite_datareader;
            SQLiteCommand     sqlite_cmd;

            sqlite_cmd             = sqlite_conn.CreateCommand();
            sqlite_cmd.CommandText = "SELECT * FROM profile_mct";
            sqlite_datareader      = sqlite_cmd.ExecuteReader();
            int index = 0;

            while (sqlite_datareader.Read())
            {
                ProfileMCT profile = new ProfileMCT();
                profile.email       = sqlite_datareader.GetString(0);
                profile.firstname   = sqlite_datareader.GetString(1);
                profile.lastname    = sqlite_datareader.GetString(2);
                profile.province    = sqlite_datareader.GetString(3);
                profile.city        = sqlite_datareader.GetString(4);
                profile.address1    = sqlite_datareader.GetString(5);
                profile.address2    = sqlite_datareader.GetString(6);
                profile.phone       = sqlite_datareader.GetString(7);
                profile.cardType    = sqlite_datareader.GetString(8);
                profile.cardNumber  = sqlite_datareader.GetString(9);
                profile.cardName    = sqlite_datareader.GetString(10);
                profile.cardCVV     = sqlite_datareader.GetString(11);
                profile.cardMonth   = sqlite_datareader.GetString(12);
                profile.cardYear    = sqlite_datareader.GetString(13);
                profile.postalcode  = sqlite_datareader.GetString(14);
                profile.profilename = sqlite_datareader.GetString(15);
                result.Add(profile);
                index++;
            }
            return(result);
        }
        public void InsertData_profile_MCT(ProfileMCT profile)
        {
            SQLiteCommand sqlite_cmd;

            sqlite_cmd = sqlite_conn.CreateCommand();
            string command = "INSERT INTO profile_mct VALUES (";

            sqlite_cmd.CommandText = string.Concat(command, '"', profile.email, '"', ", ", '"', profile.firstname, '"', ", ", '"', profile.lastname, '"', ", ", '"', profile.province, '"', ", ", '"', profile.city, '"', ", ", '"', profile.address1, '"', ", ", '"', profile.address2, '"', ", ", '"', profile.phone, '"', ",", '"', profile.cardType, '"', ",", '"', profile.cardNumber, '"', ",", '"', profile.cardName, '"', ",", '"', profile.cardCVV, '"', ",", '"', profile.cardMonth, '"', ",", '"', profile.cardYear, '"', ",", '"', profile.postalcode, '"', ",", '"', profile.profilename, '"', ");");
            sqlite_cmd.ExecuteNonQuery();
        }
        public TaskControl(BotTask task, MainWindow main)
        {
            InitializeComponent();
            store_label.Content   = task.store;
            id_label.Content      = task.id;
            profile_label.Content = task.profilename;
            bottask = task;

            if (task.store.Contains("+"))
            {
                size_label.Content = task.size;
                if (task.product_url.Split(';').Length < 2)
                {
                    product_label.Text  = "SKU CODE:" + task.product_url;
                    bottask.product_url = task.product_url;
                }
                else if (task.product_url.Split(';').Length == 2)
                {
                    product_label.Text  = Constant.g_strBase_AS + task.product_url.Split(';')[1];
                    bottask.product_url = Constant.g_strBase_AS + task.product_url.Split(';')[1];
                }
                foreach (var temp_profile in TaskManagement.User_Profiles)
                {
                    if (temp_profile.profilename == bottask.profilename)
                    {
                        botprofile = temp_profile;
                        break;
                    }
                }
            }
            else if (task.store == "zozo")
            {
                size_label.Content    = task.size;
                product_label.Text    = task.product_url;
                profile_label.Content = task.profilename;
                bottask = task;
            }
            else if (task.store == "FTC")
            {
                size_label.Content = task.size;
                if (task.product_url.Split(';').Length < 2)
                {
                    if (task.product_url.Contains("http"))
                    {
                        product_label.Text = task.product_url;
                    }
                    else
                    {
                        product_label.Text = "SKU CODE:" + task.product_url;
                    }

                    bottask.product_url = task.product_url;
                }
                else if (task.product_url.Split(';').Length == 2)
                {
                    product_label.Text  = Constant.g_strBase_FTC + task.product_url.Split(';')[1];
                    bottask.product_url = Constant.g_strBase_FTC + task.product_url.Split(';')[1];
                }
                foreach (var temp_profile in TaskManagement.User_Profiles)
                {
                    if (temp_profile.profilename == bottask.profilename)
                    {
                        botprofile = temp_profile;
                        break;
                    }
                }
            }
            else if (task.store == "arktz")
            {
                size_label.Content = task.size;
                if (task.product_url.Split(';').Length < 2)
                {
                    if (task.product_url.Contains("http"))
                    {
                        product_label.Text = task.product_url;
                    }
                    else
                    {
                        product_label.Text = "Keyword:" + task.product_url;
                    }

                    bottask.product_url = task.product_url;
                }
                else if (task.product_url.Split(';').Length == 2)
                {
                    product_label.Text  = Constant.g_strBase_ARK + task.product_url.Split(';')[1];
                    bottask.product_url = Constant.g_strBase_ARK + task.product_url.Split(';')[1];
                }
                foreach (var temp_profile in TaskManagement.User_Profiles)
                {
                    if (temp_profile.profilename == bottask.profilename)
                    {
                        botprofile = temp_profile;
                        break;
                    }
                }
            }
            else if (task.store == "ZINGARO")
            {
                product_label.Text = bottask.product_url;
                foreach (var temp_profile in TaskManagement.User_Profiles)
                {
                    if (temp_profile.profilename == bottask.profilename)
                    {
                        botprofile = temp_profile;
                        break;
                    }
                }
                size_label.Content = bottask.size;
            }
            else if (task.store == "MORTAR")
            {
                size_label.Content    = task.size;
                product_label.Text    = task.product_url;
                profile_label.Content = task.profilename;
                foreach (var temp_profile in TaskManagement.User_Profiles)
                {
                    if (temp_profile.profilename == task.profilename)
                    {
                        botprofile_Mortar = temp_profile;
                        break;
                    }
                }
                bottask = task;
            }
            else
            {
                foreach (var temp_profile in TaskManagement.User_Profiles_MCT)
                {
                    if (temp_profile.profilename == bottask.profilename)
                    {
                        botprofile_MCT = temp_profile;
                        break;
                    }
                }
            }

            status_label.Content = "IDLE";
            DataProcess db = new DataProcess();

            db.CreateConnection("user.db");
            //read proxies
            List <ProxyGroup> proxies = db.ReadData_proxy_group();

            db.Endprocess();
            foreach (var proxygroup in proxies)
            {
                if (proxygroup.group_name == bottask.activeProxy)
                {
                    botproxies = proxygroup.proxylist;
                }
            }

            if (botproxies.Count > 0)
            {
                Random  random       = new Random();
                int     rnd_index    = random.Next() % botproxies.Count;
                MyProxy active_proxy = botproxies[rnd_index];
                CGlobalVar.g_bUseProxy    = true;
                CGlobalVar.g_strProxyIP   = active_proxy.url.Trim();
                CGlobalVar.g_nProxyPort   = active_proxy.port.Trim();
                CGlobalVar.g_strProxyID   = active_proxy.user.Trim();
                CGlobalVar.g_strProxyPass = active_proxy.pass.Trim();
                proxy_label.Content       = CGlobalVar.g_strProxyIP;
            }
            parent = main;
        }