단가($) 작업
This commit is contained in:
@@ -183,6 +183,7 @@ namespace FEQ0000
|
||||
if (dr.IspumidxNull()) tbPumIDX.Text = "-1";
|
||||
else tbPumIDX.Text = dr.pumidx.ToString();
|
||||
tbPumPrice.Text = dr.pumprice.ToString();
|
||||
tbPumPriceD.Text = dr.pumpriceD.ToString();
|
||||
tbPumAmt.Text = dr.pumamt.ToString("N0"); //천단위 구분기호 추가 181222
|
||||
tbPumUnit.Text = dr.pumunit;
|
||||
|
||||
@@ -335,6 +336,7 @@ namespace FEQ0000
|
||||
this.tbPumIDX.Text = f.item.ToString();
|
||||
this.tbPumModel.Text = f.itemmodel;
|
||||
this.tbPumPrice.Text = f.itemprice.ToString();
|
||||
this.tbPumPriceD.Text = f.itempriceD.ToString();
|
||||
this.tbSID.Text = f.SID;
|
||||
this.tbSID.Tag = f.SID;
|
||||
this.tbPumUnit.Text = f.itemUnit; //181214
|
||||
@@ -449,7 +451,7 @@ namespace FEQ0000
|
||||
tbPumQty.Focus();
|
||||
return false;
|
||||
}
|
||||
if (advInput == true )
|
||||
if (advInput == true)
|
||||
{
|
||||
if (tbProject.Text == "")
|
||||
{
|
||||
@@ -459,7 +461,7 @@ namespace FEQ0000
|
||||
else
|
||||
{
|
||||
//프로젝트에 뭔가를 입력했다
|
||||
if(tbProjectIndex.Text == "-1")
|
||||
if (tbProjectIndex.Text == "-1")
|
||||
{
|
||||
FCOMMON.Util.MsgE("프로젝트가 선택되지 않았습니다. 직접입력은 허용되지 않습니다.\n" +
|
||||
"프로젝트 명을 입력하고 Enter 키를 눌러서 관련 프로젝트를 선택하세요\n" +
|
||||
@@ -469,7 +471,7 @@ namespace FEQ0000
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
var overtime = DateTime.Now - DateTime.Parse("2019-01-09 00:00:00");
|
||||
@@ -596,10 +598,26 @@ namespace FEQ0000
|
||||
|
||||
}
|
||||
|
||||
//단가가없는경우 생성한다.
|
||||
if(decimal.TryParse(tbPumPrice.Text,out decimal vprice)==false)
|
||||
{
|
||||
if(decimal.TryParse(tbPumPriceD.Text,out decimal vpriced)==true)
|
||||
{
|
||||
applyDollerToWon();
|
||||
}
|
||||
}
|
||||
|
||||
if (tbPumQty.Text.isEmpty()) tbPumQty.Text = "0";
|
||||
if (tbPumPrice.Text.isEmpty()) tbPumPrice.Text = "0";
|
||||
dr.pumqty = int.Parse(tbPumQty.Text);
|
||||
dr.pumprice = decimal.Parse(tbPumPrice.Text);
|
||||
|
||||
if (decimal.TryParse(tbPumPriceD.Text, out decimal priced))
|
||||
{
|
||||
dr.pumpriceD = priced;
|
||||
}
|
||||
else dr.SetpumpriceDNull();
|
||||
|
||||
dr.pumamt = dr.pumqty * dr.pumprice;
|
||||
if (tbPumIDX.Text == "" || tbPumIDX.Text == "-1") dr.SetpumidxNull();
|
||||
else dr.pumidx = int.Parse(tbPumIDX.Text);
|
||||
@@ -913,5 +931,32 @@ namespace FEQ0000
|
||||
string path = "\\\\k4fs3201n\\ee1t$\\1. 장비기술1파트\\24_Project & Overhaul 예산 사용 실적\\구매 견적서\\" + DateTime.Now.Year.ToString("0000") + "년";
|
||||
FCOMMON.Util.RunExplorer(path);
|
||||
}
|
||||
|
||||
private void textBox1_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
//단가에 금액이 없는경우에는 환율을 곱해준다.
|
||||
//if ( decimal.TryParse(tbPumPrice.Text, out decimal result) == false || result == 0)
|
||||
{
|
||||
if (decimal.TryParse(tbPumPriceD.Text, out decimal priced) == true)
|
||||
{
|
||||
applyDollerToWon();
|
||||
}
|
||||
else
|
||||
{
|
||||
//달러입력값도 이상하니 처리 못함
|
||||
tbPumPrice.Text = "0";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
void applyDollerToWon()
|
||||
{
|
||||
if (decimal.TryParse(tbPumPriceD.Text, out decimal priced))
|
||||
{
|
||||
var price = FCOMMON.info.dollertowon * (double)priced;
|
||||
tbPumPrice.Text = (Math.Ceiling(price)).ToString();
|
||||
}
|
||||
else tbPumPrice.Text = "0";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user