Esempio n. 1
0
        public int Save()
        {
            int     nResult = -1;
            int     nNewUID = -1;
            DataSet ds      = new DataSet();

            using (TransactionScope scope1 = new TransactionScope(TransactionScopeOption.Required))
            {
                try
                {
                    DAL.DataProvider.SqlClientProvider oSqlClientProvider = new DAL.DataProvider.SqlClientProvider();


                    nNewUID = oSqlClientProvider.SaveProduct(this.ID, this.Name, this.Code, this.ExtraCode1, this.ExtraCode2, this.ExtraCode3, this.ExtraCode4, this.Category.ID, this.Diameter, this.WireDiameter, this.NumberOfForm, this.NumberOfTurns, this.RawMaterialsCharacteristic, this.StraighteningLength, this.Price, this.Weight, this.Picture1, this.Picture2, this.Picture3, this.Picture4, this.TecniquePicture, this.PDFDocument, this.HatveArasi, this.ToplamBoy, this.KancaArasi, this.Ictenice, this.KancaYonu, (int)State, this.UpdateUserID, out nResult);

                    if (nResult == 0)
                    {
                        this.ID = nNewUID;
                        scope1.Complete();
                    }
                }
                catch (System.Data.SqlClient.SqlException Exp)
                {
                    //bool rethrow =
                    // ExceptionPolicy.HandleException(Exp, "StoreLocator Data Policy");

                    //if (rethrow)
                    //{
                    //    throw;
                    //}
                }
                catch (Exception Exp)
                {
                    //bool rethrow =
                    // ExceptionPolicy.HandleException(Exp, "StoreLocator Business Policy");

                    //if (rethrow)
                    //{
                    //    throw;
                    //}
                }
            }
            return(nResult);
        }