Ejemplo n.º 1
0
 private static void InsertProduct()
 {
     try
     {
         using (SqlConnection con = new SqlConnection(connection))
         {
             con.Open();
             using (SqlCommand cmd = new SqlCommand())
             {
                 cmd.Connection  = con;
                 cmd.CommandText = "update tbl_platt_product set Category=@Category,ProductTitle=@ProductTitle,mfr=@mfr,item=@item,UPC=@UPC,CAT=@CAT,Long_desc=@Long_desc,Price = @Price,UOM = @UOM,Spec = @Spec,image_link = @image_link,Catelog = @Catelog,AlsoKnowAs = @AlsoKnowAs where productid=@sourceid";
                 cmd.Parameters.AddWithValue(@"Category", platt.Category != null ? ReplaceString.PutString(platt.Category) : "");
                 cmd.Parameters.AddWithValue(@"ProductTitle", platt.ProductTitle != null ? ReplaceString.PutString(platt.ProductTitle) : "");
                 cmd.Parameters.AddWithValue(@"mfr", platt.mfr != null ? ReplaceString.PutString(platt.mfr) : "");
                 cmd.Parameters.AddWithValue(@"item", platt.item != null ? ReplaceString.PutString(platt.item) : "");
                 cmd.Parameters.AddWithValue(@"UPC", platt.UPC != null ? ReplaceString.PutString(platt.UPC) : "");
                 cmd.Parameters.AddWithValue(@"CAT", platt.CAT != null ? ReplaceString.PutString(platt.CAT) : "");
                 cmd.Parameters.AddWithValue(@"Long_desc", platt.Long_desc != null ? ReplaceString.PutString(platt.Long_desc) : "");
                 cmd.Parameters.AddWithValue(@"Price", platt.Price != null ? ReplaceString.PutString(platt.Price) : "");
                 cmd.Parameters.AddWithValue(@"UOM", platt.UOM != null ? ReplaceString.PutString(platt.UOM) : "");
                 cmd.Parameters.AddWithValue(@"Spec", platt.Spec != null ? ReplaceString.PutString(platt.Spec) : "");
                 cmd.Parameters.AddWithValue(@"image_link", platt.image_link != null ? ReplaceString.PutString(platt.image_link) : "");
                 cmd.Parameters.AddWithValue(@"Catelog", platt.Catelog != null ? ReplaceString.PutString(platt.Catelog) : "");
                 cmd.Parameters.AddWithValue(@"AlsoKnowAs", platt.AlsoKnowAs != null ? ReplaceString.PutString(platt.AlsoKnowAs) : "");
                 cmd.Parameters.AddWithValue("@sourceid", sourceid);
                 cmd.ExecuteNonQuery();
             }
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("Error While Updating the Product");
     }
 }
Ejemplo n.º 2
0
 private static void InsertProduct()
 {
     try
     {
         using (SqlConnection con = new SqlConnection(connection))
         {
             con.Open();
             using (SqlCommand cmd = new SqlCommand())
             {
                 cmd.Connection  = con;
                 cmd.CommandText = "update tbl_abf_store_product set Category=@Category,Title=@Title,ProductDesc=@ProductDesc,Manufacture=@Manufacture,PartNo=@PartNo,MNP=@MNP,Spec=@Spec,image_url=@image_url where productid = @sourceid";
                 cmd.Parameters.AddWithValue("@Category", Dabfstore.Category != null ? ReplaceString.PutString(Dabfstore.Category) : "");
                 cmd.Parameters.AddWithValue("@Title", Dabfstore.Title != null ? ReplaceString.PutString(Dabfstore.Title) : "");
                 cmd.Parameters.AddWithValue("@ProductDesc", Dabfstore.ProductDesc != null ? ReplaceString.PutString(Dabfstore.ProductDesc) : "");
                 cmd.Parameters.AddWithValue("@Manufacture", Dabfstore.Manufacture != null ? ReplaceString.PutString(Dabfstore.Manufacture) : "");
                 cmd.Parameters.AddWithValue("@PartNo", Dabfstore.PartNo != null ? ReplaceString.PutString(Dabfstore.PartNo) : "");
                 cmd.Parameters.AddWithValue("@MNP", Dabfstore.MNP != null ? ReplaceString.PutString(Dabfstore.MNP) : "");
                 cmd.Parameters.AddWithValue("@Spec", Dabfstore.Spec != null ? ReplaceString.PutString(Dabfstore.Spec) : "");
                 cmd.Parameters.AddWithValue("@image_url", Dabfstore.image_url != null ? ReplaceString.PutString(Dabfstore.image_url) : "");
                 cmd.Parameters.AddWithValue("@sourceid", sourceid);
                 cmd.ExecuteNonQuery();
             }
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("Error While Updating the Product");
     }
 }
Ejemplo n.º 3
0
 public void UpdateProductData(ArrowProduct ArrowProduct)
 {
     try
     {
         LabelLog("Update product data !!");
         using (SqlConnection sqlConnection = new SqlConnection(connection))
         {
             sqlConnection.Open();
             SqlCommand sqlCommand = new SqlCommand("update [dbo].[tbl_Arrow_Product] set itemtitle=@itemtitle,Productdescription=@Productdescription,MPN=@MPN,Manufacturename=@Manufacturename,productcategory=@productcategory,UOM=@UOM,price=@price,imageurl=@imageurl,category=@category,techspec=@techspec where Productid=@id", sqlConnection);
             sqlCommand.CommandType = CommandType.Text;
             sqlCommand.Parameters.AddWithValue("@itemtitle", (ArrowProduct.itemtitle == null) ? "" :ReplaceString.PutString(ArrowProduct.itemtitle));
             sqlCommand.Parameters.AddWithValue("@Productdescription", (ArrowProduct.Productdescription == null) ? "" : ReplaceString.PutString(ArrowProduct.Productdescription));
             sqlCommand.Parameters.AddWithValue("@MPN", (ArrowProduct.MPN == null) ? "" : ReplaceString.PutString(ArrowProduct.MPN));
             sqlCommand.Parameters.AddWithValue("@Manufacturename", (ArrowProduct.Manufacturename == null) ? "" : ReplaceString.PutString(ArrowProduct.Manufacturename));
             sqlCommand.Parameters.AddWithValue("@productcategory", (ArrowProduct.productcategory == null) ? "" : ReplaceString.PutString(ArrowProduct.productcategory));
             sqlCommand.Parameters.AddWithValue("@UOM", (ArrowProduct.UOM == null) ? "" : ReplaceString.PutString(ArrowProduct.UOM));
             sqlCommand.Parameters.AddWithValue("@price", (ArrowProduct.price == null) ? "" : ReplaceString.PutString(ArrowProduct.price));
             sqlCommand.Parameters.AddWithValue("@imageurl", (ArrowProduct.imageurl == null) ? "" : ReplaceString.PutString(ArrowProduct.imageurl));
             sqlCommand.Parameters.AddWithValue("@category", (ArrowProduct.category == null) ? "" : ReplaceString.PutString(ArrowProduct.category));
             sqlCommand.Parameters.AddWithValue("@techspec", (ArrowProduct.techspec == null) ? "" : ReplaceString.PutString(ArrowProduct.techspec));
             //sqlCommand.Parameters.AddWithValue("@ProductURL", SourceLink);
             sqlCommand.Parameters.AddWithValue("@id", sourceid);
             sqlCommand.ExecuteNonQuery();
         }
     }
     catch (Exception ex)
     {
         LabelLog("updateing product data failed!!");
     }
 }
Ejemplo n.º 4
0
 private static void UpdateProductData()
 {
     try
     {
         Console.WriteLine("Update product data !!");
         using (SqlConnection sqlConnection = new SqlConnection(connection))
         {
             sqlConnection.Open();
             SqlCommand sqlCommand = new SqlCommand("update tbl_turtle_ProductLink set Category=@Category, ProductTitle = @ProductTitle, ProductDescription = @ProductDescription, Manufacturers = @Manufacturers, BrandName = @BrandName, Part = @Part, MNP = @MNP, UPC = @UPC, Description = @Description, Specification = @Specification, Document = @Document, Features = @Features, UOM = @UOM, Price = @Price where ProductId = @ProductId", sqlConnection);
             sqlCommand.CommandType = CommandType.Text;
             sqlCommand.Parameters.AddWithValue(@"Category", (Turtle.Category == null) ? "" : Stringreplace(ReplaceString.PutString(Turtle.Category)));
             sqlCommand.Parameters.AddWithValue(@"ProductTitle", (Turtle.ProductTitle == null) ? "" : Stringreplace(ReplaceString.PutString(Turtle.ProductTitle)));
             sqlCommand.Parameters.AddWithValue(@"ProductDescription", (Turtle.ProductDescription == null) ? "" : Stringreplace(ReplaceString.PutString(Turtle.ProductDescription)));
             sqlCommand.Parameters.AddWithValue(@"Manufacturers", (Turtle.Manufacturers == null) ? "" : Stringreplace(ReplaceString.PutString(Turtle.Manufacturers)));
             sqlCommand.Parameters.AddWithValue(@"BrandName", (Turtle.BrandName == null) ? "" : Stringreplace(ReplaceString.PutString(Turtle.BrandName)));
             sqlCommand.Parameters.AddWithValue(@"Part", (Turtle.Part == null) ? "" : Stringreplace(ReplaceString.PutString(Turtle.Part)));
             sqlCommand.Parameters.AddWithValue(@"MNP", (Turtle.MNP == null) ? "" : Stringreplace(ReplaceString.PutString(Turtle.MNP)));
             sqlCommand.Parameters.AddWithValue(@"UPC", (Turtle.UPC == null) ? "" : Stringreplace(ReplaceString.PutString(Turtle.UPC)));
             sqlCommand.Parameters.AddWithValue(@"Description", (Turtle.Description == null) ? "" : Stringreplace(ReplaceString.PutString(Turtle.Description)));
             sqlCommand.Parameters.AddWithValue(@"Specification", (Turtle.Specification == null) ? "" : Stringreplace(ReplaceString.PutString(Turtle.Specification)));
             sqlCommand.Parameters.AddWithValue(@"Document", (Turtle.Document == null) ? "" : Stringreplace(ReplaceString.PutString(Turtle.Document)));
             sqlCommand.Parameters.AddWithValue(@"Features", (Turtle.Features == null) ? "" : Stringreplace(ReplaceString.PutString(Turtle.Features)));
             sqlCommand.Parameters.AddWithValue(@"UOM", (Turtle.UOM == null) ? "" : Stringreplace(ReplaceString.PutString(Turtle.UOM)));
             sqlCommand.Parameters.AddWithValue(@"Price", (Turtle.Price == null) ? "" : Stringreplace(ReplaceString.PutString(Turtle.Price)));
             sqlCommand.Parameters.AddWithValue("@ProductId", sourceid);
             sqlCommand.ExecuteNonQuery();
         }
     }
     catch (Exception ex) {
         Console.WriteLine(ex.ToString());
     }
 }
Ejemplo n.º 5
0
        private static void GetProductData()
        {
            try
            {
                var data = ReplaceString.PutString("");
                Turtle = new Turtle();
                h1     = null;
                h1     = new HtmlDocument();
                h1.LoadHtml(DownloadedString);
                try
                {
                    var category = h1.DocumentNode.SelectSingleNode("//ul[@class='breadcrumb']").InnerHtml.ToString();
                    h2 = null;
                    h2 = new HtmlDocument();
                    h2.LoadHtml(category);
                    Turtle.Category = h2.DocumentNode.SelectNodes("//li").Select(s => s.InnerText.ToString().Replace("/n", "").Trim()).Aggregate((a, b) => a + "> " + b).ToString();
                }
                catch { Turtle.Category = string.Empty; }
                try
                {
                    Turtle.ProductTitle = h1.DocumentNode.SelectSingleNode("//h2[@class='cimm_prodDetailTitle']").InnerText.ToString().Trim();
                }
                catch { Turtle.ProductTitle = string.Empty; }
                try
                {
                    Turtle.ProductDescription = h1.DocumentNode.SelectSingleNode("//p[@class='cimm_itemShortDesc']").InnerText.ToString().Trim();
                }
                catch { Turtle.ProductDescription = string.Empty; }
                try
                {
                    //productDetailList
                    var tabledata = h1.DocumentNode.SelectSingleNode("//table[@id='productDetailList']").InnerHtml.ToString();
                    h2 = null;
                    h2 = new HtmlDocument();
                    h2.LoadHtml(tabledata);
                    try
                    {
                        Turtle.Manufacturers = h2.DocumentNode.SelectNodes("//tr").Where(w => w.InnerText.Contains("Manufacturers")).Select(s => s.InnerText.ToString().Replace("Manufacturers", "").Replace("/n", "").Trim()).FirstOrDefault();
                    }
                    catch { Turtle.Manufacturers = string.Empty; }
                    try
                    {
                        Turtle.BrandName = h2.DocumentNode.SelectNodes("//tr").Where(w => w.InnerText.Contains("Brand Name")).Select(s => s.InnerText.ToString().Replace("Brand Name", "").Replace("\n", "").Trim()).FirstOrDefault();
                    }
                    catch { Turtle.BrandName = string.Empty; }
                    try
                    {
                        Turtle.UPC = h2.DocumentNode.SelectNodes("//tr").Where(w => w.InnerText.Contains("UPC")).Select(s => s.InnerText.ToString().Replace("UPC", "").Replace("/n", "").Trim()).FirstOrDefault();
                    }
                    catch { Turtle.UPC = string.Empty; }
                    try
                    {
                        Turtle.MNP = h2.DocumentNode.SelectNodes("//tr").Where(w => w.InnerText.Contains("MPN")).Select(s => s.InnerText.ToString().Replace("MPN", "").Replace("/n", "").Trim()).FirstOrDefault();
                    }
                    catch { Turtle.MNP = string.Empty; }

                    try
                    {
                        Turtle.Part = h2.DocumentNode.SelectNodes("//tr").Where(w => w.InnerText.Contains("Part #")).Select(s => s.InnerText.ToString().Replace("Part #:", "").Replace("/n", "").Trim()).FirstOrDefault();
                    }
                    catch { Turtle.Part = string.Empty; }
                }
                catch { }
                try
                {
                    var specdata = h1.DocumentNode.SelectSingleNode("//div[@id='specificationSection']").InnerHtml.ToString();
                    h2 = null;
                    h2 = new HtmlDocument();
                    h2.LoadHtml(specdata);
                    Turtle.Specification = Stringreplace(h2.DocumentNode.SelectNodes("//tr").Select(s => s.InnerText.ToString().Replace(" ", "").Replace("\n", "").Trim()).Aggregate((a, b) => a + " | " + b).ToString());
                }
                catch { Turtle.Specification = string.Empty; }

                try
                {
                    Turtle.Description = h1.DocumentNode.SelectSingleNode("//div[@id='descriptionSection']").InnerText.ToString().Trim();
                }
                catch { Turtle.Description = ""; }
                try
                {
                    Turtle.Document = h1.DocumentNode.SelectNodes("//span[@class='cimm_pdfLink hideMe']").Select(s => s.InnerText.ToString().Trim()).Aggregate((a, b) => a + " | " + b).ToString();
                }
                catch { Turtle.Document = ""; }
                try
                {
                    Turtle.Features = h1.DocumentNode.SelectSingleNode("//div[@id='featureSection']").InnerText.ToString().Trim();
                }
                catch { Turtle.Features = ""; }
                GetPriceString();
            }
            catch { }
            finally
            {
                UpdateProductData();
                Turtle = null;
                h1     = null;
                h2     = null;
            }
        }
Ejemplo n.º 6
0
        private static void InsertProduct()
        {
            try
            {
                using (SqlConnection con = new SqlConnection(connection))
                {
                    con.Open();
                    using (SqlCommand cmd = new SqlCommand())
                    {
                        cmd.Connection  = con;
                        cmd.CommandText = "update tbl_columbiapipe_product set Category=@Category,ProTitle=@ProTitle,mfr=@mfr,item=@item,upc=@upc,brand=@brand,MOQ=@MOQ,QtyInter=@QtyInter,LongDesc=@LongDesc,Price=@Price,UOM=@UOM,Feature=@Feature,Spec=@Spec,img_Link=@img_Link where productid=@sourceid";
                        cmd.Parameters.AddWithValue(@"Category", columbiapipe.Category != null ? ReplaceString.PutString(columbiapipe.Category) : "");
                        cmd.Parameters.AddWithValue(@"ProTitle", columbiapipe.ProTitle != null ? ReplaceString.PutString(columbiapipe.ProTitle) : "");
                        cmd.Parameters.AddWithValue(@"mfr", columbiapipe.mfr != null ? ReplaceString.PutString(columbiapipe.mfr) : "");
                        cmd.Parameters.AddWithValue(@"item", columbiapipe.item != null ? ReplaceString.PutString(columbiapipe.item) : "");
                        cmd.Parameters.AddWithValue(@"upc", columbiapipe.upc != null ? ReplaceString.PutString(columbiapipe.upc) : "");
                        cmd.Parameters.AddWithValue(@"brand", columbiapipe.brand != null ? ReplaceString.PutString(columbiapipe.brand) : "");
                        cmd.Parameters.AddWithValue(@"MOQ", columbiapipe.MOQ != null ? ReplaceString.PutString(columbiapipe.MOQ) : "");
                        cmd.Parameters.AddWithValue(@"QtyInter", columbiapipe.QtyInter != null ? ReplaceString.PutString(columbiapipe.QtyInter) : "");
                        cmd.Parameters.AddWithValue(@"LongDesc", columbiapipe.LongDesc != null ? ReplaceString.PutString(columbiapipe.LongDesc) : "");
                        cmd.Parameters.AddWithValue(@"Price", columbiapipe.Price != null ? ReplaceString.PutString(columbiapipe.Price) : "");
                        cmd.Parameters.AddWithValue(@"UOM", columbiapipe.UOM != null ? ReplaceString.PutString(columbiapipe.UOM) : "");
                        cmd.Parameters.AddWithValue(@"Feature", columbiapipe.Feature != null ? ReplaceString.PutString(columbiapipe.Feature) : "");
                        cmd.Parameters.AddWithValue(@"Spec", columbiapipe.Spec != null ? ReplaceString.PutString(columbiapipe.Spec) : "");
                        cmd.Parameters.AddWithValue(@"img_Link", columbiapipe.img_Link != null ? ReplaceString.PutString(columbiapipe.img_Link) : "");

                        cmd.Parameters.AddWithValue("@sourceid", sourceid);
                        cmd.ExecuteNonQuery();
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error While Updating the Product");
            }
        }
Ejemplo n.º 7
0
 public static void UpdateProductData()
 {
     try
     {
         Console.WriteLine("Update product data !!");
         using (SqlConnection sqlConnection = new SqlConnection(connection))
         {
             sqlConnection.Open();
             SqlCommand sqlCommand = new SqlCommand("update [dbo].[tbl_fastenal_productData] set Title=@Title ,ManuPartNo=@ManuPartNo ,ManuName=@ManuName ,FastePartNo=@FastePartNo ,WPrice=@WPrice ,Oprice=@Oprice ,UPrice=@UPrice ,UOM=@UOM ,Spec=@Spec ,Category=@Category ,ImageLink=@ImageLink ,UNSPSC=@UNSPSC where Productid=@Productid", sqlConnection);
             sqlCommand.CommandType = CommandType.Text;
             sqlCommand.Parameters.AddWithValue("@Category", (fastenal.Category == null) ? "" : ReplaceString.PutString(fastenal.Category));
             sqlCommand.Parameters.AddWithValue("@Title", (fastenal.Title == null) ? "" : ReplaceString.PutString(fastenal.Title));
             sqlCommand.Parameters.AddWithValue("@ManuPartNo", (fastenal.ManuPartNo == null) ? "" : ReplaceString.PutString(fastenal.ManuPartNo));
             sqlCommand.Parameters.AddWithValue("@ManuName", (fastenal.ManuName == null) ? "" : ReplaceString.PutString(fastenal.ManuName));
             sqlCommand.Parameters.AddWithValue("@FastePartNo", (fastenal.FastePartNo == null) ? "" : ReplaceString.PutString(fastenal.FastePartNo));
             sqlCommand.Parameters.AddWithValue("@WPrice", (fastenal.WPrice == null) ? "" : ReplaceString.PutString(fastenal.WPrice));
             sqlCommand.Parameters.AddWithValue("@Oprice", (fastenal.Oprice == null) ? "" : ReplaceString.PutString(fastenal.Oprice));
             sqlCommand.Parameters.AddWithValue("@UPrice", (fastenal.UPrice == null) ? "" : ReplaceString.PutString(fastenal.UPrice));
             sqlCommand.Parameters.AddWithValue("@UOM", (fastenal.UOM == null) ? "" : ReplaceString.PutString(fastenal.UOM));
             sqlCommand.Parameters.AddWithValue("@Spec", (fastenal.Spec == null) ? "" : ReplaceString.PutString(fastenal.Spec));
             sqlCommand.Parameters.AddWithValue("@ImageLink", (fastenal.ImageLink == null) ? "" : ReplaceString.PutString(fastenal.ImageLink));
             sqlCommand.Parameters.AddWithValue("@UNSPSC", (fastenal.UNSPSC == null) ? "" : ReplaceString.PutString(fastenal.UNSPSC));
             sqlCommand.Parameters.AddWithValue("@Productid", sourceid);
             sqlCommand.ExecuteNonQuery();
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("updateing product data failed!!");
     }
 }
Ejemplo n.º 8
0
 public static void UpdateProductData()
 {
     try
     {
         Console.WriteLine("Update product data !!");
         using (SqlConnection sqlConnection = new SqlConnection(connection))
         {
             sqlConnection.Open();
             SqlCommand sqlCommand = new SqlCommand("update [dbo].[tbl_supplyhouse_product] set category=@category,Title=@Title,SKU=@SKU,BrandName=@BrandName,Price=@Price,UOM=@UOM,Description=@Description,Specification=@Specification,ImageLink=@ImageLink where ProductID=@id", sqlConnection);
             sqlCommand.CommandType = CommandType.Text;
             sqlCommand.Parameters.AddWithValue("@category", (supplyhouse.category == null) ? "" :ReplaceString.PutString(supplyhouse.category));
             sqlCommand.Parameters.AddWithValue("@Title", (supplyhouse.Title == null) ? "" : ReplaceString.PutString(supplyhouse.Title));
             sqlCommand.Parameters.AddWithValue("@SKU", (supplyhouse.SKU == null) ? "" : ReplaceString.PutString(supplyhouse.SKU));
             sqlCommand.Parameters.AddWithValue("@BrandName", (supplyhouse.BrandName == null) ? "" : ReplaceString.PutString(supplyhouse.BrandName));
             sqlCommand.Parameters.AddWithValue("@Price", (supplyhouse.Price == null) ? "" : ReplaceString.PutString(supplyhouse.Price));
             sqlCommand.Parameters.AddWithValue("@UOM", (supplyhouse.UOM == null) ? "" : ReplaceString.PutString(supplyhouse.UOM));
             sqlCommand.Parameters.AddWithValue("@Description", (supplyhouse.Description == null) ? "" : ReplaceString.PutString(supplyhouse.Description));
             sqlCommand.Parameters.AddWithValue("@Specification", (supplyhouse.Specification == null) ? "" : ReplaceString.PutString(supplyhouse.Specification));
             sqlCommand.Parameters.AddWithValue("@ImageLink", (supplyhouse.ImageLink == null) ? "" : ReplaceString.PutString(supplyhouse.ImageLink));
             sqlCommand.Parameters.AddWithValue("@id", sourceid);
             sqlCommand.ExecuteNonQuery();
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("updateing product data failed!!");
     }
 }
Ejemplo n.º 9
0
 public static void UpdateProductData()
 {
     try
     {
         Console.WriteLine("Update product data !!");
         using (SqlConnection sqlConnection = new SqlConnection(connection))
         {
             sqlConnection.Open();
             SqlCommand sqlCommand = new SqlCommand("update [dbo].[tbl_fishersci_product] set Image_Link=@Image_Link,Specfication=@Specfication,UOM=@UOM,Price=@Price,SDP=@SDP,Categlog=@Categlog,MFR_Num=@MFR_Num,Manu_Name=@Manu_Name,Feature=@Feature,Short_desc=@Short_desc,Title=@Title,category=@category,IsLink=@IsLink where Productid =@Productid", sqlConnection);
             sqlCommand.CommandType = CommandType.Text;
             sqlCommand.Parameters.AddWithValue("@category", (fishersci.category == null) ? "" : ReplaceString.PutString(fishersci.category));
             sqlCommand.Parameters.AddWithValue("@Title", (fishersci.Title == null) ? "" : ReplaceString.PutString(fishersci.Title));
             sqlCommand.Parameters.AddWithValue("@Short_desc", (fishersci.Short_desc == null) ? "" : ReplaceString.PutString(fishersci.Short_desc));
             sqlCommand.Parameters.AddWithValue("@Feature", (fishersci.Feature == null) ? "" : ReplaceString.PutString(fishersci.Feature));
             sqlCommand.Parameters.AddWithValue("@Manu_Name", (fishersci.Manu_Name == null) ? "" : ReplaceString.PutString(fishersci.Manu_Name));
             sqlCommand.Parameters.AddWithValue("@MFR_Num", (fishersci.MFR_Num == null) ? "" : ReplaceString.PutString(fishersci.MFR_Num));
             sqlCommand.Parameters.AddWithValue("@Categlog", (fishersci.Categlog == null) ? "" : ReplaceString.PutString(fishersci.Categlog));
             sqlCommand.Parameters.AddWithValue("@SDP", (fishersci.SDP == null) ? "" : ReplaceString.PutString(fishersci.SDP));
             sqlCommand.Parameters.AddWithValue("@Price", (fishersci.Price == null) ? "" : ReplaceString.PutString(fishersci.Price));
             sqlCommand.Parameters.AddWithValue("@UOM", (fishersci.UOM == null) ? "" : ReplaceString.PutString(fishersci.UOM));
             sqlCommand.Parameters.AddWithValue("@Specfication", (fishersci.Specfication == null) ? "" : ReplaceString.PutString(fishersci.Specfication));
             sqlCommand.Parameters.AddWithValue("@Image_Link", (fishersci.Image_Link == null) ? "" : ReplaceString.PutString(fishersci.Image_Link));
             sqlCommand.Parameters.AddWithValue("@IsLink", 1);
             sqlCommand.Parameters.AddWithValue("@Productid", sourceid);
             sqlCommand.ExecuteNonQuery();
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("updateing product data failed!!");
     }
 }
Ejemplo n.º 10
0
 private static void InsertProduct()
 {
     try
     {
         using (SqlConnection con = new SqlConnection(connection))
         {
             con.Open();
             using (SqlCommand cmd = new SqlCommand())
             {
                 cmd.Connection  = con;
                 cmd.CommandText = "update tbl_pumpcatalog_product set Category=@Category , Title=@Title , Price=@Price , Manufacture=@Manufacture , PartNo=@PartNo , MPN=@MPN , UPC=@UPC , Description=@Description , Specification=@Specification , Image_URL=@Image_URL where id=@sourceid";
                 cmd.Parameters.AddWithValue(@"Category", DPumpCatelog.Category != null ? ReplaceString.PutString(DPumpCatelog.Category) : "");
                 cmd.Parameters.AddWithValue(@"Title", DPumpCatelog.Title != null ? ReplaceString.PutString(DPumpCatelog.Title) : "");
                 cmd.Parameters.AddWithValue(@"Price", DPumpCatelog.Price != null ? ReplaceString.PutString(DPumpCatelog.Price) : "");
                 cmd.Parameters.AddWithValue(@"Manufacture", DPumpCatelog.Manufacture != null ? ReplaceString.PutString(DPumpCatelog.Manufacture) : "");
                 cmd.Parameters.AddWithValue(@"PartNo", DPumpCatelog.PartNo != null ? ReplaceString.PutString(DPumpCatelog.PartNo) : "");
                 cmd.Parameters.AddWithValue(@"MPN", DPumpCatelog.MPN != null ? ReplaceString.PutString(DPumpCatelog.MPN) : "");
                 cmd.Parameters.AddWithValue(@"UPC", DPumpCatelog.UPC != null ? ReplaceString.PutString(DPumpCatelog.UPC) : "");
                 cmd.Parameters.AddWithValue(@"Description", DPumpCatelog.Description != null ? ReplaceString.PutString(DPumpCatelog.Description) : "");
                 cmd.Parameters.AddWithValue(@"Specification", DPumpCatelog.Specification != null ? ReplaceString.PutString(DPumpCatelog.Specification) : "");
                 cmd.Parameters.AddWithValue(@"Image_URL", DPumpCatelog.Image_URL != null ? ReplaceString.PutString(DPumpCatelog.Image_URL) : "");
                 cmd.Parameters.AddWithValue("@sourceid", sourceid);
                 cmd.ExecuteNonQuery();
             }
         }
     }
     catch (Exception ex) {
         Console.WriteLine("Error While Updating the Product");
     }
 }