1
Vote

Cant create product using UI

description

Hi i'm from Russia. Today I install commerce and find one problem: In Commerce admin section I try to create a new product, for example "Test Poduct" (Products->Create) And I see create product window. I check Manufacturer and type in "Test Poduct" as Product Name and push create. After it I find error:

Application server error '/'.

DateTime conversion from symbol string error

SubSonic.SqlQueryException: DateTime conversion from symbol string error (Ошибка преобразования datetime из символьной строки).

Row 68: typeInstance.Alias = Text;
Row 69: typeInstance.UserId = BasePages.UmbracoEnsuredPage.GetUserId(BasePages.UmbracoEnsuredPage.umbracoUserContextID);
Row 70: typeInstance.Save();
Row 71:
Row 72: // check for returning url

Source file: D:\UmIntegrator\umbraco 4.0.1 commerce\umbraco\presentation\umbraco\create\dialogHandler_temp.cs Row: 70

Stack trace:

[SqlQueryException: DateTime conversion from symbol string error.]
SubSonic.Insert.Execute() +293
CommerceForUmbraco.adminSection.tasks.ProductTasks.InsertProduct() +1990
CommerceForUmbraco.adminSection.tasks.ProductTasks.Save() +44
umbraco.presentation.create.dialogHandler_temp.Create(String NodeType, Int32 TypeId, Int32 NodeId, String Text) in D:\UmIntegrator\umbraco 4.0.1 commerce\umbraco\presentation\umbraco\create\dialogHandler_temp.cs:70
CommerceForUmbraco.adminSection.commerce.CreateProduct.sbmt_Click(Object sender, EventArgs e) +168
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

When I create more detalied debug, i find, that error comes from CommerceTasks.cs file of CommerceForUmbraco.adminSection project:

int successOrNot = new SubSonic.Insert().Into(Product.Schema).Values(
                Alias
               ,System.Guid.NewGuid().ToString()    
               ,Alias
               ,Alias
               ,manufacturerId
               ,DBNull.Value
               ,1
               ,1
               ,1
               ,1
               ,1
               ,DBNull.Value
               ,0
               ,0
               ,0
               ,SiteConfig.CurrencyCode.ToString()
               ,"each"
               ,DBNull.Value
               ,0
               ,0
               ,0
               ,"each"
               ,0
               ,99
               ,4
               ,1
               ,DBNull.Value
               ,SubSonic.Utilities.Utility.FormatDate(DateTime.Now, true)
               ,"Commerce For Umbraco"
               , SubSonic.Utilities.Utility.FormatDate(DateTime.Now, true)
               , "Commerce For Umbraco")
                .Execute(); - SqlQueryException

What I need to eliminate this error to add new products using admin section UI

file attachments

comments

sperr0w wrote Jul 29, 2009 at 3:29 PM

I think, issue in date format of SubSonic.Utilities.Utility.FormatDate(DateTime.Now, true) code...
While debug it returns: SubSonic.Utilities.Utility.FormatDate(DateTime.Now, true) "July 29, 2009 08:29 PM" string

sperr0w wrote Jul 29, 2009 at 3:54 PM

When I change function to:

int successOrNot = new SubSonic.Insert().Into(Product.Schema).Values(
Alias
,System.Guid.NewGuid().ToString()
,Alias
,Alias
,manufacturerId
,DBNull.Value
,1
,1
,1
,1
,1
,DBNull.Value
,0
,0
,0
,SiteConfig.CurrencyCode.ToString()
,"each"
,DBNull.Value
,0
,0
,0
,"each"
,0
,99
,4
,1
,DBNull.Value
,DateTime.Now
,"Commerce For Umbraco"
, DateTime.Now
, "Commerce For Umbraco")
.Execute(); - SqlQueryException

all work. Am I right? Do i really need to remove SubSonic.Utilities.Utility.FormatDate? or it creates some problems in the future?