Scalar-Valued Functions

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
11/7/2008 11:23:17 AM
Gravatar
Total Posts 58

Scalar-Valued Functions

I notice you added 3 new functions to the MS SQL database.  PersianDay, PersianMonth and PersionYear.  Other than in the install scripts, I don't see where you use them.  Can you explain this addition to the code?

11/7/2008 12:44:16 PM
Gravatar
Total Posts 18439

Re: Scalar-Valued Functions

Hi Aaron,

Its there to better support Persian Date grouping in the blog. There are a couple of stored procs that use those functions and they are called from DBBlog.cs if the Culture of the executing thread is fa-IR (Persian)

Example:

public static IDataReader GetBlogEntriesByMonth(int month, int year, int moduleId)
{
if (CultureInfo.CurrentCulture.Name == "fa-IR")
{
return GetBlogEntriesByMonthPersian(month, year, moduleId);
}

SqlParameterHelper sph = new SqlParameterHelper(GetConnectionString(), "mp_Blog_SelectByMonth", 3);
sph.DefineSqlParameter("@Month", SqlDbType.Int, ParameterDirection.Input, month);
sph.DefineSqlParameter("@Year", SqlDbType.Int, ParameterDirection.Input, year);
sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
return sph.ExecuteReader();
}

Best,

Joe

11/7/2008 4:25:41 PM
Gravatar
Total Posts 58

Re: Scalar-Valued Functions

Thanks.  That's a big help.  I have various functions I use in modules so it was new to me to see some in your install.

You must sign in to post in the forums. This thread is closed to new posts.