Skip to content

Commit

Permalink
Source code migrated.
Browse files Browse the repository at this point in the history
  • Loading branch information
binodnp committed Sep 11, 2013
1 parent 3a73ec6 commit f04a3ef
Show file tree
Hide file tree
Showing 945 changed files with 125,506 additions and 251 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
bin
obj
*.pdb
Binary file not shown.
Binary file added Dependencies/AjaxControlToolkit/AjaxMin.dll
Binary file not shown.
Binary file not shown.
17 changes: 17 additions & 0 deletions Dependencies/AjaxControlToolkit/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

Copyright (c) 2012, CodePlex Foundation
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

* Neither the name of CodePlex Foundation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</textarea>




Binary file not shown.
15,261 changes: 15,261 additions & 0 deletions Dependencies/AjaxControlToolkit/Microsoft.WindowsAzure.Storage.xml

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Dependencies/Npgsql/Mono.Security.dll
Binary file not shown.
4,120 changes: 4,120 additions & 0 deletions Dependencies/Npgsql/Npgsql.XML

Large diffs are not rendered by default.

Binary file added Dependencies/Npgsql/Npgsql.dll
Binary file not shown.
13 changes: 13 additions & 0 deletions Dependencies/Npgsql/policy.2.0.Npgsql.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Npgsql"
publicKeyToken="5d8b90d52f46fda7"
culture="neutral" />
<bindingRedirect oldVersion="2.0.0.0-2.0.11.94"
newVersion="2.0.12.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Binary file added Dependencies/Npgsql/policy.2.0.Npgsql.dll
Binary file not shown.
28 changes: 28 additions & 0 deletions Dictionary.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8" ?>

<!--
Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
If a copy of the MPL was not distributed with this file, You can obtain one at
http://mozilla.org/MPL/2.0/.
-->

