|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace ISCMS.Dialog
{
public partial class Rates : Hasan.FormCustom
{
int goods_ID;
Transaction transactionForm;
public Rates()
{
InitializeComponent();
}
public Rates(int goods_ID, Transaction transactionForm)
{
InitializeComponent();
this.goods_ID = goods_ID;
this.transactionForm = transactionForm;
}
private void Rates_Load(object sender, EventArgs e)
{
DataAccess.Access ac = new ISCMS.DataAccess.Access();
DataSet ds = ac.GetRates(goods_ID, transactionForm.Transaction_Type_ID, transactionForm.Transaction_Status_ID);
if( ds.Tables[0].Rows.Count == 0 )
{
Hasan.CMessageBoxSmall.ShowBox("Rates of goods are not available", (int)Hasan.CMessageBox.Type.Exclamation, Location.X, Location.Y);
this.Close();
return;
}
for( int i=0;i<ds.Tables[0].Rows.Count;i++)
{
listRate.Items.Add(string.Format("{0:c}",ds.Tables[0].Rows[i][0]));
}
}
private void listRate_SelectedValueChanged(object sender, EventArgs e)
{
//string.Format("{0:c}", Math.Round(txtCost.Text_AsDouble / Convert.ToInt32(txtQuantity.Text), 2)) + " per/" + lblUnit.Text;
this.transactionForm.lblPerUnitCost.Text = listRate.Text + " per/" + this.transactionForm.lblUnit.Text; ;
this.transactionForm.CalculateCost();
this.Close();
}
private void Cancel_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.