Skip to content

Commit

Permalink
Updates on ProductControl and ProductViewControl.
Browse files Browse the repository at this point in the history
  • Loading branch information
binodnp committed Sep 18, 2013
1 parent 44d3557 commit fe4b5b1
Show file tree
Hide file tree
Showing 21 changed files with 212 additions and 55 deletions.
22 changes: 22 additions & 0 deletions MixERP.Net.BusinessLayer/Helpers/DropDownListHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,27 @@ public static void BindDropDownList(ListControl list, DataTable table, string va
list.DataBind();
}

/// <summary>
/// Selects the item in the list control that contains the specified value, if it exists.
/// </summary>
/// <param name="dropDownList"></param>
/// <param name="selectedValue">The value of the item in the list control to select</param>
/// <returns>Returns true if the value exists in the list control, false otherwise</returns>
public static bool SetSelectedValue(DropDownList dropDownList, String selectedValue)
{
dropDownList.ClearSelection();

ListItem selectedListItem = dropDownList.Items.FindByValue(selectedValue);

if(selectedListItem != null)
{
selectedListItem.Selected = true;
return true;
}
else
{
return false;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static bool TransactionIdsBelongToSameParty(Collection<int> ids)

public static void MergeSalesQuotationToSalesOrder(Collection<int> ids)
{
MixERP.Net.Common.Models.Transactions.ProductModel model = new Common.Models.Transactions.ProductModel();
MixERP.Net.Common.Models.Transactions.MergeModel model = new Common.Models.Transactions.MergeModel();
Collection<MixERP.Net.Common.Models.Transactions.ProductDetailsModel> products = new Collection<Common.Models.Transactions.ProductDetailsModel>();

using(DataTable table = MixERP.Net.DatabaseLayer.Transactions.NonGLStockTransaction.GetSalesQuotationView(ids))
Expand All @@ -76,7 +76,7 @@ public static void MergeSalesQuotationToSalesOrder(Collection<int> ids)
}

model.ValueDate = MixERP.Net.Common.Conversion.TryCastDate(table.Rows[0]["value_date"]);
model.PartyId = MixERP.Net.Common.Conversion.TryCastInteger(table.Rows[0]["party_id"]);
model.PartyCode = MixERP.Net.Common.Conversion.TryCastString(table.Rows[0]["party_code"]);
model.PriceTypeId = MixERP.Net.Common.Conversion.TryCastInteger(table.Rows[0]["price_type_id"]);
model.ReferenceNumber = MixERP.Net.Common.Conversion.TryCastString(table.Rows[0]["reference_number"]);
model.StatementReference = MixERP.Net.Common.Conversion.TryCastString(table.Rows[0]["statement_reference"]);
Expand Down
4 changes: 4 additions & 0 deletions MixERP.Net.Common/MixERP.Net.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,14 @@
<Compile Include="Models\Transactions\ProductModel.cs" />
<Compile Include="Models\Transactions\StockMasterDetailModel.cs" />
<Compile Include="Models\Transactions\StockMasterModel.cs" />
<Compile Include="Models\Transactions\SubTranBook.cs" />
<Compile Include="Models\Transactions\TranactionMasterModel.cs" />
<Compile Include="Models\Transactions\TranBook.cs" />
<Compile Include="Models\Transactions\TransactionDetailModel.cs" />
<Compile Include="Models\Transactions\TransactionTypeDomain.cs" />
<Compile Include="Models\Transactions\TranType.cs" />
<Compile Include="Models\Transactions\VerificationDomain.cs" />
<Compile Include="Models\Transactions\VerificationType.cs" />
<Compile Include="PageUtility.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Models\Transactions\VerificationModel.cs" />
Expand Down
11 changes: 6 additions & 5 deletions MixERP.Net.Common/Models/Transactions/ProductModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,22 @@
http://mozilla.org/MPL/2.0/.
***********************************************************************************/
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;

namespace MixERP.Net.Common.Models.Transactions
{
public class ProductModel
public class MergeModel
{
public DateTime ValueDate { get; set; }
public int PartyId { get; set; }
public string PartyCode { get; set; }
public int PriceTypeId { get; set; }
public string ReferenceNumber { get; set; }
public int AgentId { get; set; }
public Collection<MixERP.Net.Common.Models.Transactions.ProductDetailsModel> View { get; set; }
public string StatementReference { get; set; }

public MixERP.Net.Common.Models.Transactions.TranBook Book { get; set; }
public MixERP.Net.Common.Models.Transactions.SubTranBook SubBook { get; set; }
public Collection<int> transactionIdCollection { get; set; }
}
}
24 changes: 24 additions & 0 deletions MixERP.Net.Common/Models/Transactions/SubTranBook.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/********************************************************************************
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.Common.Models.Transactions
{
public enum SubTranBook
{
Direct,
Quotation,
Order, /*Readonly*/
Delivery,/*Readonly*/
Receipt, /*Readonly*/
Invoice
}
}
20 changes: 20 additions & 0 deletions MixERP.Net.Common/Models/Transactions/TranBook.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/********************************************************************************
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.Common.Models.Transactions
{
public enum TranBook
{
Sales,
Purchase
}
}
20 changes: 20 additions & 0 deletions MixERP.Net.Common/Models/Transactions/TranType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/********************************************************************************
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.Common.Models.Transactions
{
public enum TransactionType
{
Debit,
Credit
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

namespace MixERP.Net.Common.Models.Transactions
{
public enum TransactionType { Debit, Credit }

public static class TransactionTypeDomain
{
public static string GetDomain(TransactionType type)
Expand Down
2 changes: 0 additions & 2 deletions MixERP.Net.Common/Models/Transactions/VerificationDomain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

namespace MixERP.Net.Common.Models.Transactions
{
public enum VerificationType { Rejected, Closed, Withdrawn, Unapproved, Approved }

public static class VerificationDomain
{
public static short GetVerification(VerificationType type)
Expand Down
23 changes: 23 additions & 0 deletions MixERP.Net.Common/Models/Transactions/VerificationType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/********************************************************************************
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.Common.Models.Transactions
{
public enum VerificationType
{
Rejected,
Closed,
Withdrawn,
Unapproved,
Approved
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ public static DataTable GetSalesQuotationView(Collection<int> ids)
string sql = @"SELECT
transactions.non_gl_stock_master.value_date,
transactions.non_gl_stock_master.party_id,
core.parties.party_code,
transactions.non_gl_stock_master.price_type_id,
transactions.non_gl_stock_master.reference_number,
core.items.item_code,
Expand All @@ -202,6 +203,8 @@ INNER JOIN core.items
ON transactions.non_gl_stock_details.item_id = core.items.item_id
INNER JOIN core.units
ON transactions.non_gl_stock_details.unit_id = core.units.unit_id
INNER JOIN core.parties
ON transactions.non_gl_stock_master.party_id = core.parties.party_id
WHERE transactions.non_gl_stock_master.non_gl_stock_master_id IN(" + string.Join(",", parameters) + ");";

//Create a PostgreSQL command object from the SQL string.
Expand Down
4 changes: 2 additions & 2 deletions MixERP.Net.FrontEnd/Purchase/DirectPurchase.aspx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ http://mozilla.org/MPL/2.0/.
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="BodyContentPlaceHolder" runat="server">
<mixerp:Product runat="server" ID="DirectPurchaseControl"
TransactionType="Purchase"
SubType="Direct"
Book="Purchase"
SubBook="Direct"
Text="<%$Resources:Titles, DirectPurchase %>"
DisplayTransactionTypeRadioButtonList="true"
ShowCashRepository="true"
Expand Down
11 changes: 6 additions & 5 deletions MixERP.Net.FrontEnd/Purchase/GRN.aspx
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,20 @@ This Source Code Form is subject to the terms of the Mozilla Public License, v.
If a copy of the MPL was not distributed with this file, You can obtain one at
http://mozilla.org/MPL/2.0/.
--%>

<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="GRN.aspx.cs" Inherits="MixERP.Net.FrontEnd.Purchase.GRN" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ScriptContentPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="StyleSheetContentPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="BodyContentPlaceHolder" runat="server">
<mixerp:Product runat="server"
<mixerp:Product runat="server"
ID="GoodReceiptNote"
TransactionType="Purchase"
SubType="Receipt"
Book="Purchase"
SubBook="Receipt"
Text="<%$Resources:Titles, GoodsReceiptNote %>"
DisplayTransactionTypeRadioButtonList="false"
/>
DisplayTransactionTypeRadioButtonList="false" />
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="BottomScriptContentPlaceHolder" runat="server">
</asp:Content>
4 changes: 2 additions & 2 deletions MixERP.Net.FrontEnd/Purchase/Order.aspx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ http://mozilla.org/MPL/2.0/.
<asp:Content ID="Content3" ContentPlaceHolderID="BodyContentPlaceHolder" runat="server">
<mixerp:Product runat="server"
ID="PurchaseOrder"
TransactionType="Purchase"
SubType="Order"
Book="Purchase"
SubBook="Order"
Text="<%$Resources:Titles, PurchaseOrder %>"
DisplayTransactionTypeRadioButtonList="false"
OnSaveButtonClick="PurchaseOrder_SaveButtonClick"
Expand Down
4 changes: 2 additions & 2 deletions MixERP.Net.FrontEnd/Sales/DeliveryWithoutOrder.aspx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ http://mozilla.org/MPL/2.0/.
<asp:Content ID="Content3" ContentPlaceHolderID="BodyContentPlaceHolder" runat="server">
<mixerp:Product runat="server"
ID="SalesDeliveryControl"
TransactionType="Sales"
SubType="Delivery"
Book="Sales"
SubBook="Delivery"
Text="<%$Resources:Titles, DeliveryWithoutSalesOrder %>"
DisplayTransactionTypeRadioButtonList="false"
ShowCashRepository="false"
Expand Down
4 changes: 2 additions & 2 deletions MixERP.Net.FrontEnd/Sales/DirectSales.aspx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ http://mozilla.org/MPL/2.0/.
<asp:Content ID="Content3" ContentPlaceHolderID="BodyContentPlaceHolder" runat="server">
<mixerp:Product runat="server"
ID="DirectSalesControl"
TransactionType="Sales"
SubType="Direct"
Book="Sales"
SubBook="Direct"
Text="<%$Resources:Titles, DirectSales %>"
DisplayTransactionTypeRadioButtonList="true"
ShowCashRepository="true"
Expand Down
4 changes: 2 additions & 2 deletions MixERP.Net.FrontEnd/Sales/Entry/Quotation.aspx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ http://mozilla.org/MPL/2.0/.
<asp:Content ID="Content3" ContentPlaceHolderID="BodyContentPlaceHolder" runat="server">
<mixerp:Product runat="server"
ID="SalesQuotation"
TransactionType="Sales"
SubType="Quotation"
Book="Sales"
SubBook="Quotation"
Text="<%$Resources:Titles, SalesQuotation %>"
DisplayTransactionTypeRadioButtonList="false"
OnSaveButtonClick="SalesQuotation_SaveButtonClick" />
Expand Down
4 changes: 2 additions & 2 deletions MixERP.Net.FrontEnd/Sales/Order.aspx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ http://mozilla.org/MPL/2.0/.
<asp:Content ID="Content3" ContentPlaceHolderID="BodyContentPlaceHolder" runat="server">
<mixerp:Product runat="server"
ID="SalesOrder"
TransactionType="Sales"
SubType="Order"
Book="Sales"
SubBook="Order"
Text="<%$Resources:Titles, SalesOrder %>"
DisplayTransactionTypeRadioButtonList="false"
OnSaveButtonClick="SalesOrder_SaveButtonClick"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,8 @@ http://mozilla.org/MPL/2.0/.
</td>
<td>
<asp:TextBox ID="QuantityTextBox"
runat="server" type="number"
runat="server" Text="1"
onblur="updateTax();calculateAmount();" CssClass="right"
Text="1"
ToolTip="Ctrl + Q" Width="42" />
</td>
<td>
Expand Down
Loading

0 comments on commit fe4b5b1

Please sign in to comment.