<Dictionary>
<Words>
<Unrecognized>
<Word>cb</Word>
</Unrecognized>
<Recognized>
<Word>MixERP</Word>
<Word>Eval</Word>
<Word>Pes</Word>
<Word>Sha</Word>
</Recognized>
</Words>
<Acronyms>
<CasingExceptions>
<Acronym>ERP</Acronym>
</CasingExceptions>
</Acronyms>
</Dictionary>
320 changes: 73 additions & 247 deletions LICENSE

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions Local.testsettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<TestSettings name="Local" id="941529df-1f0b-41c7-b962-e91a3991f95f" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<Description>These are default test settings for a local test run.</Description>
<Deployment enabled="false" />
<Execution>
<TestTypeSpecific />
<AgentRule name="Execution Agents">
</AgentRule>
</Execution>
</TestSettings>
139 changes: 139 additions & 0 deletions MixERP.Net.BusinessLayer/BasePageClass.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
/********************************************************************************
Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
If a copy of the MPL was not distributed with this file, You can obtain one at
http://mozilla.org/MPL/2.0/.
***********************************************************************************/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace MixERP.Net.BusinessLayer
{
public class BasePageClass : System.Web.UI.Page
{
/// <summary>
/// Use this parameter on the Page_Init event of member pages.
/// This parameter ensures that the user is not redirected to the login page
/// even when the user is not logged in.
/// </summary>
public bool NoLogOn { get; set; }

/// <summary>
/// Since we save the menu on the database, this parameter is only used
/// when there is no associated record of this page's url or path in the menu table.
/// Use this to override or fake the page's url or path. This forces navigation menus
/// on the left hand side to be displayed in regards with the specified path.
/// </summary>
public string OverridePath { get; set; }

protected override void OnLoad(EventArgs e)
{
if(string.IsNullOrWhiteSpace(OverridePath))
{
OverridePath = this.Page.Request.Url.AbsolutePath;
}

Literal menuLiteral = ((Literal)MixERP.Net.Common.PageUtility.FindControlIterative(this.Master, "ContentMenuLiteral"));

if(menuLiteral != null)
{
string menu = MixERP.Net.BusinessLayer.Helpers.MenuHelper.GetContentPageMenu(this.Page, this.OverridePath);
menuLiteral.Text = menu;
}

base.OnLoad(e);
}

protected override void OnPreInit(EventArgs e)
{
base.OnPreInit(e);
}

protected override void InitializeCulture()
{
SetCulture();
base.InitializeCulture();
}


protected override void OnInit(EventArgs e)
{
if(!IsPostBack)
{
if(Request.IsAuthenticated)
{
if(Context.Session == null)
{
SetSession();
}
else
{
if(Context.Session["UserId"] == null)
{
SetSession();
}
}
}
else
{
if(!this.NoLogOn)
{
RequestLogOnPage();
}
}
}

base.OnInit(e);
}

private static void SetCulture()
{
//Todo
Thread.CurrentThread.CurrentCulture = new CultureInfo(CultureInfo.InvariantCulture.Name);
LoadCulture(Thread.CurrentThread.CurrentCulture);

Thread.CurrentThread.CurrentUICulture = new CultureInfo(CultureInfo.InvariantCulture.Name);
LoadCulture(Thread.CurrentThread.CurrentUICulture);
}

private static void LoadCulture(CultureInfo c)
{
NumberFormatInfo numberFormat = c.NumberFormat;
numberFormat.NumberGroupSeparator = MixERP.Net.Common.Helpers.Parameters.ThousandSeparator();
numberFormat.NumberDecimalSeparator = MixERP.Net.Common.Helpers.Parameters.DecimalSeparator();
numberFormat.NumberDecimalDigits = MixERP.Net.Common.Conversion.TryCastInteger(MixERP.Net.Common.Helpers.Parameters.DecimalPlaces());
numberFormat.CurrencySymbol = MixERP.Net.Common.Helpers.Parameters.CurrencySymbol();
numberFormat.CurrencyGroupSeparator = MixERP.Net.Common.Helpers.Parameters.ThousandSeparator();
numberFormat.CurrencyDecimalSeparator = MixERP.Net.Common.Helpers.Parameters.DecimalSeparator();
numberFormat.CurrencyDecimalDigits = MixERP.Net.Common.Conversion.TryCastInteger(MixERP.Net.Common.Helpers.Parameters.DecimalPlaces());

DateTimeFormatInfo dateFormat = c.DateTimeFormat;
dateFormat.ShortDatePattern = MixERP.Net.Common.Helpers.Parameters.ShortDateFormat();
dateFormat.LongDatePattern = MixERP.Net.Common.Helpers.Parameters.LongDateFormat();
dateFormat.ShortTimePattern = MixERP.Net.Common.Helpers.Parameters.ShortTimeFormat();
dateFormat.LongTimePattern = MixERP.Net.Common.Helpers.Parameters.LongTimeFormat();
}

private void SetSession()
{
MixERP.Net.BusinessLayer.Security.User.SetSession(this.Page, User.Identity.Name);
}

public static void RequestLogOnPage()
{
FormsAuthentication.SignOut();
string currentUrl = HttpContext.Current.Request.RawUrl;
string loginPageUrl = FormsAuthentication.LoginUrl;
HttpContext.Current.Response.Redirect(String.Format(System.Threading.Thread.CurrentThread.CurrentCulture, "{0}?ReturnUrl={1}", loginPageUrl, currentUrl));
}
}
}
18 changes: 18 additions & 0 deletions MixERP.Net.BusinessLayer/BaseUserControlClass.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/********************************************************************************
Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
If a copy of the MPL was not distributed with this file, You can obtain one at
http://mozilla.org/MPL/2.0/.
***********************************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MixERP.Net.BusinessLayer
{
public class BaseUserControlClass : System.Web.UI.UserControl
{
}
}
39 changes: 39 additions & 0 deletions MixERP.Net.BusinessLayer/Core/Accounts.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/********************************************************************************
Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
If a copy of the MPL was not distributed with this file, You can obtain one at
http://mozilla.org/MPL/2.0/.
***********************************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MixERP.Net.BusinessLayer.Core
{
public static class Accounts
{
public static string GetDisplayField()
{
string displayField = MixERP.Net.Common.Helpers.ConfigurationHelper.GetSectionKey("MixERPDbParameters", "AccountDisplayField");
if(string.IsNullOrWhiteSpace(displayField))
{
displayField = "account_name";
}

return displayField;
}

public static bool IsCashAccount(int accountId)
{
return MixERP.Net.DatabaseLayer.Core.Accounts.IsCashAccount(accountId);
}

public static bool IsCashAccount(string accountCode)
{
return MixERP.Net.DatabaseLayer.Core.Accounts.IsCashAccount(accountCode);
}

}
}
30 changes: 30 additions & 0 deletions MixERP.Net.BusinessLayer/Core/Agents.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/********************************************************************************
Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
If a copy of the MPL was not distributed with this file, You can obtain one at
http://mozilla.org/MPL/2.0/.
***********************************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MixERP.Net.BusinessLayer.Core
{
public static class Agents
{
public static string GetDisplayField()
{
string displayField = MixERP.Net.Common.Helpers.ConfigurationHelper.GetSectionKey("MixERPDbParameters", "AgentDisplayField");

if(string.IsNullOrWhiteSpace(displayField))
{
displayField = "agent_name";
}

return displayField;
}

}
}
29 changes: 29 additions & 0 deletions MixERP.Net.BusinessLayer/Core/Customers.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/********************************************************************************
Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
If a copy of the MPL was not distributed with this file, You can obtain one at
http://mozilla.org/MPL/2.0/.
***********************************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MixERP.Net.BusinessLayer.Core
{
public static class Customers
{
public static string GetDisplayField()
{
string displayField = MixERP.Net.Common.Helpers.ConfigurationHelper.GetSectionKey("MixERPDbParameters", "CustomerDisplayField");

if(string.IsNullOrWhiteSpace(displayField))
{
displayField = "customer_name";
}

return displayField;
}
}
}
47 changes: 47 additions & 0 deletions MixERP.Net.BusinessLayer/Core/Items.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/********************************************************************************
Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
If a copy of the MPL was not distributed with this file, You can obtain one at
http://mozilla.org/MPL/2.0/.
***********************************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MixERP.Net.BusinessLayer.Core
{
public static class Items
{
public static bool ItemExistsByCode(string itemCode)
{
return MixERP.Net.DatabaseLayer.Core.Items.ItemExistsByCode(itemCode);
}

public static decimal GetItemSellingPrice(string itemCode, string partyCode, int priceTypeId, int unitId)
{
return MixERP.Net.DatabaseLayer.Core.Items.GetItemSellingPrice(itemCode, partyCode, priceTypeId, unitId);
}

public static decimal GetItemCostPrice(string itemCode, string partyCode, int unitId)
{
return MixERP.Net.DatabaseLayer.Core.Items.GetItemCostPrice(itemCode, partyCode, unitId);
}

public static decimal GetTaxRate(string itemCode)
{
return MixERP.Net.DatabaseLayer.Core.Items.GetTaxRate(itemCode);
}

public static decimal CountItemInStock(string itemCode, int unitId, int storeId)
{
return MixERP.Net.DatabaseLayer.Core.Items.CountItemInStock(itemCode, unitId, storeId);
}

public static bool IsStockItem(string itemCode)
{
return MixERP.Net.DatabaseLayer.Core.Items.IsStockItem(itemCode);
}
}
}
Loading

0 comments on commit f04a3ef

Please sign in to comment.