コード例 #1
0
        private void Upload(VideoDetails Video)
        {
            int    SKU        = Video.SKU;
            string ManPartNum = Video.PartNum;
            string Title      = Video.WebTitle;

            Title = Title.Length > 100 ? Title.Substring(0, 100) : Title;
            int    len      = Title.Length;
            string Desc     = Video.vidDesc;
            string FilePath = $@"C:\Users\Arjun.Prasad\Downloads\Videos\360video\{ManPartNum}\index.files\html5video\{ManPartNum}.m4v";
            string tempTags = Video.Keywords;

            string[] Tags = String.IsNullOrEmpty(tempTags) ? null : Video.Keywords.Split(',');

            UploadVideo UV = new UploadVideo(Title, Desc, Tags, FilePath, SKU);

            if (UV.uploadUpdate())
            {
                if (UV.notUp != null)
                {
                    notUp1.Add(UV.notUp);
                }
                else
                {
                    MongoUpdate MU = new MongoUpdate(SKU, UV.getvideoID(), ManPartNum);
                }
            }
            else
            {
                error = true;
            }
        }
コード例 #2
0
        private void setVidDetails(List <string> ManPartNum)
        {
            string connectionString = ConfigurationManager.AppSettings["SQLConn"];

            using (SqlConnection conn = new SqlConnection(connectionString))
            {
                string temp = "PartNum = '" + ManPartNum[0] + "'";

                foreach (var num in ManPartNum)
                {
                    temp += " OR PartNum = '" + num + "'";
                }

                SqlCommand command = new SqlCommand("SELECT * FROM goods fs " +
                                                    "inner join supplier ps on ps.ProductID = fs.ID " +
                                                    $"WHERE ps.SupplierID = 111 and fs.Status in (0, 3) and ({temp})", conn);

                conn.Open();

                var read = command.ExecuteReader();

                while (read.Read())
                {
                    VideoDetails VD = new VideoDetails()
                    {
                        PartNum  = read["Num"].ToString().Trim(),
                        WebTitle = read["Title"].ToString().Trim(),
                        SKU      = (int)read["ID"],
                        Keywords = read["Key"].ToString().Trim(),
                        vidDesc  = read["Desc"].ToString().Trim(),
                    };

                    VidDetails.Add(VD);
                }
            }
        }