.net Html, GridView jquery이용하여 추가 삭제 구현
요즘에는 jquery grid와 같은 무료 그리드 또는 기능이 막강하고 저렴한 유료 그리드들이 많아 이런것들을 많이 사용하고 있지요. 하지만, 예전에는 이런것들이 없어서 수동으로 다~ 그려줘야만 했습니다.
동그라미1번의 html 부분
먼저 aspx소스 입니다.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CTCD_Write.aspx.cs" Inherits="ssCRM_UI.Pages__C004.CT.CTCD_Write" MasterPageFile="~/Common/BaseTemplate.Master" ValidateRequest="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPage" runat="server">
<script type="text/javascript">
$(window).load(function () {
// 오늘작업계획
var parsedDivTodayWorkPlan = $.parseJSON($("#<%= this.hdnDivTodayWorkPlan.ClientID%>").val());
if (parsedDivTodayWorkPlan != null) {
$.each(parsedDivTodayWorkPlan, function (i, jsonData) {
if (i == 0)
$("#FLD_TODAYWORKPLAN_1").val(jsonData.TodayWorkPlan);
else
todayWorkPlanControlAdd("FLD_TODAYWORKPLAN_", (i + 1), jsonData.TodayWorkPlan);
});
}
// 오늘작업실적
var parsedDivTodayWorkResult = $.parseJSON($("#<%= this.hdnDivTodayWorkResult.ClientID%>").val());
if (parsedDivTodayWorkResult != null) {
$.each(parsedDivTodayWorkResult, function (i, jsonData) {
if (i == 0)
$("#FLD_TODAYWORKRESULT_1").val(jsonData.TodayWorkResult);
else
todayWorkResultControlAdd("FLD_TODAYWORKRESULT_", (i + 1), jsonData.TodayWorkResult);
});
}
});
// 저장
function fnSave() {
// 필수 항목 점검 및 저장 여부 확인 ==> 기존정보
if (Page_ClientValidate() && chkSave()) {
}
else {
return false;
}
//////////////////////////////////////////////////////////////////////////////
// 공사, 일자 중복 체크 (2016-05-30)
//////////////////////////////////////////////////////////////////////////////
var dupCheck = true;
var dupMsg = "";
var constructDailykeyId = $('#<%=hdnCONSTRUCTDAILYID.ClientID %>').val()
constructDailykeyId = parseInt(constructDailykeyId);
if (constructDailykeyId <= 0) {
var constructID = $('#<%=FLD_CONSTRUCTID.ClientID %>').val();
var constructDailyDate = $('#<%=FLD_CONSTRUCTDAILYDATE.ClientID %>').val();
var sessionUserId = "<%=this.sessionUserId%>";
var items = [
{ CONSTRUCTID: constructID, CONSTRUCTDAILYDATE: constructDailyDate, SESSIONUSERID: sessionUserId }
];
var options = {
type: "POST",
url: window.location.pathname + "/GetConstructDailyDup",
data: "{'items':" + JSON.stringify(items) + "}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: false,
success: function (response) {
var parsed = $.parseJSON(response.d);
if (parsed != null) {
$.each(parsed, function (i, jsonData) {
if (jsonData.DUP == "N") {
dupMsg = "동일한 공사일보 정보가 있습니다.";
dupCheck = false;
}
});
}
},
error: function (msg) {
dupMsg = msg.d;
dupCheck = false;
},
complete: function (data) {
}
};
jQuery.ajax(options);
}
if (dupMsg != "" && !dupCheck) {
alert(dupMsg);
return false;
}
//////////////////////////////////////////////////////////////////////////////
// 자재 투입 계획
//////////////////////////////////////////////////////////////////////////////
var myObject_Material = new Array();
var list_Material = $('#<%=gvListMaterial.ClientID %>').find("tr");
for (var i = 0; i < list_Material.length; i++) {
var statusGubun = $(list_Material[i]).find("#STATUS_GUBUN").val();
var inputResourceID = $(list_Material[i]).find("#INPUTRESOURCEID").val();
if(inputResourceID != "" && inputResourceID != undefined){
var arr2 = new Object();
$(list_Material[i]).find("input").each(function () {
var id = $(this).attr("id");
if (id != null && id != "") {
arr2[id] = $(this).val();
}
});
myObject_Material.push(arr2);
}
}
var data_Material = JSON.stringify(myObject_Material);
$("#<%= this.hdnMATERIALResultData.ClientID%>").val(data_Material);
//////////////////////////////////////////////////////////////////////////////
// 장비 투입 계획
//////////////////////////////////////////////////////////////////////////////
var myObject_Equipment = new Array();
var list_Equipment = $('#<%=gvListEquipment.ClientID %>').find("tr");
for (var i = 0; i < list_Equipment.length; i++) {
var statusGubun = $(list_Equipment[i]).find("#STATUS_GUBUN").val();
var inputResourceID = $(list_Equipment[i]).find("#INPUTRESOURCEID").val();
if (inputResourceID != "" && inputResourceID != undefined) {
var arr2 = new Object();
$(list_Equipment[i]).find("input").each(function () {
var id = $(this).attr("id");
if (id != null && id != "") {
arr2[id] = $(this).val();
}
});
myObject_Equipment.push(arr2);
}
}
var data_Equipment = JSON.stringify(myObject_Equipment);
$("#<%= this.hdnEQUIPMENTResultData.ClientID%>").val(data_Equipment);
//////////////////////////////////////////////////////////////////////////////
// 노무비 투입 계획
//////////////////////////////////////////////////////////////////////////////
var myObject_WorkerCost = new Array();
var list_WorkerCost = $('#<%=gvListWorkerCost.ClientID %>').find("tr");
for (var i = 0; i < list_WorkerCost.length; i++) {
var statusGubun = $(list_WorkerCost[i]).find("#STATUS_GUBUN").val();
var workerID = $(list_WorkerCost[i]).find("#WORKERID").val();
if (workerID != "" && workerID != undefined) {
var arr2 = new Object();
$(list_WorkerCost[i]).find("input").each(function () {
var id = $(this).attr("id");
if (id != null && id != "") {
arr2[id] = $(this).val();
}
});
myObject_WorkerCost.push(arr2);
}
}
var data_WorkerCost = JSON.stringify(myObject_WorkerCost);
$("#<%= this.hdnWORKERCOSTResultData.ClientID%>").val(data_WorkerCost);
//////////////////////////////////////////////////////////////////////////////
// 간접경비 투입 계획
//////////////////////////////////////////////////////////////////////////////
var myObject_IndirectExpense = new Array();
var list_IndirectExpense = $('#<%=gvListIndirectExpense.ClientID %>').find("tr");
for (var i = 0; i < list_IndirectExpense.length; i++) {
var statusGubun = $(list_IndirectExpense[i]).find("#STATUS_GUBUN").val();
var inputResourceID = $(list_IndirectExpense[i]).find("#INPUTRESOURCEID").val();
if (inputResourceID != "" && inputResourceID != undefined) {
var arr2 = new Object();
$(list_IndirectExpense[i]).find("input").each(function () {
var id = $(this).attr("id");
if (id != null && id != "") {
arr2[id] = $(this).val();
}
});
myObject_IndirectExpense.push(arr2);
}
}
var data_IndirectExpense = JSON.stringify(myObject_IndirectExpense);
$("#<%= this.hdnINDIRECTEXPENSEResultData.ClientID%>").val(data_IndirectExpense);
//////////////////////////////////////////////////////////////////////////////
// 외주비 투입 계획
//////////////////////////////////////////////////////////////////////////////
var myObject_OutsideOrderExpense = new Array();
var list_OutsideOrderExpense = $('#<%=gvListOutsideOrderExpense.ClientID %>').find("tr");
for (var i = 0; i < list_OutsideOrderExpense.length; i++) {
var statusGubun = $(list_OutsideOrderExpense[i]).find("#STATUS_GUBUN").val();
var inputResourceID = $(list_OutsideOrderExpense[i]).find("#INPUTRESOURCEID").val();
if (inputResourceID != "" && inputResourceID != undefined) {
var arr2 = new Object();
$(list_OutsideOrderExpense[i]).find("input").each(function () {
var id = $(this).attr("id");
if (id != null && id != "") {
arr2[id] = $(this).val();
}
});
myObject_OutsideOrderExpense.push(arr2);
}
}
var data_OutsideOrderExpense = JSON.stringify(myObject_OutsideOrderExpense);
$("#<%= this.hdnOUTSIDEORDEREXPENSEResultData.ClientID%>").val(data_OutsideOrderExpense);
//////////////////////////////////////////////////////////////////////////////
// 오늘작업계획
//////////////////////////////////////////////////////////////////////////////
var myObject_DivTodayWorkPlan = "";
$("#DIV_TODAYWORKPLAN").find("input").each(function () {
if ($(this).val().trim() != "") {
myObject_DivTodayWorkPlan += $(this).val() + "^*|*^";
}
});
$("#<%= this.hdnDivTodayWorkPlan.ClientID%>").val(myObject_DivTodayWorkPlan);
//////////////////////////////////////////////////////////////////////////////
// 오늘작업식적
//////////////////////////////////////////////////////////////////////////////
var myObject_DivTodayWorkResult = "";
$("#DIV_TODAYWORKRESULT").find("input").each(function () {
if ($(this).val().trim() != "") {
myObject_DivTodayWorkResult += $(this).val() + "^*|*^";
}
});
$("#<%= this.hdnDivTodayWorkResult.ClientID%>").val(myObject_DivTodayWorkResult);
// 등록할 내용 있는지 없는지 체크
//if (
//$("#<%= this.hdnMATERIALResultData.ClientID%>").val() == "[]" &&
//$("#<%= this.hdnEQUIPMENTResultData.ClientID%>").val() == "[]" &&
//$("#<%= this.hdnWORKERCOSTResultData.ClientID%>").val() == "[]" &&
//$("#<%= this.hdnINDIRECTEXPENSEResultData.ClientID%>").val() == "[]" &&
//$("#<%= this.hdnOUTSIDEORDEREXPENSEResultData.ClientID%>").val() == "[]") {
//alert("등록할 내용이 없습니다.");
//return false;
//}
}
//////////////////////////////////////////////////////////////////////////////
// 공사 팝업
//////////////////////////////////////////////////////////////////////////////
function fnConstructSearchPopup() {
fnOpenPopup('popConstruct', 'CTCT_Po_Search.aspx', 800, 600);
}
function callBackFN_Constract(ConstructID, ConstructName, ConstructAmountID, ConstructAmount, ChangeConstructAmount, SiteDateBegin, SUMAMOUNTTOTAL_) {
$("#<%= this.FLD_CONSTRUCTNAME.ClientID%>").val(ConstructName); // 공사명
$("#<%= this.FLD_CONSTRUCTID.ClientID%>").val(ConstructID); // 공사ID
$("#<%= this.FLD_CONSTRUCTAMOUNTID.ClientID%>").val(fnGetNumberWithComma(ConstructAmountID, "C")); // 공사 금액 총계 일련번호
$("#<%= this.FLD_CONSTRUCTAMOUNT.ClientID%>").val(fnGetNumberWithComma(ConstructAmount, "C")); // 계약금액
$("#<%= this.FLD_CHANGECONSTRUCTAMOUNT.ClientID%>").val(fnGetNumberWithComma(ChangeConstructAmount, "C")); // 변경금액
$("#<%= this.FLD_SUMAMOUNTTOTAL.ClientID%>").val(fnGetNumberWithComma(SUMAMOUNTTOTAL_, "C")); // 누계총투입금액
$("#<%= this.hdnSumAmountTotal.ClientID%>").val(SUMAMOUNTTOTAL_); // 누계총투입금액
}
//////////////////////////////////////////////////////////////////////////////
// 그리드 관련 팝업
//////////////////////////////////////////////////////////////////////////////
var returnGrid;
var retuenInputResourceName;
var retuenInputResourceID;
var retuenSpecification;
var retuenUnit;
var retuenVolume;
var retuenSum_Volume;
var retuenSum_Volume_;
var retuenSum_Price;
var retuenSum_Price_;
var retuenWorkerName;
var retuenWorkerID;
var retuenResident;
var retuenUnitPrice;
var retuenWorkDay;
var retuenPrice;
var retuenSum_WorkDay;
var retuenSum_WorkDay_;
function fnSearchPopup(object, type, strGrid_Gubun) {
// 누계 수량, 금액 데이터를 가져오기 위해서 기본정보 섹션의 공사명(공사ID)을 먼저 선택 해야함.
var popConstructID = $("#<%= this.FLD_CONSTRUCTID.ClientID%>").val();
if(popConstructID == "") {
alert("공사를 선택하세요!");
return false;
}
var gubun = "";
if (strGrid_Gubun == "gvListMaterial"){
gubun = 10;
returnGrid = $("#<%=gvListMaterial.ClientID %>");
}
else if (strGrid_Gubun == "gvListEquipment"){
gubun = 20;
returnGrid = $("#<%=gvListEquipment.ClientID %>");
}
else if (strGrid_Gubun == "gvListWorkerCost"){
returnGrid = $("#<%=gvListWorkerCost.ClientID %>");
}
else if (strGrid_Gubun == "gvListIndirectExpense"){
gubun = 30;
returnGrid = $("#<%=gvListIndirectExpense.ClientID %>");
}
else if (strGrid_Gubun == "gvListOutsideOrderExpense"){
gubun = 40;
returnGrid = $("#<%=gvListOutsideOrderExpense.ClientID %>");
}
var tr = object.parentNode.parentNode;
// 노무비 투입 계획 그리드 팝업 관련
if (strGrid_Gubun == "gvListWorkerCost") {
retuenWorkerName = $(tr).find("#WORKERNAME");
retuenWorkerID = $(tr).find("#WORKERID");
retuenResident = $(tr).find("#RESIDENT");
retuenUnitPrice = $(tr).find("#UNITPRICE");
retuenWorkDay = $(tr).find("#WORKDAY");
retuenPrice = $(tr).find("#PRICE");
retuenSum_WorkDay = $(tr).find("#SUM_WORKDAY");
retuenSum_WorkDay_ = $(tr).find("#SUM_WORKDAY_");
retuenSum_Price = $(tr).find("#SUM_PRICE");
retuenSum_Price_ = $(tr).find("#SUM_PRICE_");
var statusGubun = $(tr).find("#STATUS_GUBUN").val();
if (statusGubun != "I")
$(tr).find("#STATUS_GUBUN").val("U");
if (type == "1") {
var returnValue = fnOpenPopup('popWorker', 'CTWK_Po_Search.aspx?gubun=' + gubun, 800, 600);
}
else if (type == "2") {
// 모든 데이터를 제거하기 위해서 주석 후 수정
//$(retuenWorkerName).val(""); // 근로자(이름)명
//$(retuenWorkerID).val(""); // 근로자id
//$(retuenResident).val(""); // 주민등록번호
$(tr).find("input, select").each(function () {
if ($(this).attr("id").indexOf("ddlWORKDAY") >= 0) {
$(this).val("0");
}
else {
$(this).val("");
}
});
fnAutoTotal(null, strGrid_Gubun); // 합계 셋팅
retuenWorkerName = null;
retuenWorkerID = null;
retuenResident = null;
retuenUnitPrice = null;
}
}
// 노무비 투입 계획 그리드 외 팝업 관련
else {
retuenInputResourceName = $(tr).find("#INPUTRESOURCENAME");
retuenInputResourceID = $(tr).find("#INPUTRESOURCEID");
retuenSpecification = $(tr).find("#SPECIFICATION");
retuenUnit = $(tr).find("#UNIT");
retuenVolume = $(tr).find("#VOLUME");
retuenPrice = $(tr).find("#PRICE");
retuenSum_Volume = $(tr).find("#SUM_VOLUME");
retuenSum_Volume_ = $(tr).find("#SUM_VOLUME_");
retuenSum_Price = $(tr).find("#SUM_PRICE");
retuenSum_Price_ = $(tr).find("#SUM_PRICE_");
var statusGubun = $(tr).find("#STATUS_GUBUN").val();
if (statusGubun != "I")
$(tr).find("#STATUS_GUBUN").val("U");
if (type == "1") {
var returnValue = fnOpenPopup('popInputResource', 'CTIR_Po_Search.aspx?gubun=' + gubun, 800, 600);
}
else if (type == "2") {
// 모든 데이터를 제거하기 위해서 주석 후 수정
//$(retuenInputResourceName).val(""); // 자재명
//$(retuenInputResourceID).val(""); // 자재id
//$(retuenSpecification).val(""); // 규격
//$(retuenUnit).val(""); // 단위
$(tr).find("input").each(function () {
$(this).val("");
});
fnAutoTotal(null, strGrid_Gubun); // 합계 셋팅
retuenInputResourceName = null;
retuenInputResourceID = null;
retuenSpecification = null;
retuenUnit = null;
}
}
}
function callBackFN(InputResourceID, InputResourceName, Specification, Unit, InputResourceType) {
// 중복체크
var chk = true;
/* 자원 중복체크 해제 요청으로 주석 처리 (2016-06-17)
$(returnGrid).find("tr").each(function () {
$(this).find("#INPUTRESOURCEID").each(function () {
if(InputResourceID == $(this).val()){
alert("중복 투입자원 입니다.");
chk = false;
return false;
}
});
if(!chk)
return false;
});
*/
if(chk){
$(retuenInputResourceID).val(InputResourceID);
$(retuenInputResourceName).val(InputResourceName);
$(retuenSpecification).val(Specification);
$(retuenUnit).val(Unit);
fnSumVolumePrice(InputResourceID, InputResourceType, returnGrid);
}
}
function callBackFN_WorkerCost(WorkerID, WorkerName, Resident, WorkerCost) {
// 중복체크
var chk = true;
/* 자원 중복체크 해제 요청으로 주석 처리 (2016-06-17)
$(returnGrid).find("tr").each(function () {
$(this).find("#WORKERID").each(function () {
if(WorkerID == $(this).val()){
alert("중복 투입자원 입니다.");
chk = false;
return false;
}
});
});
*/
if(chk){
$(retuenWorkerID).val(WorkerID);
$(retuenWorkerName).val(WorkerName);
$(retuenResident).val(Resident);
$(retuenUnitPrice).val(fnGetNumberWithComma(WorkerCost, "C"));
$(retuenUnitPrice).trigger('blur');
fnSumVolumePrice(WorkerID, "worker", returnGrid);
}
}
function fnSumVolumePrice(id, type, gridGubun) {
var strGrid_Gubun = "";
// 누계 수량, 금액 데이터를 가져오기 위해서 기본정보 섹션의 공사명(공사ID)을 먼저 선택 해야함.
var popConstructID = $("#<%= this.FLD_CONSTRUCTID.ClientID%>").val();
// 투입자원이 공통 일경우
if ($(gridGubun).attr("id").indexOf("_gvListMaterial") > 0 && type == "50")
type = 10;
else if ($(gridGubun).attr("id").indexOf("_gvListEquipment") > 0 && type == "50")
type = 20;
else if ($(gridGubun).attr("id").indexOf("_gvListIndirectExpense") > 0 && type == "50")
type = 30;
else if ($(gridGubun).attr("id").indexOf("_gvListOutsideOrderExpense") > 0 && type == "50")
type = 40;
var items = [
// { InputResourceID: "1", InputResourceType: "531", ConstructID: "531" },
{ INPUTRESOURCEID: id, INPUTRESOURCETYPE: type, CONSTRUCTID: popConstructID }
];
var options = {
type: "POST",
url: window.location.pathname + "/GetSum_Volume_Price",
data: "{'items':" + JSON.stringify(items) + "}", // array to string fixes it *
contentType: "application/json; charset=utf-8",
dataType: "json",
async: false,
success: function (response) {
var parsed = $.parseJSON(response.d);
if (parsed != null) {
$.each(parsed, function (i, jsonData) {
if (type == "worker") {
var sumVolume = jsonData.SUM_VOLUME;
if (sumVolume == null || sumVolume == "")
sumVolume = 0;
else
sumVolume = parseFloat(sumVolume.replace(/,/g, ''));
var controlVolume = $(retuenWorkDay).val();
if (controlVolume == null || controlVolume == "")
controlVolume = 0;
else
controlVolume = parseFloat(controlVolume.replace(/,/g, ''));
$(retuenSum_WorkDay).val(fnGetNumberWithComma(sumVolume + controlVolume, "d"));
$(retuenSum_WorkDay_).val(jsonData.SUM_VOLUME);
}
else {
var sumVolume = jsonData.SUM_VOLUME;
if (sumVolume == null || sumVolume == "")
sumVolume = 0;
else
sumVolume = parseFloat(sumVolume.replace(/,/g, ''));
var controlVolume = $(retuenVolume).val();
if (controlVolume == null || controlVolume == "")
controlVolume = 0;
else
controlVolume = parseFloat(controlVolume.replace(/,/g, ''));
$(retuenSum_Volume).val(fnGetNumberWithComma(sumVolume + controlVolume, "d"));
$(retuenSum_Volume_).val(jsonData.SUM_VOLUME);
}
var sumPrice = jsonData.SUM_PRICE;
if (sumPrice == null || sumPrice == "")
sumPrice = 0;
else
sumPrice = parseInt(sumPrice.replace(/,/g, ''));
var controlPrice = $(retuenPrice).val();
if (controlPrice == null || controlPrice == "")
controlPrice = 0;
else
controlPrice = parseInt(controlPrice.replace(/,/g, ''));
$(retuenSum_Price).val(fnGetNumberWithComma(sumPrice + controlPrice, "C"));
$(retuenSum_Price_).val(jsonData.SUM_PRICE);
});
// 누계투입금액 합계
fnAutoTotal_SUM(null, returnGrid);
}
},
error: function (msg) { alert(msg.d); },
complete: function (data) {
returnGrid = null;
retuenInputResourceID = null;
retuenInputResourceName = null;
retuenSpecification = null;
retuenUnit = null;
retuenVolume = null;
retuenWorkerID = null;
retuenWorkerName = null;
retuenResident = null;
retuenUnitPrice = null;
retuenWorkDay = null;
retuenSum_Volume = null;
retuenSum_Volume_ = null;
retuenSum_Price = null;
retuenSum_Price_ = null;
retuenSum_WorkDay = null;
retuenSum_WorkDay_ = null;
}
};
jQuery.ajax(options);
}
//////////////////////////////////////////////////////////////////////////////
// 그리드 자동계산 관련
//////////////////////////////////////////////////////////////////////////////
function fnAutoTotal(object, strGrid_Gubun) {
// 단가, 수량 같은 입력 값이 0 일때 0을 지우고 입력해야하는 불편함을 없애기 위한 함수 (2016-05-30)
if ($(object).val() == "")
$(object).val("0");
var gridName = "";
if (strGrid_Gubun == "gvListMaterial")
gridName = "<%=gvListMaterial.ClientID %>";
else if (strGrid_Gubun == "gvListEquipment")
gridName = "<%=gvListEquipment.ClientID %>";
else if (strGrid_Gubun == "gvListWorkerCost")
gridName = "<%=gvListWorkerCost.ClientID %>";
else if (strGrid_Gubun == "gvListIndirectExpense")
gridName = "<%=gvListIndirectExpense.ClientID %>";
else if (strGrid_Gubun == "gvListOutsideOrderExpense")
gridName = "<%=gvListOutsideOrderExpense.ClientID %>";
// 노무비 투입 계획 그리드 팝업 관련
if (strGrid_Gubun == "gvListWorkerCost") {
var UnitPrice = 0;
var WorkDay = 0;
var TotalPrice = 0;
if (object != null && object != "") {
var row = object.parentNode.parentNode;
// 해당 Row의 단가, 수량 추출 후 금액 셋팅
$(row).find("input").each(function () {
var id = $(this).attr("id");
// 단가 추출
if (id == "UNITPRICE" && $(this).val() != "")
UnitPrice = $(this).val().replace(/,/g, '');
// 수량 추출
if (id == "WORKDAY" && $(this).val() != "")
WorkDay = $(this).val().replace(/,/g, '');
// 금액 셋팅
if (id == "PRICE") {
// $(this).val(UnitPrice * Volume);
$(this).val(fnGetNumberWithComma(UnitPrice * WorkDay, "d"));
}
// 누계투입일수 셋팅
if (id == "SUM_WORKDAY") {
// 누계투입일수 합계를 계산하기 위한 초기 누계투입일수
var firstSumWorkDay = parseFloat($(row).find("#SUM_WORKDAY_").val().replace(/,/g, ''));
// 투입일수
var workDay = 0.0;
$(row).find("select").each(function () {
var id = $(this).attr("id");
if (id.indexOf("ddlWORKDAY") > -1) {
workDay = parseFloat($(this).val().replace(/,/g, ''));
}
});
$(this).val(fnGetNumberWithComma(firstSumWorkDay + workDay, "C"));
}
// 누계금액 셋팅
if (id == "SUM_PRICE") {
// 누계금액 합계를 계산하기 위한 초기 누계금액
var firstSumPrice = parseInt($(row).find("#SUM_PRICE_").val().replace(/,/g, ''));
// 금액
var price = parseInt($(row).find("#PRICE").val().replace(/,/g, ''));
$(this).val(fnGetNumberWithComma(firstSumPrice + price, "C"));
}
});
}
// 그리드의 모든 단가, 수량 추출
$('#' + gridName).find("input").each(function () {
var id = $(this).attr("id");
if (id == "PRICE" && $(this).val() != "")
TotalPrice += parseFloat($(this).val().replace(/,/g, ''));
});
// 합계 셋팅
$('#' + gridName).find("span").each(function () {
var id = $(this).attr("id");
if (id.indexOf("_lblTotalPRICE") > 0)
$(this).text(fnGetNumberWithComma(TotalPrice, "d"));
});
}
// 간접경비 단가, 수량 누계수량이 제거 되면서 추가 (2016-06-15)
else if (strGrid_Gubun == "gvListIndirectExpense") {
var TotalPrice = 0;
if (object != null && object != "") {
var row = object.parentNode.parentNode;
// 해당 Row의 단가, 수량 추출 후 금액 셋팅
$(row).find("input").each(function () {
var id = $(this).attr("id");
// 누계금액 셋팅
if (id == "SUM_PRICE") {
// 누계금액 합계를 계산하기 위한 초기 누계금액
var firstSumPrice = parseInt($(row).find("#SUM_PRICE_").val().replace(/,/g, ''));
// 금액
var price = parseInt($(row).find("#PRICE").val().replace(/,/g, ''));
$(this).val(fnGetNumberWithComma(firstSumPrice + price, "C"));
}
});
}
// 그리드의 모든 단가, 수량 추출
$('#' + gridName).find("input").each(function () {
var id = $(this).attr("id");
if (id == "PRICE" && $(this).val() != "")
TotalPrice += parseInt($(this).val().replace(/,/g, ''));
});
// 합계 셋팅
$('#' + gridName).find("span").each(function () {
var id = $(this).attr("id");
if (id.indexOf("_lblTotalPRICE") > 0)
$(this).text(fnGetNumberWithComma(TotalPrice, "C"));
});
}
// 노무비 투입 계획 그리드 외 팝업 관련
else {
var UnitPrice = 0;
var Volume = 0;
var TotalPrice = 0;
if (object != null && object != "") {
var row = object.parentNode.parentNode;
// 해당 Row의 단가, 수량 추출 후 금액 셋팅
$(row).find("input").each(function () {
var id = $(this).attr("id");
// 단가 추출
if (id == "UNITPRICE" && $(this).val() != "")
UnitPrice = $(this).val().replace(/,/g, '');
// 수량 추출
if (id == "VOLUME" && $(this).val() != "")
Volume = $(this).val().replace(/,/g, '');
// 금액 셋팅
if (id == "PRICE") {
// $(this).val(UnitPrice * Volume);
$(this).val(fnGetNumberWithComma(UnitPrice * Volume, "C"));
}
// 누계수량 셋팅
if (id == "SUM_VOLUME") {
// 누계수량 합계를 계산하기 위한 초기 누계수량
var firstSumVolume = parseInt($(row).find("#SUM_VOLUME_").val().replace(/,/g, ''));
// 수량
var volume = parseInt($(row).find("#VOLUME").val().replace(/,/g, ''));
$(this).val(fnGetNumberWithComma(firstSumVolume + volume, "C"));
}
// 누계금액 셋팅
if (id == "SUM_PRICE") {
// 누계금액 합계를 계산하기 위한 초기 누계금액
var firstSumPrice = parseInt($(row).find("#SUM_PRICE_").val().replace(/,/g, ''));
// 금액
var price = parseInt($(row).find("#PRICE").val().replace(/,/g, ''));
$(this).val(fnGetNumberWithComma(firstSumPrice + price, "C"));
}
});
}
// 그리드의 모든 단가, 수량 추출
$('#' + gridName).find("input").each(function () {
var id = $(this).attr("id");
if (id == "PRICE" && $(this).val() != "")
TotalPrice += parseInt($(this).val().replace(/,/g, ''));
});
// 합계 셋팅
$('#' + gridName).find("span").each(function () {
var id = $(this).attr("id");
if (id.indexOf("_lblTotalPRICE") > 0)
$(this).text(fnGetNumberWithComma(TotalPrice, "C"));
});
}
// 해당 그리드의 누계금액 합계 셋팅
fnAutoTotal_SUM(null, $('#' + gridName));
// 총계 섹션의 "계획금액 합계" 자동계산 함수 호출
fnAutoPlanTotal();
}
//////////////////////////////////////////////////////////////////////////////
// 총계 섹션의 "금일총투입금액" 자동계산
//////////////////////////////////////////////////////////////////////////////
function fnAutoPlanTotal() {
var planTotalPrice = 0;
var tr_Material = $('#<%=gvListMaterial.ClientID %>').find('tr:last').clone();
var tr_Equipment = $('#<%=gvListEquipment.ClientID %>').find('tr:last').clone();
var tr_WorkerCost = $('#<%=gvListWorkerCost.ClientID %>').find('tr:last').clone();
var tr_IndirectExpense = $('#<%=gvListIndirectExpense.ClientID %>').find('tr:last').clone();
var tr_OutsideOrderExpense = $('#<%=gvListOutsideOrderExpense.ClientID %>').find('tr:last').clone();
// 자재
$(tr_Material).find("span").each(function () {
var id = $(this).attr("id");
if (id.indexOf("_lblTotalPRICE") > 0)
planTotalPrice += parseInt($(this).text().replace(/,/g, ''));
});
//장비
$(tr_Equipment).find("span").each(function () {
var id = $(this).attr("id");
if (id.indexOf("_lblTotalPRICE") > 0)
planTotalPrice += parseInt($(this).text().replace(/,/g, ''));
});
//노무비
$(tr_WorkerCost).find("span").each(function () {
var id = $(this).attr("id");
if (id.indexOf("_lblTotalPRICE") > 0)
planTotalPrice += parseInt($(this).text().replace(/,/g, ''));
});
//간접경비
$(tr_IndirectExpense).find("span").each(function () {
var id = $(this).attr("id");
if (id.indexOf("_lblTotalPRICE") > 0)
planTotalPrice += parseInt($(this).text().replace(/,/g, ''));
});
//외주비
$(tr_OutsideOrderExpense).find("span").each(function () {
var id = $(this).attr("id");
if (id.indexOf("_lblTotalPRICE") > 0)
planTotalPrice += parseInt($(this).text().replace(/,/g, ''));
});
$("#<%=FLD_PLANAMOUNTTOTAL.ClientID %>").val(fnGetNumberWithComma(planTotalPrice, "C"));
// 총계 섹션의 "계획금액 합계" 자동계산 함수 호출
fnAutoPlanTotal_SUM();
}
//////////////////////////////////////////////////////////////////////////////
// 그리드 자동계산 관련 (누계금액 합계)
//////////////////////////////////////////////////////////////////////////////
function fnAutoTotal_SUM(object, grid) {
var TotalPrice = 0;
// 그리드의 모든 단가, 수량 추출
$(grid).find("input").each(function () {
var id = $(this).attr("id");
if (id == "SUM_PRICE" && $(this).val() != "")
TotalPrice += parseFloat($(this).val().replace(/,/g, ''));
});
// 합계 셋팅
$(grid).find("span").each(function () {
var id = $(this).attr("id");
if (id.indexOf("lblTotalSUM_PRICE") > 0)
$(this).text(fnGetNumberWithComma(TotalPrice, "d"));
});
}
//////////////////////////////////////////////////////////////////////////////
// 총계 섹션의 "누계총투입금액" 자동계산
//////////////////////////////////////////////////////////////////////////////
function fnAutoPlanTotal_SUM() {
var planTotalPrice = null;
if ($("#<%=hdnSumAmountTotal.ClientID %>").val() == "" || $("#<%=hdnSumAmountTotal.ClientID %>").val() == "0")
planTotalPrice = parseInt("0");
else
planTotalPrice = parseInt($("#<%=hdnSumAmountTotal.ClientID %>").val());
// 금일총투입금액
var planAmountTotal = null;
if ($("#<%=FLD_PLANAMOUNTTOTAL.ClientID %>").val() == "" || $("#<%=FLD_PLANAMOUNTTOTAL.ClientID %>").val() == "0")
planAmountTotal = parseInt("0");
else
planAmountTotal = parseInt($("#<%=FLD_PLANAMOUNTTOTAL.ClientID %>").val().replace(/,/g, ''));
$("#<%=FLD_SUMAMOUNTTOTAL.ClientID %>").val(fnGetNumberWithComma(planTotalPrice + planAmountTotal, "C"));
// 총계 섹션의 "마진금액", "마진율" 자동계산
fnAutoPlanTotal_Margin();
}
//////////////////////////////////////////////////////////////////////////////
// 총계 섹션의 "마진금액", "마진율" 자동계산
//////////////////////////////////////////////////////////////////////////////
function fnAutoPlanTotal_Margin() {
// 변경금액
var changeConstructAmount = parseInt($("#<%=FLD_CHANGECONSTRUCTAMOUNT.ClientID %>").val().replace(/,/g, ''));
// 누계총투입금액
var sumAmountTotal = parseInt($("#<%=FLD_SUMAMOUNTTOTAL.ClientID %>").val().replace(/,/g, ''));
// 마진금액 (변경금액 - 누계총투입금액)
var marginAmount = changeConstructAmount - sumAmountTotal;
$("#<%=FLD_MARGIN.ClientID %>").val(fnGetNumberWithComma(marginAmount, "C"));
// 마진율 (마진금액 / 변경금액 * 100)
if(marginAmount > 0) {
var marginPer = marginAmount / changeConstructAmount * 100;
$("#<%=FLD_MARGIN_PER.ClientID %>").val(marginPer.toFixed(2));
}
else {
var marginPer = (-1 * marginAmount) / changeConstructAmount * 100;
marginPer = -1 * marginPer;
$("#<%=FLD_MARGIN_PER.ClientID %>").text(marginPer.toFixed(2));
}
}
//////////////////////////////////////////////////////////////////////////////
// 그리드 Row 추가
//////////////////////////////////////////////////////////////////////////////
function fnAddRow(object, strGrid_Gubun) {
var gridName = "";
if (strGrid_Gubun == "gvListMaterial")
gridName = "<%=gvListMaterial.ClientID %>";
else if (strGrid_Gubun == "gvListEquipment")
gridName = "<%=gvListEquipment.ClientID %>";
else if (strGrid_Gubun == "gvListWorkerCost")
gridName = "<%=gvListWorkerCost.ClientID %>";
else if (strGrid_Gubun == "gvListIndirectExpense")
gridName = "<%=gvListIndirectExpense.ClientID %>";
else if (strGrid_Gubun == "gvListOutsideOrderExpense")
gridName = "<%=gvListOutsideOrderExpense.ClientID %>";
// 합계 Row 정보
var $tr_Auto = $('#' + gridName).find('tr:last').clone();
// 합계 Row 삭제
$('#' + gridName).find('tr:last').remove();
// 합계 Row 삭제 시점의 마지막 Row
var $tr = $('#' + gridName).find('tr:last').clone();
// 합계 Row 삭제 시점의 마지막 Row 셋팅
// 합계 전의 tr
$tr.find("input, select").each(function () {
var id = $(this).attr("id");
if (id == "UNITPRICE" || id == "VOLUME" || id == "WORKDAY" || id == "PRICE" || id == "SUM_VOLUME" || id == "SUM_VOLUME_" || id == "SUM_PRICE" || id == "SUM_PRICE_")
$(this).val("0");
else if ($(this).attr("id").indexOf("ddlWORKDAY") >= 0)
$(this).val("0");
else if (id == "STATUS_GUBUN")
$(this).val("I");
else
$(this).val("");
});
// 합계 Row 삭제 시점의 마지막 Row 추가
$('#' + gridName).append($tr);
// 삭제한 합계 Row 추가
$('#' + gridName).append($tr_Auto);
}
//////////////////////////////////////////////////////////////////////////////
// 그리드 삭제, 삭제취소 버튼
//////////////////////////////////////////////////////////////////////////////
function fnAddDelete(object, strGrid_Gubun) {
var tr = object.parentNode.parentNode;
if ($(object).text() == "삭제") {
$(tr).find("input, img, button, select").each(function () {
if ($(this).attr("id") == "btnDelete")
$(this).text("삭제취소");
else if ($(this).attr("id") == "STATUS_GUBUN") {
if ($(this).val() == "I")
$(tr).remove();
else
$(this).val("D");
}
else
$(this).prop("disabled", true);
});
}
else {
$(tr).find("input, img, button, select").each(function () {
if ($(this).attr("id") == "btnDelete")
$(this).text("삭제");
else if ($(this).attr("id") == "STATUS_GUBUN") {
$(this).val("U");
}
else
$(this).prop("disabled", false);
});
}
fnAutoTotal(null, strGrid_Gubun)
}
//////////////////////////////////////////////////////////////////////////////
// 그리드 Cell 수정 함수
//////////////////////////////////////////////////////////////////////////////
function fnChange(object) {
var tr = object.parentNode.parentNode;
var statusGubun = $(tr).find("#STATUS_GUBUN").val();
if (statusGubun != "I")
$(tr).find("#STATUS_GUBUN").val("U");
// 단가, 수량 같은 입력 값이 0 일때 0을 지우고 입력해야하는 불편함을 없애기 위한 함수 (2016-05-30)
if ($(object).val() == "")
$(object).val("0");
}
//////////////////////////////////////////////////////////////////////////////
// 노무비 그리드 콤보 Cell 수정 함수
//////////////////////////////////////////////////////////////////////////////
function workDayFN(object, strGrid_Gubun) {
var tr = object.parentNode.parentNode;
var workDayValue = $(object).val();
$(tr).find("#WORKDAY").val(workDayValue);
// 자동 합계 셋팅
fnAutoTotal(object, strGrid_Gubun);
var statusGubun = $(tr).find("#STATUS_GUBUN").val();
if (statusGubun != "I")
$(tr).find("#STATUS_GUBUN").val("U");
}
//////////////////////////////////////////////////////////////////////////////
// 단가, 수량 같은 입력 값이 0 일때 0을 지우고 입력해야하는 불편함을 없애기 위한 함수 (2016-05-30)
//////////////////////////////////////////////////////////////////////////////
function fnInuptFocus(object) {
if($(object).val() == "0")
$(object).val("");
}
//////////////////////////////////////////////////////////////////////////////
// 오늘작업계획 multi 입력을 위한 텍스트 박스 추가 삭제 스크립트 (2016-06-08)
//////////////////////////////////////////////////////////////////////////////
var maxTodayWorkPlanIndex = 1; // 현재 max 인덱스
function todayWorkPlanAdd(object, value) {
// 오늘작업계획 10개까지 제한
var divInputControlCount = $("#DIV_TODAYWORKPLAN").find("input").length;
if (divInputControlCount >= 10) {
return false;
}
// 마지막 컨트롤 아이디와 인덱스 추출
var id = "";
var index = 0;
$("#DIV_TODAYWORKPLAN").find("input").each(function () {
id = $(this).attr("id");
index = id.substring(id.lastIndexOf("_") + 1, id.length);
id = id.substring(0, id.lastIndexOf("_") + 1);
});
index = parseInt(index) + 1;
// 포커스가 위치한 컨트롤 아이디와 인덱스 추출
var objectId = $(object).attr("id");
objectIndex = objectId.substring(objectId.lastIndexOf("_") + 1, objectId.length);
// 컨트롤 추가
if (objectIndex == maxTodayWorkPlanIndex) {
todayWorkPlanControlAdd(id, index, value);
}
}
function todayWorkPlanControlAdd(id, index, value) {
if (typeof (value) == 'undefined')
value = "";
var controlStr = '<input type="text" id=' + id + index + ' name=' + id + index + ' value="' + value + '" onfocus="todayWorkPlanAdd(this); return false;" class="input_text textname" maxlength="250" style="width:83%;" />';
controlStr += '<button ID="btnDeleteTodayWorkPlan_' + index + '" class="small_btn" style="padding-top:2px;" onclick="todayWorkPlanDelete(' + index + ');return false;">삭제</button>'
$("#DIV_TODAYWORKPLAN").append(controlStr);
// 현재 max 인덱스 셋팅
maxTodayWorkPlanIndex = index;
}
function todayWorkPlanDelete(index) {
var divInputControlCount = $("#DIV_TODAYWORKPLAN").find("input").length;
if (divInputControlCount <= 1) {
alert("최소 1건 입니다.");
return false;
}
$("#FLD_TODAYWORKPLAN_" + index).remove();
$("#btnDeleteTodayWorkPlan_" + index).remove();
var id = "";
var index = 0;
$("#DIV_TODAYWORKPLAN").find("input").each(function () {
id = $(this).attr("id");
index = id.substring(id.lastIndexOf("_") + 1, id.length);
id = id.substring(0, id.lastIndexOf("_") + 1);
});
maxTodayWorkPlanIndex = parseInt(index);
}
//////////////////////////////////////////////////////////////////////////////
// 오늘작업실적 multi 입력을 위한 텍스트 박스 추가 삭제 스크립트 (2016-06-08)
//////////////////////////////////////////////////////////////////////////////
var maxTodayWorkResultIndex = 1; // 현재 max 인덱스
function todayWorkResultAdd(object, value) {
// 오늘작업실적 10개까지 제한
var divInputControlCount = $("#DIV_TODAYWORKRESULT").find("input").length;
if (divInputControlCount >= 10) {
return false;
}
// 마지막 컨트롤 아이디와 인덱스 추출
var id = "";
var index = 0;
$("#DIV_TODAYWORKRESULT").find("input").each(function () {
id = $(this).attr("id");
index = id.substring(id.lastIndexOf("_") + 1, id.length);
id = id.substring(0, id.lastIndexOf("_") + 1);
});
index = parseInt(index) + 1;
// 포커스가 위치한 컨트롤 아이디와 인덱스 추출
var objectId = $(object).attr("id");
objectIndex = objectId.substring(objectId.lastIndexOf("_") + 1, objectId.length);
// 컨트롤 추가
if (objectIndex == maxTodayWorkResultIndex) {
todayWorkResultControlAdd(id, index, value);
}
}
function todayWorkResultControlAdd(id, index, value) {
if (typeof (value) == 'undefined')
value = "";
var controlStr = '<input type="text" id=' + id + index + ' name=' + id + index + ' value="' + value + '" onfocus="todayWorkResultAdd(this); return false;" class="input_text textname" maxlength="250" style="width:83%;" />';
controlStr += '<button ID="btnDeleteTodayWorkResult_' + index + '" class="small_btn" style="padding-top:2px;" onclick="todayWorkResultDelete(' + index + ');return false;">삭제</button>'
$("#DIV_TODAYWORKRESULT").append(controlStr);
// 현재 max 인덱스 셋팅
maxTodayWorkResultIndex = index;
}
function todayWorkResultDelete(index) {
var divInputControlCount = $("#DIV_TODAYWORKRESULT").find("input").length;
if (divInputControlCount <= 1) {
alert("최소 1건 입니다.");
return false;
}
$("#FLD_TODAYWORKRESULT_" + index).remove();
$("#btnDeleteTodayWorkResult_" + index).remove();
var id = "";
var index = 0;
$("#DIV_TODAYWORKRESULT").find("input").each(function () {
id = $(this).attr("id");
index = id.substring(id.lastIndexOf("_") + 1, id.length);
id = id.substring(0, id.lastIndexOf("_") + 1);
});
maxTodayWorkResultIndex = parseInt(index);
}
//////////////////////////////////////////////////////////////////////////////
// 최근 정보 불러오기 버튼 클릭 확인창 함수
//////////////////////////////////////////////////////////////////////////////
function fnLastInfoLoadConfirm() {
var popConstructID = $("#<%= this.FLD_CONSTRUCTID.ClientID%>").val();
if (popConstructID == "") {
alert("공사를 선택하세요!");
return false;
}
if (!confirm("최근 정보를 불러오면 현재 정보는 지워집니다!\n\r진행하시겠습니까?"))
return false;
}
</script>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<div class="content_width">
<!-- 화면 타이틀 -->
<div class="content_Title">공사일보 등록/수정</div>
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="title_margin">
<tr>
<td class="tab_Title">기본정보</td>
<!-- 취소 및 저장 버튼 -->
<td class="AR btn_bottom">
<asp:Button ID="btnCancel" runat="server" Text="취소" CssClass="blueBtn1" CausesValidation="false" OnClientClick="fnBaseGoBack();return false;" />
<asp:Button ID="btnLastInfoLoad" runat="server" Text="최근 정보 불러오기" CssClass="blueBtn4" OnClick="btnLastInfoLoad_Click" CommandName="Create" CausesValidation="false" OnClientClick="return fnLastInfoLoadConfirm();" Visible="false"/>
<asp:Button ID="btnSave" runat="server" Text="저장" CssClass="blueBtn1" OnClick="btnSave_Click" CommandName="Create" OnClientClick="return fnSave();" />
</td>
</tr>
</table>
<!-- 기본정보 시작 -->
<table border="1" cellpadding="0" cellspacing="0" width="100%" class="table_content">
<colgroup>
<col width="12%" />
<col width="38%" />
<col width="12%" />
<col width="38%" />
</colgroup>
<tr>
<td class="cell_left">공사명<span class="essential_text">*</span></td>
<td class="pad1">
<asp:TextBox ID="FLD_CONSTRUCTNAME" runat="server" CssClass="search_text textname" MaxLength="50"></asp:TextBox>
<input type="hidden" id="FLD_CONSTRUCTID" runat="server" />
<img src="/images/btn_popsrc.gif" class="popsrc_align" id="btnConstructSearch" runat="server" onclick="fnConstructSearchPopup();" />
<img src="/images/btn/eraser.png" class="popsrc_align" id="btnConstructReset" runat="server" onclick="fnResetVal('FLD_CONSTRUCTNAME','FLD_CONSTRUCTID');" alt="" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate ="FLD_CONSTRUCTNAME" ErrorMessage="공사명을 선택하세요." Display="None"></asp:RequiredFieldValidator>
</td>
<td class="cell_left">일자<span class="essential_text">*</span></td>
<td class="pad1">
<asp:TextBox ID="FLD_CONSTRUCTDAILYDATE" runat="server" CssClass="input_text textdate" />
<img src="/images/btn_calendar.gif" class="cal_align" onclick="popCalendar('ContentPage_FLD_CONSTRUCTDAILYDATE', this)" alt="" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate ="FLD_CONSTRUCTDAILYDATE" ErrorMessage="일자를 선택하세요." Display="None"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="cell_left">날씨</td>
<td class="pad1" colspan="3">
<asp:TextBox ID="FLD_WEATHER" runat="server" CssClass="input_text" MaxLength="50" Width="40%"></asp:TextBox>
</td>
</tr>
<tr id="TR_TODAYWORK">
<td class="cell_left">오늘작업계획</td>
<td class="pad1">
<!-- <asp:TextBox ID="FLD_TODAYWORKPLAN" runat="server" CssClass="input_text textbox_w98" MaxLength="250" Width="98%"></asp:TextBox> -->
<diV id="DIV_TODAYWORKPLAN">
<input type="text" id="FLD_TODAYWORKPLAN_1" name="FLD_TODAYWORKPLAN_1" onfocus="todayWorkPlanAdd(this); return false;" class="input_text textname" maxlength="250" style="width:83%;" /><button ID="btnDeleteTodayWorkPlan_1" class="small_btn" style="padding-top:2px;" onclick="todayWorkPlanDelete(1);return false;">삭제</button>
</diV>
</td>
<td class="cell_left">오늘작업실적</td>
<td class="pad1">
<!-- <asp:TextBox ID="FLD_TODAYWORKRESULT" runat="server" CssClass="input_text textbox_w98" MaxLength="250" Width="98%"></asp:TextBox> -->
<diV id="DIV_TODAYWORKRESULT">
<input type="text" id="FLD_TODAYWORKRESULT_1" name="FLD_TODAYWORKRESULT_1" onfocus="todayWorkResultAdd(this); return false;" class="input_text textname" maxlength="250" style="width:83%;" /><button ID="btnDeleteTodayWorkResult_1" class="small_btn" style="padding-top:2px;" onclick="todayWorkResultDelete(1);return false;">삭제</button>
</diV>
</td>
</tr>
<tr>
<td class="cell_left">비고</td>
<td class="pad1" colspan="3">
<asp:TextBox ID="FLD_REMARK" runat="server" CssClass="input_text textbox_w98" MaxLength="500" Width="99.5%"></asp:TextBox>
</td>
</tr>
<tr>
<td class="cell_left">메모</td>
<td class="pad1" colspan="3">
<asp:TextBox ID="FLD_TOMORROWWORKPLAN" runat="server" TextMode="MultiLine" Rows="5" CssClass="input_multiline textbox_w99" MaxLength="1000"></asp:TextBox>
</td>
</tr>
</table>
<!-- 기본정보 끝 -->
<!-- 자재 시작 -->
<div class="tab_Title inter_margin">자재</div>
<asp:UpdatePanel ID="MaterialUpdatePanel" runat="server">
<ContentTemplate>
<asp:GridView ID="gvListMaterial" runat="server" AutoGenerateColumns="False" DataKeyNames="MATERIALID"
ShowHeaderWhenEmpty="True" Style="margin-top: 0px" Width="100%" CellPadding="0"
CssClass="table_content btn_margin" PageSize="12" ForeColor="#333333" GridLines="both"
HorizontalAlign="Center" OnRowDataBound = "RowDataBound_Material" ShowFooter="true">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:TemplateField HeaderText="자재명" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="17%">
<ItemTemplate>
<input type="text" id="INPUTRESOURCENAME" name="INPUTRESOURCENAME" value='<%# Eval("INPUTRESOURCENAME") %>' class="search_text textname" ReadOnly="true" maxlength="100" style="width:60%;" />
<input type="hidden" id="INPUTRESOURCEID" name="INPUTRESOURCEID" value='<%# Eval("INPUTRESOURCEID") %>' />
<img src="/images/btn_popsrc.gif" class="popsrc_align" id="INPUTRESOURCE_SEARCHBTN" alt="" onclick="fnSearchPopup(this, 1, 'gvListMaterial');"/>
<img src="/images/btn/eraser.png" class="popsrc_align" id="CLIENTDELBTN" alt="" onclick="fnSearchPopup(this, 2, 'gvListMaterial');"/>
<input type="hidden" id="MATERIALID" name="MATERIALID" value='<%# Eval("MATERIALID") %>' />
<input type="hidden" id="STATUS_GUBUN" name="STATUS_GUBUN" value='' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="규격" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="8%">
<ItemTemplate>
<input type="text" id="SPECIFICATION" name="SPECIFICATION" value='<%# Eval("SPECIFICATION") %>' ReadOnly="true" class="search_text textname" style="width:90%;" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="단위" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="8%">
<ItemTemplate>
<input type="text" id="UNIT" name="UNIT" value='<%# Eval("UNIT") %>' ReadOnly="true" class="search_text textname" style="width:90%;" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="단가" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="10%">
<ItemTemplate>
<input type="text" id="UNITPRICE" name="UNITPRICE" value='<%# Eval("UNITPRICE") %>' class="input_text_number textname" style="width:90%;" onfocus="fnInuptFocus(this);" onkeyup="fnInputNumberOnly(this,'c');" onblur="fnAutoTotal(this, 'gvListMaterial'); fnChange(this);" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="투입업체" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="10%">
<ItemTemplate>
<input type="text" id="INCOMPANY" name="INCOMPANY" value='<%# Eval("INCOMPANY") %>' class="input_text textname" style="width:90%;" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="수량" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="10%">
<ItemTemplate>
<input type="text" id="VOLUME" name="VOLUME" value='<%# Eval("VOLUME") %>' class="input_text_number textname" style="width:90%;" onfocus="fnInuptFocus(this);" onkeyup="fnInputNumberOnly(this,'c');" onblur="fnAutoTotal(this, 'gvListMaterial'); fnChange(this);" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="금액" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="10%" FooterStyle-CssClass="data_AR">
<ItemTemplate>
<input type="text" id="PRICE" name="PRICE" value='<%# Eval("PRICE") %>' ReadOnly="true" class="search_text_number textname" style="width:90%;" onchange="fnInputNumberOnly(this,'c');" />
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="lblTotalPRICE" runat="server"></asp:Label>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="누계수량" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="10%">
<ItemTemplate>
<input type="text" id="SUM_VOLUME" name="SUM_VOLUME" value='<%# Eval("SUM_VOLUME") %>' ReadOnly="true" class="search_text_number textname" style="width:90%;" />
<input type="hidden" id="SUM_VOLUME_" name="SUM_VOLUME_" value='<%# Eval("SUM_VOLUME_") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="누계금액" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="10%" FooterStyle-CssClass="data_AR">
<ItemTemplate>
<input type="text" id="SUM_PRICE" name="SUM_PRICE" value='<%# Eval("SUM_PRICE") %>' ReadOnly="true" class="search_text_number textname" style="width:90%;" />
<input type="hidden" id="SUM_PRICE_" name="SUM_PRICE_" value='<%# Eval("SUM_PRICE_") %>' />
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="lblTotalSUM_PRICE" runat="server"></asp:Label>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="" HeaderStyle-CssClass="cell_center" ItemStyle-HorizontalAlign="Center" FooterStyle-HorizontalAlign="Center" FooterStyle-VerticalAlign="Middle" HeaderStyle-Width="7%">
<ItemTemplate>
<button ID="btnDelete" class="small_btn2" onclick="fnAddDelete(this, 'gvListMaterial');return false;">삭제</button>
</ItemTemplate>
<FooterTemplate>
<button ID="btnAdd" class="small_btn" onclick="fnAddRow(this, 'gvListMaterial');return false;">추가</button>
</FooterTemplate>
</asp:TemplateField>
</Columns>
<EditRowStyle BackColor="#ffffff" />
<EmptyDataRowStyle CssClass="data_AC row25" />
<EmptyDataTemplate>
데이터가 존재하지 않습니다.
</EmptyDataTemplate>
<FooterStyle BackColor="#507CD1" ForeColor="White" Font-Bold="True" />
<HeaderStyle BackColor="#eaecf3" Font-Bold="True" ForeColor="#374994" />
<PagerStyle HorizontalAlign="Center" />
<RowStyle BackColor="#ffffff" CssClass="data_AC" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F5F7FB" />
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
<SortedDescendingCellStyle BackColor="#E9EBEF" />
<SortedDescendingHeaderStyle BackColor="#4870BE" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<!-- 자재 끝 -->
<!-- 장비 시작 -->
<div class="tab_Title inter_margin">장비</div>
<asp:UpdatePanel ID="EquipmentUpdatePanel" runat="server">
<ContentTemplate>
<asp:GridView ID="gvListEquipment" runat="server" AutoGenerateColumns="False" DataKeyNames="EQUIPMENTID"
ShowHeaderWhenEmpty="True" Style="margin-top: 0px" Width="100%" CellPadding="0"
CssClass="table_content btn_margin" PageSize="12" ForeColor="#333333" GridLines="both"
HorizontalAlign="Center" OnRowDataBound = "RowDataBound_Equipment" ShowFooter="true">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:TemplateField HeaderText="장비명" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="25%">
<ItemTemplate>
<input type="text" id="INPUTRESOURCENAME" name="INPUTRESOURCENAME" value='<%# Eval("INPUTRESOURCENAME") %>' class="search_text textname" ReadOnly="true" maxlength="100" style="width:73%;" />
<input type="hidden" id="INPUTRESOURCEID" name="INPUTRESOURCEID" value='<%# Eval("INPUTRESOURCEID") %>' />
<img src="/images/btn_popsrc.gif" class="popsrc_align" id="INPUTRESOURCE_SEARCHBTN" alt="" onclick="fnSearchPopup(this, 1, 'gvListEquipment');"/>
<img src="/images/btn/eraser.png" class="popsrc_align" id="CLIENTDELBTN" alt="" onclick="fnSearchPopup(this, 2, 'gvListEquipment');"/>
<input type="hidden" id="EQUIPMENTID" name="EQUIPMENTID" value='<%# Eval("EQUIPMENTID") %>' />
<input type="hidden" id="STATUS_GUBUN" name="STATUS_GUBUN" value='' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="단위" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="8%">
<ItemTemplate>
<input type="text" id="UNIT" name="UNIT" value='<%# Eval("UNIT") %>' ReadOnly="true" class="search_text textname" style="width:90%;" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="단가" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%">
<ItemTemplate>
<input type="text" id="UNITPRICE" name="UNITPRICE" value='<%# Eval("UNITPRICE") %>' class="input_text_number textname" style="width:92%;" onfocus="fnInuptFocus(this);" onkeyup="fnInputNumberOnly(this,'c');" onblur="fnAutoTotal(this, 'gvListEquipment'); fnChange(this);" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="수량" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%">
<ItemTemplate>
<input type="text" id="VOLUME" name="VOLUME" value='<%# Eval("VOLUME") %>' class="input_text_number textname" style="width:92%;" onfocus="fnInuptFocus(this);" onkeyup="fnInputNumberOnly(this,'c');" onblur="fnAutoTotal(this, 'gvListEquipment'); fnChange(this);" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="금액" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%" FooterStyle-CssClass="data_AR">
<ItemTemplate>
<input type="text" id="PRICE" name="PRICE" value='<%# Eval("PRICE") %>' ReadOnly="true" class="search_text_number textname" style="width:92%;" onchange="fnInputNumberOnly(this,'c');" />
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="lblTotalPRICE" runat="server"></asp:Label>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="누계수량" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%">
<ItemTemplate>
<input type="text" id="SUM_VOLUME" name="SUM_VOLUME" value='<%# Eval("SUM_VOLUME") %>' ReadOnly="true" class="search_text_number textname" style="width:92%;" />
<input type="hidden" id="SUM_VOLUME_" name="SUM_VOLUME_" value='<%# Eval("SUM_VOLUME_") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="누계금액" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%" FooterStyle-CssClass="data_AR">
<ItemTemplate>
<input type="text" id="SUM_PRICE" name="SUM_PRICE" value='<%# Eval("SUM_PRICE") %>' ReadOnly="true" class="search_text_number textname" style="width:92%;" />
<input type="hidden" id="SUM_PRICE_" name="SUM_PRICE_" value='<%# Eval("SUM_PRICE_") %>' />
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="lblTotalSUM_PRICE" runat="server"></asp:Label>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="" HeaderStyle-CssClass="cell_center" ItemStyle-HorizontalAlign="Center" FooterStyle-HorizontalAlign="Center" FooterStyle-VerticalAlign="Middle" HeaderStyle-Width="7%">
<ItemTemplate>
<button ID="btnDelete" class="small_btn2" onclick="fnAddDelete(this, 'gvListEquipment');return false;">삭제</button>
</ItemTemplate>
<FooterTemplate>
<button ID="btnAdd" class="small_btn" onclick="fnAddRow(this, 'gvListEquipment');return false;">추가</button>
</FooterTemplate>
</asp:TemplateField>
</Columns>
<EditRowStyle BackColor="#ffffff" />
<EmptyDataRowStyle CssClass="data_AC row25" />
<EmptyDataTemplate>
데이터가 존재하지 않습니다.
</EmptyDataTemplate>
<FooterStyle BackColor="#507CD1" ForeColor="White" Font-Bold="True" />
<HeaderStyle BackColor="#eaecf3" Font-Bold="True" ForeColor="#374994" />
<PagerStyle HorizontalAlign="Center" />
<RowStyle BackColor="#ffffff" CssClass="data_AC" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F5F7FB" />
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
<SortedDescendingCellStyle BackColor="#E9EBEF" />
<SortedDescendingHeaderStyle BackColor="#4870BE" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<!-- 장비 끝 -->
<!-- 노무비 시작 -->
<div class="tab_Title inter_margin">노무비</div>
<asp:UpdatePanel ID="WorkerCostUpdatePanel" runat="server">
<ContentTemplate>
<asp:GridView ID="gvListWorkerCost" runat="server" AutoGenerateColumns="False" DataKeyNames="WORKERCOSTID"
ShowHeaderWhenEmpty="True" Style="margin-top: 0px" Width="100%" CellPadding="0"
CssClass="table_content btn_margin" PageSize="12" ForeColor="#333333" GridLines="both"
HorizontalAlign="Center" OnRowDataBound = "RowDataBound_WorkerCost" ShowFooter="true">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:TemplateField HeaderText="이름" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="19%">
<ItemTemplate>
<input type="text" id="WORKERNAME" name="WORKERNAME" value='<%# Eval("WORKERNAME") %>' class="search_text textname" ReadOnly="true" maxlength="100" style="width:65%;" />
<input type="hidden" id="WORKERID" name="WORKERID" value='<%# Eval("WORKERID") %>' />
<img src="/images/btn_popsrc.gif" class="popsrc_align" id="WORKER_SEARCHBTN" alt="" onclick="fnSearchPopup(this, 1, 'gvListWorkerCost');"/>
<img src="/images/btn/eraser.png" class="popsrc_align" id="CLIENTDELBTN" alt="" onclick="fnSearchPopup(this, 2, 'gvListWorkerCost');"/>
<input type="hidden" id="WORKERCOSTID" name="WORKERCOSTID" value='<%# Eval("WORKERCOSTID") %>' />
<input type="hidden" id="STATUS_GUBUN" name="STATUS_GUBUN" value='' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="주민번호" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="14%">
<ItemTemplate>
<input type="text" id="RESIDENT" name="RESIDENT" value='<%# Eval("RESIDENT") %>' ReadOnly="true" class="search_text textname" style="width:93%;" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="단가" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%">
<ItemTemplate>
<input type="text" id="UNITPRICE" name="UNITPRICE" value='<%# Eval("UNITPRICE") %>' class="input_text_number textname" style="width:92%;" onfocus="fnInuptFocus(this);" onkeyup="fnInputNumberOnly(this,'c');" onblur="fnAutoTotal(this, 'gvListWorkerCost'); fnChange(this);" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="투입일수" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%">
<ItemTemplate>
<asp:DropDownList ID="ddlWORKDAY" runat="server" CssClass="input_dropdown w100"></asp:DropDownList>
<input type="hidden" id="WORKDAY" name="WORKDAY" value='<%# Eval("WORKDAY") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="금액" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%" FooterStyle-CssClass="data_AR">
<ItemTemplate>
<input type="text" id="PRICE" name="PRICE" value='<%# Eval("PRICE") %>' ReadOnly="true" class="search_text_number textname" style="width:92%;" onchange="fnInputNumberOnly(this,'c');" />
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="lblTotalPRICE" runat="server"></asp:Label>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="누계수량" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%">
<ItemTemplate>
<input type="text" id="SUM_WORKDAY" name="SUM_WORKDAY" value='<%# Eval("SUM_WORKDAY") %>' ReadOnly="true" class="search_text_number textname" style="width:92%;" />
<input type="hidden" id="SUM_WORKDAY_" name="SUM_WORKDAY_" value='<%# Eval("SUM_WORKDAY_") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="누계금액" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%" FooterStyle-CssClass="data_AR">
<ItemTemplate>
<input type="text" id="SUM_PRICE" name="SUM_PRICE" value='<%# Eval("SUM_PRICE") %>' ReadOnly="true" class="search_text_number textname" style="width:92%;" />
<input type="hidden" id="SUM_PRICE_" name="SUM_PRICE_" value='<%# Eval("SUM_PRICE_") %>' />
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="lblTotalSUM_PRICE" runat="server"></asp:Label>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="" HeaderStyle-CssClass="cell_center" ItemStyle-HorizontalAlign="Center" FooterStyle-HorizontalAlign="Center" FooterStyle-VerticalAlign="Middle" HeaderStyle-Width="7%">
<ItemTemplate>
<button ID="btnDelete" class="small_btn2" onclick="fnAddDelete(this, 'gvListWorkerCost');return false;">삭제</button>
</ItemTemplate>
<FooterTemplate>
<button ID="btnAdd" class="small_btn" onclick="fnAddRow(this, 'gvListWorkerCost');return false;">추가</button>
</FooterTemplate>
</asp:TemplateField>
</Columns>
<EditRowStyle BackColor="#ffffff" />
<EmptyDataRowStyle CssClass="data_AC row25" />
<EmptyDataTemplate>
데이터가 존재하지 않습니다.
</EmptyDataTemplate>
<FooterStyle BackColor="#507CD1" ForeColor="White" Font-Bold="True" />
<HeaderStyle BackColor="#eaecf3" Font-Bold="True" ForeColor="#374994" />
<PagerStyle HorizontalAlign="Center" />
<RowStyle BackColor="#ffffff" CssClass="data_AC" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F5F7FB" />
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
<SortedDescendingCellStyle BackColor="#E9EBEF" />
<SortedDescendingHeaderStyle BackColor="#4870BE" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<!-- 노무비 끝 -->
<!-- 간접경비 끝 -->
<div class="tab_Title inter_margin">간접경비</div>
<asp:UpdatePanel ID="IndirectExpenseUpdatePanel" runat="server">
<ContentTemplate>
<asp:GridView ID="gvListIndirectExpense" runat="server" AutoGenerateColumns="False" DataKeyNames="INDIRECTEXPENSEID"
ShowHeaderWhenEmpty="True" Style="margin-top: 0px" Width="100%" CellPadding="0"
CssClass="table_content btn_margin" PageSize="12" ForeColor="#333333" GridLines="both"
HorizontalAlign="Center" OnRowDataBound = "RowDataBound_IndirectExpense" ShowFooter="true">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:TemplateField HeaderText="경비명" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="25%">
<ItemTemplate>
<input type="text" id="INPUTRESOURCENAME" name="INPUTRESOURCENAME" value='<%# Eval("INPUTRESOURCENAME") %>' class="search_text textname" ReadOnly="true" maxlength="100" style="width:83%;" />
<input type="hidden" id="INPUTRESOURCEID" name="INPUTRESOURCEID" value='<%# Eval("INPUTRESOURCEID") %>' />
<img src="/images/btn_popsrc.gif" class="popsrc_align" id="INPUTRESOURCE_SEARCHBTN" alt="" onclick="fnSearchPopup(this, 1, 'gvListIndirectExpense');"/>
<img src="/images/btn/eraser.png" class="popsrc_align" id="CLIENTDELBTN" alt="" onclick="fnSearchPopup(this, 2, 'gvListIndirectExpense');"/>
<input type="hidden" id="INDIRECTEXPENSEID" name="INDIRECTEXPENSEID" value='<%# Eval("INDIRECTEXPENSEID") %>' />
<input type="hidden" id="STATUS_GUBUN" name="STATUS_GUBUN" value='' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="단위" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="8%">
<ItemTemplate>
<input type="text" id="UNIT" name="UNIT" value='<%# Eval("UNIT") %>' ReadOnly="true" class="search_text textname" style="width:90%;" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="단가" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%" Visible="false">
<ItemTemplate>
<input type="text" id="UNITPRICE" name="UNITPRICE" value='<%# Eval("UNITPRICE") %>' class="input_text_number textname" style="width:92%;" onfocus="fnInuptFocus(this);" onkeyup="fnInputNumberOnly(this,'c');" onblur="fnAutoTotal(this, 'gvListIndirectExpense'); fnChange(this);" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="수량" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%" Visible="false">
<ItemTemplate>
<input type="text" id="VOLUME" name="VOLUME" value='<%# Eval("VOLUME") %>' class="input_text_number textname" style="width:92%;" onfocus="fnInuptFocus(this);" onkeyup="fnInputNumberOnly(this,'c');" onblur="fnAutoTotal(this, 'gvListIndirectExpense'); fnChange(this);" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="금액" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%" FooterStyle-CssClass="data_AR">
<ItemTemplate>
<input type="text" id="PRICE" name="PRICE" value='<%# Eval("PRICE") %>' class="input_text_number textname" style="width:92%;" onfocus="fnInuptFocus(this);" onkeyup="fnInputNumberOnly(this,'c');" onblur="fnAutoTotal(this, 'gvListIndirectExpense'); fnChange(this);" />
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="lblTotalPRICE" runat="server"></asp:Label>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="누계수량" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%" Visible="false">
<ItemTemplate>
<input type="text" id="SUM_VOLUME" name="SUM_VOLUME" value='<%# Eval("SUM_VOLUME") %>' ReadOnly="true" class="search_text_number textname" style="width:92%;" />
<input type="hidden" id="SUM_VOLUME_" name="SUM_VOLUME_" value='<%# Eval("SUM_VOLUME_") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="누계금액" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%" FooterStyle-CssClass="data_AR">
<ItemTemplate>
<input type="text" id="SUM_PRICE" name="SUM_PRICE" value='<%# Eval("SUM_PRICE") %>' ReadOnly="true" class="search_text_number textname" style="width:92%;" />
<input type="hidden" id="SUM_PRICE_" name="SUM_PRICE_" value='<%# Eval("SUM_PRICE_") %>' />
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="lblTotalSUM_PRICE" runat="server"></asp:Label>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="" HeaderStyle-CssClass="cell_center" ItemStyle-HorizontalAlign="Center" FooterStyle-HorizontalAlign="Center" FooterStyle-VerticalAlign="Middle" HeaderStyle-Width="4%">
<ItemTemplate>
<button ID="btnDelete" class="small_btn2" onclick="fnAddDelete(this, 'gvListIndirectExpense');return false;">삭제</button>
</ItemTemplate>
<FooterTemplate>
<button ID="btnAdd" class="small_btn" onclick="fnAddRow(this, 'gvListIndirectExpense');return false;">추가</button>
</FooterTemplate>
</asp:TemplateField>
</Columns>
<EditRowStyle BackColor="#ffffff" />
<EmptyDataRowStyle CssClass="data_AC row25" />
<EmptyDataTemplate>
데이터가 존재하지 않습니다.
</EmptyDataTemplate>
<FooterStyle BackColor="#507CD1" ForeColor="White" Font-Bold="True" />
<HeaderStyle BackColor="#eaecf3" Font-Bold="True" ForeColor="#374994" />
<PagerStyle HorizontalAlign="Center" />
<RowStyle BackColor="#ffffff" CssClass="data_AC" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F5F7FB" />
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
<SortedDescendingCellStyle BackColor="#E9EBEF" />
<SortedDescendingHeaderStyle BackColor="#4870BE" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<!-- 간접경비 끝 -->
<!-- 외주비 시작 -->
<div class="tab_Title inter_margin">외주비</div>
<asp:UpdatePanel ID="OutsideOrderExpenseUpdatePanel" runat="server">
<ContentTemplate>
<asp:GridView ID="gvListOutsideOrderExpense" runat="server" AutoGenerateColumns="False" DataKeyNames="OUTSIDEORDEREXPENSEID"
ShowHeaderWhenEmpty="True" Style="margin-top: 0px" Width="100%" CellPadding="0"
CssClass="table_content btn_margin" PageSize="12" ForeColor="#333333" GridLines="both"
HorizontalAlign="Center" OnRowDataBound = "RowDataBound_OutsideOrderExpense" ShowFooter="true">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:TemplateField HeaderText="외주명" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="25%">
<ItemTemplate>
<input type="text" id="INPUTRESOURCENAME" name="INPUTRESOURCENAME" value='<%# Eval("INPUTRESOURCENAME") %>' class="search_text textname" ReadOnly="true" maxlength="100" style="width:73%;" />
<input type="hidden" id="INPUTRESOURCEID" name="INPUTRESOURCEID" value='<%# Eval("INPUTRESOURCEID") %>' />
<img src="/images/btn_popsrc.gif" class="popsrc_align" id="INPUTRESOURCE_SEARCHBTN" alt="" onclick="fnSearchPopup(this, 1, 'gvListOutsideOrderExpense');"/>
<img src="/images/btn/eraser.png" class="popsrc_align" id="CLIENTDELBTN" alt="" onclick="fnSearchPopup(this, 2, 'gvListOutsideOrderExpense');"/>
<input type="hidden" id="OUTSIDEORDEREXPENSEID" name="OUTSIDEORDEREXPENSEID" value='<%# Eval("OUTSIDEORDEREXPENSEID") %>' />
<input type="hidden" id="STATUS_GUBUN" name="STATUS_GUBUN" value='' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="단위" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="8%">
<ItemTemplate>
<input type="text" id="UNIT" name="UNIT" value='<%# Eval("UNIT") %>' ReadOnly="true" class="search_text textname" style="width:90%;" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="단가" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%">
<ItemTemplate>
<input type="text" id="UNITPRICE" name="UNITPRICE" value='<%# Eval("UNITPRICE") %>' class="input_text_number textname" style="width:92%;" onfocus="fnInuptFocus(this);" onkeyup="fnInputNumberOnly(this,'c');" onblur="fnAutoTotal(this, 'gvListOutsideOrderExpense'); fnChange(this);" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="수량" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%">
<ItemTemplate>
<input type="text" id="VOLUME" name="VOLUME" value='<%# Eval("VOLUME") %>' class="input_text_number textname" style="width:92%;" onfocus="fnInuptFocus(this);" onkeyup="fnInputNumberOnly(this,'c');" onblur="fnAutoTotal(this, 'gvListOutsideOrderExpense'); fnChange(this);" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="금액" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%" FooterStyle-CssClass="data_AR">
<ItemTemplate>
<input type="text" id="PRICE" name="PRICE" value='<%# Eval("PRICE") %>' ReadOnly="true" class="search_text_number textname" style="width:92%;" onchange="fnInputNumberOnly(this,'c');" />
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="lblTotalPRICE" runat="server"></asp:Label>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="누계수량" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%">
<ItemTemplate>
<input type="text" id="SUM_VOLUME" name="SUM_VOLUME" value='<%# Eval("SUM_VOLUME") %>' ReadOnly="true" class="search_text_number textname" style="width:92%;" />
<input type="hidden" id="SUM_VOLUME_" name="SUM_VOLUME_" value='<%# Eval("SUM_VOLUME_") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="누계금액" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%" FooterStyle-CssClass="data_AR">
<ItemTemplate>
<input type="text" id="SUM_PRICE" name="SUM_PRICE" value='<%# Eval("SUM_PRICE") %>' ReadOnly="true" class="search_text_number textname" style="width:92%;" />
<input type="hidden" id="SUM_PRICE_" name="SUM_PRICE_" value='<%# Eval("SUM_PRICE_") %>' />
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="lblTotalSUM_PRICE" runat="server"></asp:Label>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="" HeaderStyle-CssClass="cell_center" ItemStyle-HorizontalAlign="Center" FooterStyle-HorizontalAlign="Center" FooterStyle-VerticalAlign="Middle" HeaderStyle-Width="7%">
<ItemTemplate>
<button ID="btnDelete" class="small_btn2" onclick="fnAddDelete(this, 'gvListOutsideOrderExpense');return false;">삭제</button>
</ItemTemplate>
<FooterTemplate>
<button ID="btnAdd" class="small_btn" onclick="fnAddRow(this, 'gvListOutsideOrderExpense');return false;">추가</button>
</FooterTemplate>
</asp:TemplateField>
</Columns>
<EditRowStyle BackColor="#ffffff" />
<EmptyDataRowStyle CssClass="data_AC row25" />
<EmptyDataTemplate>
데이터가 존재하지 않습니다.
</EmptyDataTemplate>
<FooterStyle BackColor="#507CD1" ForeColor="White" Font-Bold="True" />
<HeaderStyle BackColor="#eaecf3" Font-Bold="True" ForeColor="#374994" />
<PagerStyle HorizontalAlign="Center" />
<RowStyle BackColor="#ffffff" CssClass="data_AC" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F5F7FB" />
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
<SortedDescendingCellStyle BackColor="#E9EBEF" />
<SortedDescendingHeaderStyle BackColor="#4870BE" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<!-- 외주비 끝 -->
<!-- 총계 시작 -->
<div class="tab_Title inter_margin">총계</div>
<table border="1" cellpadding="0" cellspacing="0" width="100%" class="table_content">
<colgroup>
<col width="18%" />
<col width="18%" />
<col width="18%" />
<col width="18%" />
<!-- 마진금액, 마진율 필요 없어서 주석 처리 (2016-06-17)
<col width="18%" />
<col width="10%" />
-->
</colgroup>
<tr>
<td class="cell_center">계약금액</td>
<td class="cell_center">변경금액</td>
<td class="cell_center">금일총투입금액</td>
<td class="cell_center">누계총투입금액</td>
<!-- 마진금액, 마진율 필요 없어서 주석 처리 (2016-06-17)
<td class="cell_center">마진금액</td>
<td class="cell_center">마진율</td>
-->
</tr>
<tr>
<td class="pad1">
<asp:HiddenField ID="FLD_CONSTRUCTAMOUNTID" runat="server" />
<!-- 계약금액 -->
<asp:TextBox ID="FLD_CONSTRUCTAMOUNT" runat="server" ReadOnly="true" CssClass="search_text_number textbox_w96" onkeyup="fnInputNumberOnly(this,'c');" onblur="fnInputNumberOnly(this,'c'); fnPlanChange();" />
</td>
<td class="pad1">
<!-- 변경금액 -->
<asp:TextBox ID="FLD_CHANGECONSTRUCTAMOUNT" runat="server" ReadOnly="true" CssClass="search_text_number textbox_w96" onkeyup="fnInputNumberOnly(this,'c');" onblur="fnInputNumberOnly(this,'c'); fnPlanChange();" />
</td>
<td class="pad1">
<!-- 금일총투입금액 -->
<asp:TextBox ID="FLD_PLANAMOUNTTOTAL" runat="server" ReadOnly="true" CssClass="search_text_number textbox_w96" />
</td>
<td class="pad1">
<!-- 누계총투입금액 -->
<asp:TextBox ID="FLD_SUMAMOUNTTOTAL" runat="server" ReadOnly="true" CssClass="search_text_number textbox_w96" />
<asp:HiddenField ID="hdnSumAmountTotal" runat="server" />
</td>
<!-- 마진금액, 마진율 필요 없어서 주석 처리 (2016-06-17)
<td class="pad1">
<!-- 마진금액
<asp:TextBox ID="FLD_MARGIN" runat="server" ReadOnly="true" CssClass="search_text_number textbox_w96" />
</td>
<td class="pad1">
<!-- 마진율
<asp:TextBox ID="FLD_MARGIN_PER" runat="server" ReadOnly="true" CssClass="search_text_number textbox_w94" />
</td>
-->
</tr>
</table>
<!-- 총계 끝 -->
</div>
<!-- 취소, 저장 버튼 -->
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="btn_bottom inter_margin">
<tr>
<td class="AR">
<asp:Button ID="btnList2" runat="server" Text="취소" CssClass="blueBtn1" CausesValidation="false" OnClientClick="fnBaseGoBack();return false;" />
<asp:Button ID="btnSave2" runat="server" Text="저장" CssClass="blueBtn1" OnClick="btnSave_Click" CommandName="Create" OnClientClick="return fnSave();" />
</td>
</tr>
</table>
<asp:HiddenField ID="FLD_REGUSER" runat="server" />
<!-- 그리드 컨트롤들의 값 셋팅하기 위한 히든컨트롤 -->
<asp:HiddenField ID="hdnMATERIALResultData" runat="server" />
<asp:HiddenField ID="hdnEQUIPMENTResultData" runat="server" />
<asp:HiddenField ID="hdnWORKERCOSTResultData" runat="server" />
<asp:HiddenField ID="hdnINDIRECTEXPENSEResultData" runat="server" />
<asp:HiddenField ID="hdnOUTSIDEORDEREXPENSEResultData" runat="server" />
<asp:HiddenField ID="hdnCONSTRUCTDAILYID" runat="server" />
<!-- 오늘작업계획, 오늘작업실적 컨트롤들의 값 셋팅하기 위한 히든컨트롤 -->
<asp:HiddenField ID="hdnDivTodayWorkPlan" runat="server" />
<asp:HiddenField ID="hdnDivTodayWorkResult" runat="server" />
<script type="text/javascript">
// 총계 섹션의 "금일총투입금액" 자동계산
fnAutoPlanTotal();
// 총계 섹션의 "누계총투입금액" 자동계산
fnAutoPlanTotal_SUM();
</script>
</asp:Content>
다음으로 .aspx.cs 부분 입니다.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using System.Data;
using FrameWork.Except;
using System.Configuration;
using System.IO;
using System.Web.Script.Serialization;
namespace ssCRM_UI.Pages__C004.CT
{
public partial class CTCD_Write : ssCRM_UI.Common.ControlUtilAuth
{
#region 전역변수
int keyId = 0; // 공사일보 키값
int keyId2 = 0; // 공사 키값
string keyName = ""; // 공사명
#endregion
#region Page_Load
protected void Page_Load(object sender, EventArgs e)
{
this.Page.Form.DefaultButton = this.btnSave.UniqueID;
this.keyId = this.GetKeyId(); // 공사일보 일련번호
this.hdnCONSTRUCTDAILYID.Value = this.keyId.ToString();
this.keyId2 = this.GetKeyId("keyId2"); // 공사 일련번호
this.keyName = DecryptKey(GetString(Request.QueryString["keyName"])); // 공사명
if (!IsPostBack)
{
this.FLD_CONSTRUCTNAME.Attributes.Add("readonly", "readonly");
// 일자 금일로 셋팅
this.FLD_CONSTRUCTDAILYDATE.Text = DateTime.Now.ToString("yyyy-MM-dd");
// 코드 표시
this.SetDataBind();
// 수정시
if (this.keyId > 0)
{
btnSave.CommandName = "Update";
// 수정일 경우 공사 정보를 변경하지 못함.
this.btnConstructSearch.Disabled = true;
this.btnConstructReset.Disabled = true;
}
else
{
// 등록시 (자재, 장비, 노무비, 경비, 외주 탭에 사용하는 프로시저는 다른 쪽과 공통으로 사용하므로 공사일련번호, 공사명 셋팅 후 초기화)
if (this.keyId2 > 0)
{
this.FLD_CONSTRUCTID.Value = this.keyId2.ToString();
this.FLD_CONSTRUCTNAME.Text = this.keyName;
this.keyId2 = 0;
}
// 최근정보불러오기 기능 추가 (2016-06-15)
this.btnLastInfoLoad.Visible = true;
}
// 데이터 가져오기
this.GetDetail("");
// 역할권한관리에서 설정한 버튼 및 데이터 권한 확인.
// 조회, 수정 화면일 경우에는 해당 정보에서 본인에 해당되는 값을 인자로 전달해야 함.
// 목록 화면일 경우에는 목록 조회 메서드에서 권한 범위에 따른 검색 항목을 전달해야 함.
// 코드 내에서 버튼 visible = true 속성을 설정할 경우에는 다음과 같이 처리해야 함. btnX.Visible = (ArrAuthList.IndexOf(btnX.CommandName) != -1);
// 2014-02-21 정한솔
string[] userIds = { this.FLD_REGUSER.Value };
CheckAuth(userIds);
}
}
#endregion
#region SetDataBind() : 코드 정보 표시
/// <summary>
/// Method 명: SetDataBind()
/// Method내용: 코드 정보 표시
/// 작 성 자:
/// 최초작성일: 2016-03-11
/// 최종수정자:
/// 최종수정일:
/// </summary>
/// <param name=""></param>
/// <returns>
/// </returns>
private void SetDataBind()
{
}
#endregion
#region GoView() : 공사일보 상세페이지 이동
/// <summary>
/// Method 명: GoView()
/// Method내용: 공사일보 상세페이지 이동
/// 작 성 자:
/// 최초작성일: 2016-03-11
/// 최종수정자:
/// 최종수정일:
/// </summary>
/// <param name=""></param>
/// <returns>
/// </returns>
private void GoView()
{
Response.Redirect("CTCD_View.aspx?keyId=" + EncryptKey(this.keyId) + "&keyId2=" + EncryptKey(this.keyId2), false);
}
#endregion
#region GetDetail() : 공사일보 조회(수정시 기존 정보 조회)
/// <summary>
/// Method 명: GetDetail()
/// Method내용: 공사일보 조회(수정시 기존 정보 조회)
/// 작 성 자:
/// 최초작성일: 2016-03-11
/// 최종수정자:
/// 최종수정일:
/// </summary>
/// <param name=""></param>
/// <returns>
/// </returns>
private void GetDetail(string getType)
{
Biz.FW.FWXmlAutoBiz oBiz = null;
Hashtable ht;
DataSet dsData = null;
int keyId_temp1 = 0;
int keyId_temp2 = 0;
try
{
#region 최근 정보 불러오기 기능 추가 (2016-06-15)
if (getType == "LastInfoLoad")
{
keyId_temp1 = this.keyId;
keyId_temp2 = this.keyId2;
ht = new Hashtable();
ht.Add("CONSTRUCTID", this.FLD_CONSTRUCTID.Value);
ht.Add("SESSIONUSERID", this.sessionUserId);
oBiz = new Biz.FW.FWXmlAutoBiz();
dsData = oBiz.XmlGetData("uspConstructDailyLastInfo__C004", ht);
if (dsData != null && dsData.Tables.Count > 0 && dsData.Tables[0].Rows.Count > 0)
{
this.keyId = Convert.ToInt32(dsData.Tables[0].Rows[0]["CONSTRUCTDAILYID"]); // 공사일보 일련번호
this.keyId2 = Convert.ToInt32(dsData.Tables[0].Rows[0]["CONSTRUCTID"]); // 공사 일련번호
}
}
#endregion
#region 기본정보
ht = new Hashtable();
ht.Add("CONSTRUCTDAILYID", this.keyId);
ht.Add("CONSTRUCTID", this.keyId2);
ht.Add("SESSIONUSERID", this.sessionUserId);
oBiz = new Biz.FW.FWXmlAutoBiz();
dsData = oBiz.XmlGetData("uspConstructDailyView__C004", ht);
if (dsData != null && dsData.Tables.Count > 0 && dsData.Tables[0].Rows.Count > 0)
{
this.FLD_CONSTRUCTID.Value = dsData.Tables[0].Rows[0]["CONSTRUCTID"].ToString(); // 공사 일련번호
this.FLD_CONSTRUCTNAME.Text = dsData.Tables[0].Rows[0]["CONSTRUCTNAME"].ToString(); // 공사명
// 최근정보불러오기에서 일자는 변경하지 않음.
if (getType != "LastInfoLoad")
this.FLD_CONSTRUCTDAILYDATE.Text = dsData.Tables[0].Rows[0]["CONSTRUCTDAILYDATE"].ToString(); // 일자
this.FLD_WEATHER.Text = dsData.Tables[0].Rows[0]["WEATHER"].ToString(); // 날씨
this.FLD_TODAYWORKPLAN.Text = dsData.Tables[0].Rows[0]["TODAYWORKPLAN"].ToString(); // 오늘작업계획
this.FLD_TODAYWORKRESULT.Text = dsData.Tables[0].Rows[0]["TODAYWORKRESULT"].ToString(); // 오늘작업실적
this.FLD_REMARK.Text = dsData.Tables[0].Rows[0]["REMARK"].ToString(); // 비고
this.FLD_TOMORROWWORKPLAN.Text = dsData.Tables[0].Rows[0]["TOMORROWWORKPLAN"].ToString(); // 내일작업계획
}
#endregion
#region 자재
ht = new Hashtable();
ht.Add("CONSTRUCTID", this.keyId2);
ht.Add("CONSTRUCTDAILYID", this.keyId);
ht.Add("PLAN_YN", "N");
ht.Add("SESSIONUSERID", this.sessionUserId);
// 최근정보불러오기에서 누계수량, 누계금액 셋팅을 위해서 추가(2016-06-15)
ht.Add("GETTYPE", getType);
oBiz = new Biz.FW.FWXmlAutoBiz();
dsData = oBiz.XmlGetData("uspMaterialList__C004", ht);
if (dsData != null && dsData.Tables.Count > 0 && dsData.Tables[0].Rows.Count > 0)
{
// 최근정보불러오기에서 자재 일련번호는 0 처리
if (getType == "LastInfoLoad")
{
dsData.Tables[0].Columns.Remove("MATERIALID");
dsData.Tables[0].Columns.Add("MATERIALID", typeof(System.Int32));
dsData.Tables[0].Columns["MATERIALID"].Expression = "0";
}
this.gvListMaterial.DataSource = dsData.Tables[0];
this.gvListMaterial.DataBind();
}
else
{
// 조회 결과 미 존재시 빈 Row 표시
DataTable dt_Material = new DataTable();
dt_Material.Columns.Add(new DataColumn("INPUTRESOURCENAME")); // 자재명
dt_Material.Columns.Add(new DataColumn("INPUTRESOURCEID")); // 자재ID
dt_Material.Columns.Add(new DataColumn("MATERIALID")); // 자재 투입 일련번호
dt_Material.Columns.Add(new DataColumn("SPECIFICATION")); // 규격
dt_Material.Columns.Add(new DataColumn("UNIT")); // 단위
dt_Material.Columns.Add(new DataColumn("UNITPRICE")); // 단가
dt_Material.Columns.Add(new DataColumn("INCOMPANY")); // 투입업체
dt_Material.Columns.Add(new DataColumn("VOLUME")); // 수량
dt_Material.Columns.Add(new DataColumn("PRICE")); // 금액
dt_Material.Columns.Add(new DataColumn("SUM_VOLUME")); // 누계수량
dt_Material.Columns.Add(new DataColumn("SUM_PRICE")); // 누계금액
dt_Material.Columns.Add(new DataColumn("SUM_VOLUME_")); // 누계수량(해당 Row의 수량을 뺀 값)
dt_Material.Columns.Add(new DataColumn("SUM_PRICE_")); // 누계금액(해당 Row의 금액을 뺀 값)
DataRow dr_Material;
dr_Material = dt_Material.NewRow();
dr_Material["INPUTRESOURCENAME"] = ""; // 자재명
dr_Material["INPUTRESOURCEID"] = ""; // 자재ID
dr_Material["MATERIALID"] = ""; // 자재 투입 일련번호
dr_Material["SPECIFICATION"] = ""; // 규격
dr_Material["UNIT"] = ""; // 단위
dr_Material["UNITPRICE"] = "0"; // 단가
dr_Material["INCOMPANY"] = ""; // 투입업체
dr_Material["VOLUME"] = "0"; // 수량
dr_Material["PRICE"] = "0"; // 금액
dr_Material["SUM_VOLUME"] = "0"; // 누계수량
dr_Material["SUM_PRICE"] = "0"; // 누계금액
dr_Material["SUM_VOLUME_"] = "0"; // 누계수량(해당 Row의 수량을 뺀 값)
dr_Material["SUM_PRICE_"] = "0"; // 누계금액(해당 Row의 금액을 뺀 값)
dt_Material.Rows.Add(dr_Material);
this.gvListMaterial.DataSource = dt_Material;
this.gvListMaterial.DataBind();
}
#endregion
#region 장비
ht = new Hashtable();
ht.Add("CONSTRUCTID", this.keyId2);
ht.Add("CONSTRUCTDAILYID", this.keyId);
ht.Add("PLAN_YN", "N");
ht.Add("SESSIONUSERID", this.sessionUserId);
// 최근정보불러오기에서 누계수량, 누계금액 셋팅을 위해서 추가(2016-06-15)
ht.Add("GETTYPE", getType);
oBiz = new Biz.FW.FWXmlAutoBiz();
dsData = oBiz.XmlGetData("uspEquipmentList__C004", ht);
if (dsData != null && dsData.Tables.Count > 0 && dsData.Tables[0].Rows.Count > 0)
{
// 최근정보불러오기에서 자재 일련번호는 0 처리
if (getType == "LastInfoLoad")
{
dsData.Tables[0].Columns.Remove("EQUIPMENTID");
dsData.Tables[0].Columns.Add("EQUIPMENTID", typeof(System.Int32));
dsData.Tables[0].Columns["EQUIPMENTID"].Expression = "0";
}
this.gvListEquipment.DataSource = dsData.Tables[0];
this.gvListEquipment.DataBind();
}
else
{
// 조회 결과 미 존재시 빈 Row 표시
DataTable dt_Equipment = new DataTable();
dt_Equipment.Columns.Add(new DataColumn("INPUTRESOURCENAME")); // 장비명
dt_Equipment.Columns.Add(new DataColumn("INPUTRESOURCEID")); // 장비ID
dt_Equipment.Columns.Add(new DataColumn("EQUIPMENTID")); // 장비 투입 일련번호
dt_Equipment.Columns.Add(new DataColumn("UNIT")); // 단위
dt_Equipment.Columns.Add(new DataColumn("UNITPRICE")); // 단가
dt_Equipment.Columns.Add(new DataColumn("VOLUME")); // 수량
dt_Equipment.Columns.Add(new DataColumn("PRICE")); // 금액
dt_Equipment.Columns.Add(new DataColumn("SUM_VOLUME")); // 누계수량
dt_Equipment.Columns.Add(new DataColumn("SUM_PRICE")); // 누계금액
dt_Equipment.Columns.Add(new DataColumn("SUM_VOLUME_")); // 누계수량(해당 Row의 수량을 뺀 값)
dt_Equipment.Columns.Add(new DataColumn("SUM_PRICE_")); // 누계금액(해당 Row의 금액을 뺀 값)
DataRow dr_Equipment;
dr_Equipment = dt_Equipment.NewRow();
dr_Equipment["INPUTRESOURCENAME"] = ""; // 장비명
dr_Equipment["INPUTRESOURCEID"] = ""; // 장비ID
dr_Equipment["EQUIPMENTID"] = ""; // 장비 투입 일련번호
dr_Equipment["UNIT"] = ""; // 단위
dr_Equipment["UNITPRICE"] = "0"; // 단가
dr_Equipment["VOLUME"] = "0"; // 수량
dr_Equipment["PRICE"] = "0"; // 금액
dr_Equipment["SUM_VOLUME"] = "0"; // 누계수량
dr_Equipment["SUM_PRICE"] = "0"; // 누계금액
dr_Equipment["SUM_VOLUME_"] = "0"; // 누계수량(해당 Row의 수량을 뺀 값)
dr_Equipment["SUM_PRICE_"] = "0"; // 누계금액(해당 Row의 금액을 뺀 값)
dt_Equipment.Rows.Add(dr_Equipment);
this.gvListEquipment.DataSource = dt_Equipment;
this.gvListEquipment.DataBind();
}
#endregion
#region 노무비
ht = new Hashtable();
ht.Add("CONSTRUCTID", this.keyId2);
ht.Add("CONSTRUCTDAILYID", this.keyId);
ht.Add("PLAN_YN", "N");
ht.Add("SESSIONUSERID", this.sessionUserId);
// 최근정보불러오기에서 누계수량, 누계금액 셋팅을 위해서 추가(2016-06-15)
ht.Add("GETTYPE", getType);
oBiz = new Biz.FW.FWXmlAutoBiz();
dsData = oBiz.XmlGetData("uspWorkerCostList__C004", ht);
if (dsData != null && dsData.Tables.Count > 0 && dsData.Tables[0].Rows.Count > 0)
{
// 최근정보불러오기에서 자재 일련번호는 0 처리
if (getType == "LastInfoLoad")
{
dsData.Tables[0].Columns.Remove("WORKERCOSTID");
dsData.Tables[0].Columns.Add("WORKERCOSTID", typeof(System.Int32));
dsData.Tables[0].Columns["WORKERCOSTID"].Expression = "0";
}
this.gvListWorkerCost.DataSource = dsData.Tables[0];
this.gvListWorkerCost.DataBind();
}
else
{
// 조회 결과 미 존재시 빈 Row 표시
DataTable dt_WorkerCost = new DataTable();
dt_WorkerCost.Columns.Add(new DataColumn("WORKERNAME")); // 근로자(이름)명
dt_WorkerCost.Columns.Add(new DataColumn("WORKERID")); // 근로자ID
dt_WorkerCost.Columns.Add(new DataColumn("WORKERCOSTID")); // 노부비 투입 일련번호
dt_WorkerCost.Columns.Add(new DataColumn("RESIDENT")); // 주민번호
dt_WorkerCost.Columns.Add(new DataColumn("UNITPRICE")); // 단가
dt_WorkerCost.Columns.Add(new DataColumn("WORKDAY")); // 투입일수
dt_WorkerCost.Columns.Add(new DataColumn("PRICE")); // 금액
dt_WorkerCost.Columns.Add(new DataColumn("SUM_WORKDAY")); // 누계수량
dt_WorkerCost.Columns.Add(new DataColumn("SUM_PRICE")); // 누계금액
dt_WorkerCost.Columns.Add(new DataColumn("SUM_WORKDAY_")); // 누계수량(해당 Row의 수량을 뺀 값)
dt_WorkerCost.Columns.Add(new DataColumn("SUM_PRICE_")); // 누계금액(해당 Row의 금액을 뺀 값)
DataRow dr_WorkerCost;
dr_WorkerCost = dt_WorkerCost.NewRow();
dr_WorkerCost["WORKERNAME"] = ""; // 근로자(이름)명
dr_WorkerCost["WORKERID"] = ""; // 근로자ID
dr_WorkerCost["WORKERCOSTID"] = ""; // 노부비 투입 일련번호
dr_WorkerCost["RESIDENT"] = ""; // 주민번호
dr_WorkerCost["UNITPRICE"] = "0"; // 단가
dr_WorkerCost["WORKDAY"] = "0"; // 투입일수
dr_WorkerCost["PRICE"] = "0"; // 금액
dr_WorkerCost["SUM_WORKDAY"] = "0"; // 누계수량
dr_WorkerCost["SUM_PRICE"] = "0"; // 누계금액
dr_WorkerCost["SUM_WORKDAY_"] = "0"; // 누계수량(해당 Row의 수량을 뺀 값)
dr_WorkerCost["SUM_PRICE_"] = "0"; // 누계금액(해당 Row의 금액을 뺀 값)
dt_WorkerCost.Rows.Add(dr_WorkerCost);
this.gvListWorkerCost.DataSource = dt_WorkerCost;
this.gvListWorkerCost.DataBind();
}
#endregion
#region 간접경비
ht = new Hashtable();
ht.Add("CONSTRUCTID", this.keyId2);
ht.Add("CONSTRUCTDAILYID", this.keyId);
ht.Add("PLAN_YN", "N");
ht.Add("SESSIONUSERID", this.sessionUserId);
// 최근정보불러오기에서 누계수량, 누계금액 셋팅을 위해서 추가(2016-06-15)
ht.Add("GETTYPE", getType);
oBiz = new Biz.FW.FWXmlAutoBiz();
dsData = oBiz.XmlGetData("uspIndirectExpenseList__C004", ht);
if (dsData != null && dsData.Tables.Count > 0 && dsData.Tables[0].Rows.Count > 0)
{
// 최근정보불러오기에서 자재 일련번호는 0 처리
if (getType == "LastInfoLoad")
{
dsData.Tables[0].Columns.Remove("INDIRECTEXPENSEID");
dsData.Tables[0].Columns.Add("INDIRECTEXPENSEID", typeof(System.Int32));
dsData.Tables[0].Columns["INDIRECTEXPENSEID"].Expression = "0";
}
this.gvListIndirectExpense.DataSource = dsData.Tables[0];
this.gvListIndirectExpense.DataBind();
}
else
{
// 조회 결과 미 존재시 빈 Row 표시
DataTable dt_IndirectExpense = new DataTable();
dt_IndirectExpense.Columns.Add(new DataColumn("INPUTRESOURCENAME")); // 장비명
dt_IndirectExpense.Columns.Add(new DataColumn("INPUTRESOURCEID")); // 장비ID
dt_IndirectExpense.Columns.Add(new DataColumn("INDIRECTEXPENSEID")); // 간접경비 투입 일련번호
dt_IndirectExpense.Columns.Add(new DataColumn("UNIT")); // 단위
dt_IndirectExpense.Columns.Add(new DataColumn("UNITPRICE")); // 단가
dt_IndirectExpense.Columns.Add(new DataColumn("VOLUME")); // 수량
dt_IndirectExpense.Columns.Add(new DataColumn("PRICE")); // 금액
dt_IndirectExpense.Columns.Add(new DataColumn("SUM_VOLUME")); // 누계수량
dt_IndirectExpense.Columns.Add(new DataColumn("SUM_PRICE")); // 누계금액
dt_IndirectExpense.Columns.Add(new DataColumn("SUM_VOLUME_")); // 누계수량(해당 Row의 수량을 뺀 값)
dt_IndirectExpense.Columns.Add(new DataColumn("SUM_PRICE_")); // 누계금액(해당 Row의 금액을 뺀 값)
DataRow dr_IndirectExpense;
dr_IndirectExpense = dt_IndirectExpense.NewRow();
dr_IndirectExpense["INPUTRESOURCENAME"] = ""; // 장비명
dr_IndirectExpense["INPUTRESOURCEID"] = ""; // 장비ID
dr_IndirectExpense["INDIRECTEXPENSEID"] = ""; // 간접경비 투입 일련번호
dr_IndirectExpense["UNIT"] = ""; // 단위
dr_IndirectExpense["UNITPRICE"] = "0"; // 단가
dr_IndirectExpense["VOLUME"] = "0"; // 수량
dr_IndirectExpense["PRICE"] = "0"; // 금액
dr_IndirectExpense["SUM_VOLUME"] = "0"; // 누계수량
dr_IndirectExpense["SUM_PRICE"] = "0"; // 누계금액
dr_IndirectExpense["SUM_VOLUME_"] = "0"; // 누계수량(해당 Row의 수량을 뺀 값)
dr_IndirectExpense["SUM_PRICE_"] = "0"; // 누계금액(해당 Row의 금액을 뺀 값)
dt_IndirectExpense.Rows.Add(dr_IndirectExpense);
this.gvListIndirectExpense.DataSource = dt_IndirectExpense;
this.gvListIndirectExpense.DataBind();
}
#endregion
#region 외주비
ht = new Hashtable();
ht.Add("CONSTRUCTID", this.keyId2);
ht.Add("CONSTRUCTDAILYID", this.keyId);
ht.Add("PLAN_YN", "N");
ht.Add("SESSIONUSERID", this.sessionUserId);
// 최근정보불러오기에서 누계수량, 누계금액 셋팅을 위해서 추가(2016-06-15)
ht.Add("GETTYPE", getType);
oBiz = new Biz.FW.FWXmlAutoBiz();
dsData = oBiz.XmlGetData("uspOutsideOrderExpenseList__C004", ht);
if (dsData != null && dsData.Tables.Count > 0 && dsData.Tables[0].Rows.Count > 0)
{
// 최근정보불러오기에서 자재 일련번호는 0 처리
if (getType == "LastInfoLoad")
{
dsData.Tables[0].Columns.Remove("OUTSIDEORDEREXPENSEID");
dsData.Tables[0].Columns.Add("OUTSIDEORDEREXPENSEID", typeof(System.Int32));
dsData.Tables[0].Columns["OUTSIDEORDEREXPENSEID"].Expression = "0";
}
this.gvListOutsideOrderExpense.DataSource = dsData.Tables[0];
this.gvListOutsideOrderExpense.DataBind();
}
else
{
// 조회 결과 미 존재시 빈 Row 표시
DataTable dt_OutsideOrderExpense = new DataTable();
dt_OutsideOrderExpense.Columns.Add(new DataColumn("INPUTRESOURCENAME")); // 장비명
dt_OutsideOrderExpense.Columns.Add(new DataColumn("INPUTRESOURCEID")); // 장비ID
dt_OutsideOrderExpense.Columns.Add(new DataColumn("OUTSIDEORDEREXPENSEID")); // 외주비 투입 일련번호
dt_OutsideOrderExpense.Columns.Add(new DataColumn("UNIT")); // 단위
dt_OutsideOrderExpense.Columns.Add(new DataColumn("UNITPRICE")); // 단가
dt_OutsideOrderExpense.Columns.Add(new DataColumn("VOLUME")); // 수량
dt_OutsideOrderExpense.Columns.Add(new DataColumn("PRICE")); // 금액
dt_OutsideOrderExpense.Columns.Add(new DataColumn("SUM_VOLUME")); // 누계수량
dt_OutsideOrderExpense.Columns.Add(new DataColumn("SUM_PRICE")); // 누계금액
dt_OutsideOrderExpense.Columns.Add(new DataColumn("SUM_VOLUME_")); // 누계수량(해당 Row의 수량을 뺀 값)
dt_OutsideOrderExpense.Columns.Add(new DataColumn("SUM_PRICE_")); // 누계금액(해당 Row의 금액을 뺀 값)
DataRow dr_OutsideOrderExpense;
dr_OutsideOrderExpense = dt_OutsideOrderExpense.NewRow();
dr_OutsideOrderExpense["INPUTRESOURCENAME"] = ""; // 장비명
dr_OutsideOrderExpense["INPUTRESOURCEID"] = ""; // 장비ID
dr_OutsideOrderExpense["OUTSIDEORDEREXPENSEID"] = ""; // 외주비 투입 일련번호
dr_OutsideOrderExpense["UNIT"] = ""; // 단위
dr_OutsideOrderExpense["UNITPRICE"] = "0"; // 단가
dr_OutsideOrderExpense["VOLUME"] = "0"; // 수량
dr_OutsideOrderExpense["PRICE"] = "0"; // 금액
dr_OutsideOrderExpense["SUM_VOLUME"] = "0"; // 누계수량
dr_OutsideOrderExpense["SUM_PRICE"] = "0"; // 누계금액
dr_OutsideOrderExpense["SUM_VOLUME_"] = "0"; // 누계수량(해당 Row의 수량을 뺀 값)
dr_OutsideOrderExpense["SUM_PRICE_"] = "0"; // 누계금액(해당 Row의 금액을 뺀 값)
dt_OutsideOrderExpense.Rows.Add(dr_OutsideOrderExpense);
this.gvListOutsideOrderExpense.DataSource = dt_OutsideOrderExpense;
this.gvListOutsideOrderExpense.DataBind();
}
#endregion
#region 총계
ht = new Hashtable();
ht.Add("CONSTRUCTDAILYID", this.keyId);
ht.Add("CONSTRUCTID", this.keyId2);
ht.Add("SESSIONUSERID", this.sessionUserId);
// 최근정보불러오기에서 누계수량, 누계금액 셋팅을 위해서 추가(2016-06-15)
ht.Add("PLAN_YN", "N");
ht.Add("GETTYPE", getType);
oBiz = new Biz.FW.FWXmlAutoBiz();
dsData = oBiz.XmlGetData("uspConstructAmountView__C004", ht);
if (dsData != null && dsData.Tables.Count > 0 && dsData.Tables[0].Rows.Count > 0)
{
this.FLD_CONSTRUCTAMOUNTID.Value = dsData.Tables[0].Rows[0]["CONSTRUCTAMOUNTID"].ToString();
this.FLD_CONSTRUCTAMOUNT.Text = dsData.Tables[0].Rows[0]["CONSTRUCTAMOUNT_"].ToString();
this.FLD_CHANGECONSTRUCTAMOUNT.Text = dsData.Tables[0].Rows[0]["CHANGECONSTRUCTAMOUNT_"].ToString();
this.FLD_SUMAMOUNTTOTAL.Text = dsData.Tables[0].Rows[0]["SUMAMOUNTTOTAL"].ToString();
this.hdnSumAmountTotal.Value = dsData.Tables[0].Rows[0]["SUMAMOUNTTOTAL_"].ToString();
}
else
{
this.FLD_CONSTRUCTAMOUNT.Text = "0";
this.FLD_CHANGECONSTRUCTAMOUNT.Text = "0";
this.FLD_PLANAMOUNTTOTAL.Text = "0";
this.FLD_SUMAMOUNTTOTAL.Text = "0";
this.FLD_MARGIN.Text = "0";
this.FLD_MARGIN_PER.Text = "0";
}
#endregion
#region 오늘작업계획
ht = new Hashtable();
ht.Add("CONSTRUCTDAILYID", this.keyId);
ht.Add("SESSIONUSERID", this.sessionUserId);
oBiz = new Biz.FW.FWXmlAutoBiz();
dsData = oBiz.XmlGetData("uspTodayWorkPlanList__C004", ht);
if (dsData != null && dsData.Tables.Count > 0 && dsData.Tables[0].Rows.Count > 0)
{
var list = new List<Dictionary<string, object>>();
foreach (DataRow row in dsData.Tables[0].Rows)
{
var dict = new Dictionary<string, object>();
foreach (DataColumn col in dsData.Tables[0].Columns)
{
dict[col.ColumnName] = (Convert.ToString(row[col]));
}
list.Add(dict);
}
JavaScriptSerializer serializer = new JavaScriptSerializer();
this.hdnDivTodayWorkPlan.Value = serializer.Serialize(list);
}
#endregion
#region 오늘작업실적
ht = new Hashtable();
ht.Add("CONSTRUCTDAILYID", this.keyId);
ht.Add("SESSIONUSERID", this.sessionUserId);
oBiz = new Biz.FW.FWXmlAutoBiz();
dsData = oBiz.XmlGetData("uspTodayWorkResultList__C004", ht);
if (dsData != null && dsData.Tables.Count > 0 && dsData.Tables[0].Rows.Count > 0)
{
var list = new List<Dictionary<string, object>>();
foreach (DataRow row in dsData.Tables[0].Rows)
{
var dict = new Dictionary<string, object>();
foreach (DataColumn col in dsData.Tables[0].Columns)
{
dict[col.ColumnName] = (Convert.ToString(row[col]));
}
list.Add(dict);
}
JavaScriptSerializer serializer = new JavaScriptSerializer();
this.hdnDivTodayWorkResult.Value = serializer.Serialize(list);
}
#endregion
#region 최근 정보 불러오기 기능 추가 (2016-06-15)
if (getType == "LastInfoLoad")
{
this.keyId = keyId_temp1;
this.keyId2 = keyId_temp2;
}
#endregion
}
catch (Exception ex)
{
ExceptionRun.ErrHandle(ex);
}
finally
{
if (oBiz != null)
{
oBiz = null;
}
}
}
#endregion
#region btnSave_Click() : 저장
/// <summary>
/// Method 명: btnSave_Click()
/// Method내용: 공사일보 저장
/// 작 성 자:
/// 최초작성일: 2016-03-11
/// 최종수정자:
/// 최종수정일:
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <returns>
/// </returns>
protected void btnSave_Click(object sender, EventArgs e)
{
// 포스트백 이벤트 로그 기록
this.LogWritePostback((Control)sender);
Biz.FW.FWXmlAutoBizTx oBiz = null;
Hashtable ht;
JavaScriptSerializer ser;
List<Dictionary<string, object>> dict;
// 결과 반환값
string pKey = string.Empty;
int iResult = 0;
int iResult_Grid = 0;
try
{
// 최초 등록 일경우에는 공사 일련번호가 존재하지 않음으로 셋팅
if(this.keyId2 == 0)
this.keyId2 = Convert.ToInt32(this.FLD_CONSTRUCTID.Value);
#region 기본정보 및 그리드 정보
ht = new Hashtable();
ht["CONSTRUCTDAILYDATE"] = this.FLD_CONSTRUCTDAILYDATE.Text; // 일자
ht["WEATHER"] = this.FLD_WEATHER.Text; // 날씨
ht["TODAYWORKPLAN"] = this.FLD_TODAYWORKPLAN.Text; // 오늘작업계획
ht["TODAYWORKRESULT"] = this.FLD_TODAYWORKRESULT.Text; // 오늘작업실적
ht["REMARK"] = this.FLD_REMARK.Text; // 비고
ht["TOMORROWWORKPLAN"] = this.FLD_TOMORROWWORKPLAN.Text; // 내일작업계획
ht.Add("CONSTRUCTDAILYID", this.keyId); // 공사 일보 일련번호
ht.Add("CONSTRUCTID", this.keyId2); // 공사 일련번호
ht.Add("SESSIONUSERID", this.sessionUserId);
// 저장
oBiz = new Biz.FW.FWXmlAutoBizTx();
iResult = oBiz.XmlNonExecuteWithPK("uspConstructDailyWrite__C004", ht, out pKey);
if (iResult > 0)
{
this.keyId = Convert.ToInt32(pKey);
#region 자재
ser = new JavaScriptSerializer();
dict = ser.Deserialize<List<Dictionary<string, object>>>(this.hdnMATERIALResultData.Value);
for (int i_Material = 0; i_Material < dict.Count; i_Material++)
{
ht = new Hashtable();
ht.Add("MATERIALID", dict[i_Material]["MATERIALID"].ToString()); // 자재 일련번호
ht.Add("INPUTRESOURCEID", dict[i_Material]["INPUTRESOURCEID"].ToString()); // 자재코드
ht.Add("UNITPRICE", dict[i_Material]["UNITPRICE"].ToString().Replace(",", "")); // 단가
ht.Add("INCOMPANY", dict[i_Material]["INCOMPANY"].ToString()); // 투입업체
ht.Add("VOLUME", dict[i_Material]["VOLUME"].ToString().Replace(",", "")); // 수량
ht.Add("PRICE", dict[i_Material]["PRICE"].ToString().Replace(",", "")); // 금액
ht.Add("PLAN_YN", "N"); // Plan_YN(Y : 실행내역정보, N : 공사일보정보)
ht.Add("STATUS_GUBUN", dict[i_Material]["STATUS_GUBUN"].ToString()); // STATUS_GUBUN (I : 등록, U : 수정, D : 삭제)
ht.Add("CONSTRUCTDAILYID", pKey); // 공사 일보 일련번호
ht.Add("CONSTRUCTID", this.keyId2); // 공사 일련번호
ht.Add("SESSIONUSERID", this.sessionUserId);
oBiz = new Biz.FW.FWXmlAutoBizTx();
iResult_Grid = oBiz.XmlNonExecute("uspMaterialWriteDelete__C004", ht);
}
#endregion
#region 장비
ser = new JavaScriptSerializer();
dict = ser.Deserialize<List<Dictionary<string, object>>>(this.hdnEQUIPMENTResultData.Value);
for (int i_Equipment = 0; i_Equipment < dict.Count; i_Equipment++)
{
ht = new Hashtable();
ht.Add("EQUIPMENTID", dict[i_Equipment]["EQUIPMENTID"].ToString()); // 장비 일련번호
ht.Add("INPUTRESOURCEID", dict[i_Equipment]["INPUTRESOURCEID"].ToString()); // 자재코드
ht.Add("UNITPRICE", dict[i_Equipment]["UNITPRICE"].ToString().Replace(",", "")); // 단가
ht.Add("VOLUME", dict[i_Equipment]["VOLUME"].ToString().Replace(",", "")); // 수량
ht.Add("PRICE", dict[i_Equipment]["PRICE"].ToString().Replace(",", "")); // 금액
ht.Add("PLAN_YN", "N"); // Plan_YN(Y : 실행내역정보, N : 공사일보정보)
ht.Add("STATUS_GUBUN", dict[i_Equipment]["STATUS_GUBUN"].ToString()); // STATUS_GUBUN (I : 등록, U : 수정, D : 삭제)
ht.Add("CONSTRUCTDAILYID", pKey); // 공사 일보 일련번호
ht.Add("CONSTRUCTID", this.keyId2); // 공사 일련번호
ht.Add("SESSIONUSERID", this.sessionUserId);
oBiz = new Biz.FW.FWXmlAutoBizTx();
iResult_Grid = oBiz.XmlNonExecute("uspEquipmentWriteDelete__C004", ht);
}
#endregion
#region 노무비
ser = new JavaScriptSerializer();
dict = ser.Deserialize<List<Dictionary<string, object>>>(this.hdnWORKERCOSTResultData.Value);
for (int i_WorkerCost = 0; i_WorkerCost < dict.Count; i_WorkerCost++)
{
ht = new Hashtable();
ht.Add("WORKERCOSTID", dict[i_WorkerCost]["WORKERCOSTID"].ToString()); // 노무비 일련번호
ht.Add("WORKERID", dict[i_WorkerCost]["WORKERID"].ToString()); // 근로자코드
ht.Add("UNITPRICE", dict[i_WorkerCost]["UNITPRICE"].ToString().Replace(",", "")); // 단가
ht.Add("WORKDAY", dict[i_WorkerCost]["WORKDAY"].ToString()); // 투입일수
ht.Add("PRICE", dict[i_WorkerCost]["PRICE"].ToString().Replace(",", "")); // 금액
ht.Add("PLAN_YN", "N"); // Plan_YN(Y : 실행내역정보, N : 공사일보정보)
ht.Add("STATUS_GUBUN", dict[i_WorkerCost]["STATUS_GUBUN"].ToString()); // STATUS_GUBUN (I : 등록, U : 수정, D : 삭제)
ht.Add("CONSTRUCTDAILYID", pKey); // 공사 일보 일련번호
ht.Add("CONSTRUCTID", this.keyId2); // 공사 일련번호
ht.Add("SESSIONUSERID", this.sessionUserId);
oBiz = new Biz.FW.FWXmlAutoBizTx();
iResult_Grid = oBiz.XmlNonExecute("uspWorkerCostWriteDelete__C004", ht);
}
#endregion
#region 간접경비
ser = new JavaScriptSerializer();
dict = ser.Deserialize<List<Dictionary<string, object>>>(this.hdnINDIRECTEXPENSEResultData.Value);
for (int i_IndirectExpense = 0; i_IndirectExpense < dict.Count; i_IndirectExpense++)
{
ht = new Hashtable();
ht.Add("INDIRECTEXPENSEID", dict[i_IndirectExpense]["INDIRECTEXPENSEID"].ToString()); // 간접경비 일련번호
ht.Add("INPUTRESOURCEID", dict[i_IndirectExpense]["INPUTRESOURCEID"].ToString()); // 자재코드
// 간접경비 단가, 수량 누계수량이 제거 되면서 주석 (2016-06-15)
//ht.Add("UNITPRICE", dict[i_IndirectExpense]["UNITPRICE"].ToString().Replace(",", "")); // 단가
//ht.Add("VOLUME", dict[i_IndirectExpense]["VOLUME"].ToString().Replace(",", "")); // 수량
ht.Add("PRICE", dict[i_IndirectExpense]["PRICE"].ToString().Replace(",", "")); // 금액
ht.Add("PLAN_YN", "N"); // Plan_YN(Y : 실행내역정보, N : 공사일보정보)
ht.Add("STATUS_GUBUN", dict[i_IndirectExpense]["STATUS_GUBUN"].ToString()); // STATUS_GUBUN (I : 등록, U : 수정, D : 삭제)
ht.Add("CONSTRUCTDAILYID", pKey); // 공사 일보 일련번호
ht.Add("CONSTRUCTID", this.keyId2); // 공사 일련번호
ht.Add("SESSIONUSERID", this.sessionUserId);
oBiz = new Biz.FW.FWXmlAutoBizTx();
iResult_Grid = oBiz.XmlNonExecute("uspIndirectExpenseWriteDelete__C004", ht);
}
#endregion
#region 외주비
ser = new JavaScriptSerializer();
dict = ser.Deserialize<List<Dictionary<string, object>>>(this.hdnOUTSIDEORDEREXPENSEResultData.Value);
for (int i_OutsideOrderExpense = 0; i_OutsideOrderExpense < dict.Count; i_OutsideOrderExpense++)
{
ht = new Hashtable();
ht.Add("OUTSIDEORDEREXPENSEID", dict[i_OutsideOrderExpense]["OUTSIDEORDEREXPENSEID"].ToString()); // 외주비 일련번호
ht.Add("INPUTRESOURCEID", dict[i_OutsideOrderExpense]["INPUTRESOURCEID"].ToString()); // 자재코드
ht.Add("UNITPRICE", dict[i_OutsideOrderExpense]["UNITPRICE"].ToString().Replace(",", "")); // 단가
ht.Add("VOLUME", dict[i_OutsideOrderExpense]["VOLUME"].ToString().Replace(",", "")); // 수량
ht.Add("PRICE", dict[i_OutsideOrderExpense]["PRICE"].ToString().Replace(",", "")); // 금액
ht.Add("PLAN_YN", "N"); // Plan_YN(Y : 실행내역정보, N : 공사일보정보)
ht.Add("STATUS_GUBUN", dict[i_OutsideOrderExpense]["STATUS_GUBUN"].ToString()); // STATUS_GUBUN (I : 등록, U : 수정, D : 삭제)
ht.Add("CONSTRUCTDAILYID", pKey); // 공사 일보 일련번호
ht.Add("CONSTRUCTID", this.keyId2); // 공사 일련번호
ht.Add("SESSIONUSERID", this.sessionUserId);
oBiz = new Biz.FW.FWXmlAutoBizTx();
iResult_Grid = oBiz.XmlNonExecute("uspOutsideOrderExpenseWriteDelete__C004", ht);
}
#endregion
#region 오늘작업계획
// DB의 내용 삭제
ht = new Hashtable();
ht.Add("CONSTRUCTDAILYID", pKey); // 공사 일보 일련번호
oBiz = new Biz.FW.FWXmlAutoBizTx();
iResult_Grid = oBiz.XmlNonExecute("uspTodayWorkPlanDelete__C004", ht);
// DB에 내용 저작
ht = new Hashtable();
ht.Add("CONSTRUCTDAILYID", pKey); // 공사 일보 일련번호
ht.Add("TODAYWORKPLAN", this.hdnDivTodayWorkPlan.Value); // 오늘작업계획
ht.Add("SESSIONUSERID", this.sessionUserId);
oBiz = new Biz.FW.FWXmlAutoBizTx();
iResult_Grid = oBiz.XmlNonExecute("uspTodayWorkPlanWrite__C004", ht);
#endregion
#region 오늘작업실적
// DB의 내용 삭제
ht = new Hashtable();
ht.Add("CONSTRUCTDAILYID", pKey); // 공사 일보 일련번호
oBiz = new Biz.FW.FWXmlAutoBizTx();
iResult_Grid = oBiz.XmlNonExecute("uspTodayWorkResultDelete__C004", ht);
// DB에 내용 저작
ht = new Hashtable();
ht.Add("CONSTRUCTDAILYID", pKey); // 공사 일보 일련번호
ht.Add("TODAYWORKRESULT", this.hdnDivTodayWorkResult.Value); // 오늘작업실적
ht.Add("SESSIONUSERID", this.sessionUserId);
oBiz = new Biz.FW.FWXmlAutoBizTx();
iResult_Grid = oBiz.XmlNonExecute("uspTodayWorkResultWrite__C004", ht);
#endregion
}
#endregion
this.LogWritePostback((Control)sender, "keyId=" + EncryptKey(this.keyId));
if (iResult > 0)
{
this.GoView();
}
}
catch (Exception ex)
{
ExceptionRun.ErrHandle(ex);
}
finally
{
if (oBiz != null)
{
oBiz = null;
}
}
}
#endregion
#region RowDataBound_Material : 자재 그리드 합계
int Total_Price_Material = 0; // 금액
int Total_Sum_Price_Material = 0; // 누계금액
protected void RowDataBound_Material(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow )
{
DataRow dr = ((System.Data.DataRowView)e.Row.DataItem).Row;
// 금액
int price = 0;
// 누계금액
int sumPrice = 0;
bool chkPrice = int.TryParse(dr["PRICE"].ToString().Replace(",", ""), out price);
if (chkPrice)
{
Total_Price_Material += price;
}
bool chksumPrice = int.TryParse(dr["SUM_PRICE"].ToString().Replace(",", ""), out sumPrice);
if (chksumPrice)
{
Total_Sum_Price_Material += sumPrice;
}
}
else if (e.Row.RowType == DataControlRowType.Footer)
{
e.Row.Cells.RemoveAt(1);
e.Row.Cells.RemoveAt(1);
e.Row.Cells.RemoveAt(1);
e.Row.Cells.RemoveAt(1);
e.Row.Cells.RemoveAt(1);
e.Row.Cells[0].ColumnSpan = 6;
e.Row.Cells[0].Text = "금일투입금액";
e.Row.Cells[2].Text = "누계투입금액";
e.Row.Cells[0].HorizontalAlign = HorizontalAlign.Center;
e.Row.Cells[2].HorizontalAlign = HorizontalAlign.Center;
Label lblPRICE = (Label)e.Row.FindControl("lblTotalPRICE");
lblPRICE.Text = SetComma(Total_Price_Material);
Label lblSUM_PRICE = (Label)e.Row.FindControl("lblTotalSUM_PRICE");
lblSUM_PRICE.Text = SetComma(Total_Sum_Price_Material);
}
}
#endregion
#region RowDataBound_Equipment : 장비 그리드 합계
int Total_Price_Equipment = 0; // 금액
int Total_Sum_Price_Equipment = 0; // 누계금액
protected void RowDataBound_Equipment(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DataRow dr = ((System.Data.DataRowView)e.Row.DataItem).Row;
// 금액
int price = 0;
// 누계금액
int sumPrice = 0;
bool chkPrice = int.TryParse(dr["PRICE"].ToString().Replace(",", ""), out price);
if (chkPrice)
{
Total_Price_Equipment += price;
}
bool chksumPrice = int.TryParse(dr["SUM_PRICE"].ToString().Replace(",", ""), out sumPrice);
if (chksumPrice)
{
Total_Sum_Price_Equipment += sumPrice;
}
}
else if (e.Row.RowType == DataControlRowType.Footer)
{
e.Row.Cells.RemoveAt(1);
e.Row.Cells.RemoveAt(1);
e.Row.Cells.RemoveAt(1);
e.Row.Cells[0].ColumnSpan = 4;
e.Row.Cells[0].Text = "금일투입금액";
e.Row.Cells[2].Text = "누계투입금액";
e.Row.Cells[0].HorizontalAlign = HorizontalAlign.Center;
e.Row.Cells[2].HorizontalAlign = HorizontalAlign.Center;
Label lblPRICE = (Label)e.Row.FindControl("lblTotalPRICE");
lblPRICE.Text = SetComma(Total_Price_Equipment);
Label lblSUM_PRICE = (Label)e.Row.FindControl("lblTotalSUM_PRICE");
lblSUM_PRICE.Text = SetComma(Total_Sum_Price_Equipment);
}
}
#endregion
#region RowDataBound_WorkerCost : 노무비 그리드 합계
decimal Total_Price_WorkerCost = 0; // 금액
int Total_Sum_Price_WorkerCost = 0; // 누계금액
protected void RowDataBound_WorkerCost(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DataRow dr = ((System.Data.DataRowView)e.Row.DataItem).Row;
// 투입일수 콤보 셋팅
DropDownList ddlWORKDAY = (e.Row.FindControl("ddlWORKDAY") as DropDownList);
ddlWORKDAY.Items.AddRange(this.GetCodeList("1260", "select"));
ddlWORKDAY.Attributes["onchange"] = "workDayFN(this, '" + this.gvListWorkerCost.ID.ToString() + "');";
ddlWORKDAY.SelectedValue = dr["WORKDAY"].ToString();
// 금액
decimal price = 0;
// 누계금액
int sumPrice = 0;
bool chkPrice = decimal.TryParse(dr["PRICE"].ToString().Replace(",", ""), out price);
if (chkPrice)
{
Total_Price_WorkerCost += price;
}
bool chksumPrice = int.TryParse(dr["SUM_PRICE"].ToString().Replace(",", ""), out sumPrice);
if (chksumPrice)
{
Total_Sum_Price_WorkerCost += sumPrice;
}
}
else if (e.Row.RowType == DataControlRowType.Footer)
{
e.Row.Cells.RemoveAt(1);
e.Row.Cells.RemoveAt(1);
e.Row.Cells.RemoveAt(1);
e.Row.Cells[0].ColumnSpan = 4;
e.Row.Cells[0].Text = "금일투입금액";
e.Row.Cells[2].Text = "누계투입금액";
e.Row.Cells[0].HorizontalAlign = HorizontalAlign.Center;
e.Row.Cells[2].HorizontalAlign = HorizontalAlign.Center;
Label lblPRICE = (Label)e.Row.FindControl("lblTotalPRICE");
lblPRICE.Text = SetComma(Total_Price_WorkerCost);
Label lblSUM_PRICE = (Label)e.Row.FindControl("lblTotalSUM_PRICE");
lblSUM_PRICE.Text = SetComma(Total_Sum_Price_WorkerCost);
}
}
#endregion
#region RowDataBound_IndirectExpense : 간접경비 그리드 합계
int Total_Price_IndirectExpense = 0; // 금액
int Total_Sum_Price_IndirectExpense = 0; // 누계금액
protected void RowDataBound_IndirectExpense(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DataRow dr = ((System.Data.DataRowView)e.Row.DataItem).Row;
// 금액
int price = 0;
// 누계금액
int sumPrice = 0;
bool chkPrice = int.TryParse(dr["PRICE"].ToString().Replace(",", ""), out price);
if (chkPrice)
{
Total_Price_IndirectExpense += price;
}
bool chksumPrice = int.TryParse(dr["SUM_PRICE"].ToString().Replace(",", ""), out sumPrice);
if (chksumPrice)
{
Total_Sum_Price_IndirectExpense += sumPrice;
}
}
else if (e.Row.RowType == DataControlRowType.Footer)
{
/* 간접경비 단가, 수량, 누계수량 제거로 인해서 주석 후 수정 (2016-06-15)
e.Row.Cells.RemoveAt(1);
e.Row.Cells.RemoveAt(1);
e.Row.Cells.RemoveAt(1);
e.Row.Cells[0].ColumnSpan = 4;
e.Row.Cells[0].Text = "금일투입금액";
e.Row.Cells[2].Text = "누계투입금액";
e.Row.Cells[0].HorizontalAlign = HorizontalAlign.Center;
e.Row.Cells[2].HorizontalAlign = HorizontalAlign.Center;
Label lblPRICE = (Label)e.Row.FindControl("lblTotalPRICE");
lblPRICE.Text = SetComma(Total_Price_IndirectExpense);
Label lblSUM_PRICE = (Label)e.Row.FindControl("lblTotalSUM_PRICE");
lblSUM_PRICE.Text = SetComma(Total_Sum_Price_IndirectExpense);
*/
e.Row.Cells.RemoveAt(1);
e.Row.Cells[0].ColumnSpan = 2;
e.Row.Cells[0].Text = "금일투입금액(누계투입금액)";
e.Row.Cells[0].HorizontalAlign = HorizontalAlign.Center;
Label lblPRICE = (Label)e.Row.FindControl("lblTotalPRICE");
lblPRICE.Text = SetComma(Total_Price_IndirectExpense);
Label lblSUM_PRICE = (Label)e.Row.FindControl("lblTotalSUM_PRICE");
lblSUM_PRICE.Text = SetComma(Total_Sum_Price_IndirectExpense);
}
}
#endregion
#region RowDataBound_OutsideOrderExpense : 외주비 그리드 합계
int Total_Price_OutsideOrderExpense = 0; // 금액
int Total_Sum_Price_OutsideOrderExpense = 0; // 누계금액
protected void RowDataBound_OutsideOrderExpense(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DataRow dr = ((System.Data.DataRowView)e.Row.DataItem).Row;
// 금액
int price = 0;
// 누계금액
int sumPrice = 0;
bool chkPrice = int.TryParse(dr["PRICE"].ToString().Replace(",", ""), out price);
if (chkPrice)
{
Total_Price_OutsideOrderExpense += price;
}
bool chksumPrice = int.TryParse(dr["SUM_PRICE"].ToString().Replace(",", ""), out sumPrice);
if (chksumPrice)
{
Total_Sum_Price_OutsideOrderExpense += sumPrice;
}
}
else if (e.Row.RowType == DataControlRowType.Footer)
{
e.Row.Cells.RemoveAt(1);
e.Row.Cells.RemoveAt(1);
e.Row.Cells.RemoveAt(1);
e.Row.Cells[0].ColumnSpan = 4;
e.Row.Cells[0].Text = "금일투입금액";
e.Row.Cells[2].Text = "누계투입금액";
e.Row.Cells[0].HorizontalAlign = HorizontalAlign.Center;
e.Row.Cells[2].HorizontalAlign = HorizontalAlign.Center;
Label lblPRICE = (Label)e.Row.FindControl("lblTotalPRICE");
lblPRICE.Text = SetComma(Total_Price_OutsideOrderExpense);
Label lblSUM_PRICE = (Label)e.Row.FindControl("lblTotalSUM_PRICE");
lblSUM_PRICE.Text = SetComma(Total_Sum_Price_OutsideOrderExpense);
}
}
#endregion
#region 해당 공사의 해당 투입자원에 관한 누계수량, 누계금액 추출
[System.Web.Services.WebMethod]
public static string GetSum_Volume_Price(object items)
{
string result = string.Empty;
// 리스트 형식
List<object> lstItems = new JavaScriptSerializer().ConvertToType<List<object>>(items);
for (int i = 0; i < lstItems.Count; i++)
{
Biz.FW.FWXmlAutoBiz oBiz = null;
Hashtable ht = new Hashtable();
DataSet dsData = null;
foreach (KeyValuePair<string, object> kvp in (IEnumerable)lstItems[i])
{
ht.Add(kvp.Key, kvp.Value.ToString());
}
ht.Add("PLAN_YN", "N");
oBiz = new Biz.FW.FWXmlAutoBiz();
dsData = oBiz.XmlGetData("uspSumVolumePriceView__C004", ht);
if (dsData != null && dsData.Tables.Count > 0 && dsData.Tables[0].Rows.Count > 0)
{
var list = new List<Dictionary<string, object>>();
foreach (DataRow row in dsData.Tables[0].Rows)
{
var dict = new Dictionary<string, object>();
foreach (DataColumn col in dsData.Tables[0].Columns)
{
dict[col.ColumnName] = (Convert.ToString(row[col]));
}
list.Add(dict);
}
JavaScriptSerializer serializer = new JavaScriptSerializer();
result = serializer.Serialize(list);
}
}
return result;
}
#endregion
#region 해당 공사의 해당 투입자원에 관한 누계수량, 누계금액 추출
[System.Web.Services.WebMethod]
public static string GetConstructDailyDup(object items)
{
string result = string.Empty;
// 리스트 형식
List<object> lstItems = new JavaScriptSerializer().ConvertToType<List<object>>(items);
for (int i = 0; i < lstItems.Count; i++)
{
Biz.FW.FWXmlAutoBiz oBiz = null;
Hashtable ht = new Hashtable();
DataSet dsData = null;
foreach (KeyValuePair<string, object> kvp in (IEnumerable)lstItems[i])
{
ht.Add(kvp.Key, kvp.Value.ToString());
}
ht.Add("PLAN_YN", "N");
oBiz = new Biz.FW.FWXmlAutoBiz();
dsData = oBiz.XmlGetData("uspConstructDailyDup__C004", ht);
if (dsData != null && dsData.Tables.Count > 0 && dsData.Tables[0].Rows.Count > 0)
{
var list = new List<Dictionary<string, object>>();
foreach (DataRow row in dsData.Tables[0].Rows)
{
var dict = new Dictionary<string, object>();
foreach (DataColumn col in dsData.Tables[0].Columns)
{
dict[col.ColumnName] = (Convert.ToString(row[col]));
}
list.Add(dict);
}
JavaScriptSerializer serializer = new JavaScriptSerializer();
result = serializer.Serialize(list);
}
}
return result;
}
#endregion
#region btnLastInfoLoad_Click() : 최근 정보 불러오기
/// <summary>
/// Method 명: btnLastInfoLoad_Click()
/// Method내용: 최근 정보 불러오기
/// 작 성 자:
/// 최초작성일: 2016-06-15
/// 최종수정자:
/// 최종수정일:
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <returns>
/// </returns>
protected void btnLastInfoLoad_Click(object sender, EventArgs e)
{
// 데이터 가져오기
this.GetDetail("LastInfoLoad");
}
#endregion
}
}
이상으로 .net Html, GridView jquery이용하여 추가 삭제 구현에 관해서 알아보았습니다.
aspx 전체소스 다운로드
aspx.cs 전체소스 다운로드
하여 오늘은 .net Html, GridView jquery이용하여 추가 삭제 구현에 대해서 알아보도록 하겠습니다.
구현되는 화면은 아래의 두개 화면 입니다.
동그라미1번의 html 부분
동그라미2번의 .net GridView 부분 입니다.
먼저 aspx소스 입니다.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CTCD_Write.aspx.cs" Inherits="ssCRM_UI.Pages__C004.CT.CTCD_Write" MasterPageFile="~/Common/BaseTemplate.Master" ValidateRequest="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPage" runat="server">
<script type="text/javascript">
$(window).load(function () {
// 오늘작업계획
var parsedDivTodayWorkPlan = $.parseJSON($("#<%= this.hdnDivTodayWorkPlan.ClientID%>").val());
if (parsedDivTodayWorkPlan != null) {
$.each(parsedDivTodayWorkPlan, function (i, jsonData) {
if (i == 0)
$("#FLD_TODAYWORKPLAN_1").val(jsonData.TodayWorkPlan);
else
todayWorkPlanControlAdd("FLD_TODAYWORKPLAN_", (i + 1), jsonData.TodayWorkPlan);
});
}
// 오늘작업실적
var parsedDivTodayWorkResult = $.parseJSON($("#<%= this.hdnDivTodayWorkResult.ClientID%>").val());
if (parsedDivTodayWorkResult != null) {
$.each(parsedDivTodayWorkResult, function (i, jsonData) {
if (i == 0)
$("#FLD_TODAYWORKRESULT_1").val(jsonData.TodayWorkResult);
else
todayWorkResultControlAdd("FLD_TODAYWORKRESULT_", (i + 1), jsonData.TodayWorkResult);
});
}
});
// 저장
function fnSave() {
// 필수 항목 점검 및 저장 여부 확인 ==> 기존정보
if (Page_ClientValidate() && chkSave()) {
}
else {
return false;
}
//////////////////////////////////////////////////////////////////////////////
// 공사, 일자 중복 체크 (2016-05-30)
//////////////////////////////////////////////////////////////////////////////
var dupCheck = true;
var dupMsg = "";
var constructDailykeyId = $('#<%=hdnCONSTRUCTDAILYID.ClientID %>').val()
constructDailykeyId = parseInt(constructDailykeyId);
if (constructDailykeyId <= 0) {
var constructID = $('#<%=FLD_CONSTRUCTID.ClientID %>').val();
var constructDailyDate = $('#<%=FLD_CONSTRUCTDAILYDATE.ClientID %>').val();
var sessionUserId = "<%=this.sessionUserId%>";
var items = [
{ CONSTRUCTID: constructID, CONSTRUCTDAILYDATE: constructDailyDate, SESSIONUSERID: sessionUserId }
];
var options = {
type: "POST",
url: window.location.pathname + "/GetConstructDailyDup",
data: "{'items':" + JSON.stringify(items) + "}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: false,
success: function (response) {
var parsed = $.parseJSON(response.d);
if (parsed != null) {
$.each(parsed, function (i, jsonData) {
if (jsonData.DUP == "N") {
dupMsg = "동일한 공사일보 정보가 있습니다.";
dupCheck = false;
}
});
}
},
error: function (msg) {
dupMsg = msg.d;
dupCheck = false;
},
complete: function (data) {
}
};
jQuery.ajax(options);
}
if (dupMsg != "" && !dupCheck) {
alert(dupMsg);
return false;
}
//////////////////////////////////////////////////////////////////////////////
// 자재 투입 계획
//////////////////////////////////////////////////////////////////////////////
var myObject_Material = new Array();
var list_Material = $('#<%=gvListMaterial.ClientID %>').find("tr");
for (var i = 0; i < list_Material.length; i++) {
var statusGubun = $(list_Material[i]).find("#STATUS_GUBUN").val();
var inputResourceID = $(list_Material[i]).find("#INPUTRESOURCEID").val();
if(inputResourceID != "" && inputResourceID != undefined){
var arr2 = new Object();
$(list_Material[i]).find("input").each(function () {
var id = $(this).attr("id");
if (id != null && id != "") {
arr2[id] = $(this).val();
}
});
myObject_Material.push(arr2);
}
}
var data_Material = JSON.stringify(myObject_Material);
$("#<%= this.hdnMATERIALResultData.ClientID%>").val(data_Material);
//////////////////////////////////////////////////////////////////////////////
// 장비 투입 계획
//////////////////////////////////////////////////////////////////////////////
var myObject_Equipment = new Array();
var list_Equipment = $('#<%=gvListEquipment.ClientID %>').find("tr");
for (var i = 0; i < list_Equipment.length; i++) {
var statusGubun = $(list_Equipment[i]).find("#STATUS_GUBUN").val();
var inputResourceID = $(list_Equipment[i]).find("#INPUTRESOURCEID").val();
if (inputResourceID != "" && inputResourceID != undefined) {
var arr2 = new Object();
$(list_Equipment[i]).find("input").each(function () {
var id = $(this).attr("id");
if (id != null && id != "") {
arr2[id] = $(this).val();
}
});
myObject_Equipment.push(arr2);
}
}
var data_Equipment = JSON.stringify(myObject_Equipment);
$("#<%= this.hdnEQUIPMENTResultData.ClientID%>").val(data_Equipment);
//////////////////////////////////////////////////////////////////////////////
// 노무비 투입 계획
//////////////////////////////////////////////////////////////////////////////
var myObject_WorkerCost = new Array();
var list_WorkerCost = $('#<%=gvListWorkerCost.ClientID %>').find("tr");
for (var i = 0; i < list_WorkerCost.length; i++) {
var statusGubun = $(list_WorkerCost[i]).find("#STATUS_GUBUN").val();
var workerID = $(list_WorkerCost[i]).find("#WORKERID").val();
if (workerID != "" && workerID != undefined) {
var arr2 = new Object();
$(list_WorkerCost[i]).find("input").each(function () {
var id = $(this).attr("id");
if (id != null && id != "") {
arr2[id] = $(this).val();
}
});
myObject_WorkerCost.push(arr2);
}
}
var data_WorkerCost = JSON.stringify(myObject_WorkerCost);
$("#<%= this.hdnWORKERCOSTResultData.ClientID%>").val(data_WorkerCost);
//////////////////////////////////////////////////////////////////////////////
// 간접경비 투입 계획
//////////////////////////////////////////////////////////////////////////////
var myObject_IndirectExpense = new Array();
var list_IndirectExpense = $('#<%=gvListIndirectExpense.ClientID %>').find("tr");
for (var i = 0; i < list_IndirectExpense.length; i++) {
var statusGubun = $(list_IndirectExpense[i]).find("#STATUS_GUBUN").val();
var inputResourceID = $(list_IndirectExpense[i]).find("#INPUTRESOURCEID").val();
if (inputResourceID != "" && inputResourceID != undefined) {
var arr2 = new Object();
$(list_IndirectExpense[i]).find("input").each(function () {
var id = $(this).attr("id");
if (id != null && id != "") {
arr2[id] = $(this).val();
}
});
myObject_IndirectExpense.push(arr2);
}
}
var data_IndirectExpense = JSON.stringify(myObject_IndirectExpense);
$("#<%= this.hdnINDIRECTEXPENSEResultData.ClientID%>").val(data_IndirectExpense);
//////////////////////////////////////////////////////////////////////////////
// 외주비 투입 계획
//////////////////////////////////////////////////////////////////////////////
var myObject_OutsideOrderExpense = new Array();
var list_OutsideOrderExpense = $('#<%=gvListOutsideOrderExpense.ClientID %>').find("tr");
for (var i = 0; i < list_OutsideOrderExpense.length; i++) {
var statusGubun = $(list_OutsideOrderExpense[i]).find("#STATUS_GUBUN").val();
var inputResourceID = $(list_OutsideOrderExpense[i]).find("#INPUTRESOURCEID").val();
if (inputResourceID != "" && inputResourceID != undefined) {
var arr2 = new Object();
$(list_OutsideOrderExpense[i]).find("input").each(function () {
var id = $(this).attr("id");
if (id != null && id != "") {
arr2[id] = $(this).val();
}
});
myObject_OutsideOrderExpense.push(arr2);
}
}
var data_OutsideOrderExpense = JSON.stringify(myObject_OutsideOrderExpense);
$("#<%= this.hdnOUTSIDEORDEREXPENSEResultData.ClientID%>").val(data_OutsideOrderExpense);
//////////////////////////////////////////////////////////////////////////////
// 오늘작업계획
//////////////////////////////////////////////////////////////////////////////
var myObject_DivTodayWorkPlan = "";
$("#DIV_TODAYWORKPLAN").find("input").each(function () {
if ($(this).val().trim() != "") {
myObject_DivTodayWorkPlan += $(this).val() + "^*|*^";
}
});
$("#<%= this.hdnDivTodayWorkPlan.ClientID%>").val(myObject_DivTodayWorkPlan);
//////////////////////////////////////////////////////////////////////////////
// 오늘작업식적
//////////////////////////////////////////////////////////////////////////////
var myObject_DivTodayWorkResult = "";
$("#DIV_TODAYWORKRESULT").find("input").each(function () {
if ($(this).val().trim() != "") {
myObject_DivTodayWorkResult += $(this).val() + "^*|*^";
}
});
$("#<%= this.hdnDivTodayWorkResult.ClientID%>").val(myObject_DivTodayWorkResult);
// 등록할 내용 있는지 없는지 체크
//if (
//$("#<%= this.hdnMATERIALResultData.ClientID%>").val() == "[]" &&
//$("#<%= this.hdnEQUIPMENTResultData.ClientID%>").val() == "[]" &&
//$("#<%= this.hdnWORKERCOSTResultData.ClientID%>").val() == "[]" &&
//$("#<%= this.hdnINDIRECTEXPENSEResultData.ClientID%>").val() == "[]" &&
//$("#<%= this.hdnOUTSIDEORDEREXPENSEResultData.ClientID%>").val() == "[]") {
//alert("등록할 내용이 없습니다.");
//return false;
//}
}
//////////////////////////////////////////////////////////////////////////////
// 공사 팝업
//////////////////////////////////////////////////////////////////////////////
function fnConstructSearchPopup() {
fnOpenPopup('popConstruct', 'CTCT_Po_Search.aspx', 800, 600);
}
function callBackFN_Constract(ConstructID, ConstructName, ConstructAmountID, ConstructAmount, ChangeConstructAmount, SiteDateBegin, SUMAMOUNTTOTAL_) {
$("#<%= this.FLD_CONSTRUCTNAME.ClientID%>").val(ConstructName); // 공사명
$("#<%= this.FLD_CONSTRUCTID.ClientID%>").val(ConstructID); // 공사ID
$("#<%= this.FLD_CONSTRUCTAMOUNTID.ClientID%>").val(fnGetNumberWithComma(ConstructAmountID, "C")); // 공사 금액 총계 일련번호
$("#<%= this.FLD_CONSTRUCTAMOUNT.ClientID%>").val(fnGetNumberWithComma(ConstructAmount, "C")); // 계약금액
$("#<%= this.FLD_CHANGECONSTRUCTAMOUNT.ClientID%>").val(fnGetNumberWithComma(ChangeConstructAmount, "C")); // 변경금액
$("#<%= this.FLD_SUMAMOUNTTOTAL.ClientID%>").val(fnGetNumberWithComma(SUMAMOUNTTOTAL_, "C")); // 누계총투입금액
$("#<%= this.hdnSumAmountTotal.ClientID%>").val(SUMAMOUNTTOTAL_); // 누계총투입금액
}
//////////////////////////////////////////////////////////////////////////////
// 그리드 관련 팝업
//////////////////////////////////////////////////////////////////////////////
var returnGrid;
var retuenInputResourceName;
var retuenInputResourceID;
var retuenSpecification;
var retuenUnit;
var retuenVolume;
var retuenSum_Volume;
var retuenSum_Volume_;
var retuenSum_Price;
var retuenSum_Price_;
var retuenWorkerName;
var retuenWorkerID;
var retuenResident;
var retuenUnitPrice;
var retuenWorkDay;
var retuenPrice;
var retuenSum_WorkDay;
var retuenSum_WorkDay_;
function fnSearchPopup(object, type, strGrid_Gubun) {
// 누계 수량, 금액 데이터를 가져오기 위해서 기본정보 섹션의 공사명(공사ID)을 먼저 선택 해야함.
var popConstructID = $("#<%= this.FLD_CONSTRUCTID.ClientID%>").val();
if(popConstructID == "") {
alert("공사를 선택하세요!");
return false;
}
var gubun = "";
if (strGrid_Gubun == "gvListMaterial"){
gubun = 10;
returnGrid = $("#<%=gvListMaterial.ClientID %>");
}
else if (strGrid_Gubun == "gvListEquipment"){
gubun = 20;
returnGrid = $("#<%=gvListEquipment.ClientID %>");
}
else if (strGrid_Gubun == "gvListWorkerCost"){
returnGrid = $("#<%=gvListWorkerCost.ClientID %>");
}
else if (strGrid_Gubun == "gvListIndirectExpense"){
gubun = 30;
returnGrid = $("#<%=gvListIndirectExpense.ClientID %>");
}
else if (strGrid_Gubun == "gvListOutsideOrderExpense"){
gubun = 40;
returnGrid = $("#<%=gvListOutsideOrderExpense.ClientID %>");
}
var tr = object.parentNode.parentNode;
// 노무비 투입 계획 그리드 팝업 관련
if (strGrid_Gubun == "gvListWorkerCost") {
retuenWorkerName = $(tr).find("#WORKERNAME");
retuenWorkerID = $(tr).find("#WORKERID");
retuenResident = $(tr).find("#RESIDENT");
retuenUnitPrice = $(tr).find("#UNITPRICE");
retuenWorkDay = $(tr).find("#WORKDAY");
retuenPrice = $(tr).find("#PRICE");
retuenSum_WorkDay = $(tr).find("#SUM_WORKDAY");
retuenSum_WorkDay_ = $(tr).find("#SUM_WORKDAY_");
retuenSum_Price = $(tr).find("#SUM_PRICE");
retuenSum_Price_ = $(tr).find("#SUM_PRICE_");
var statusGubun = $(tr).find("#STATUS_GUBUN").val();
if (statusGubun != "I")
$(tr).find("#STATUS_GUBUN").val("U");
if (type == "1") {
var returnValue = fnOpenPopup('popWorker', 'CTWK_Po_Search.aspx?gubun=' + gubun, 800, 600);
}
else if (type == "2") {
// 모든 데이터를 제거하기 위해서 주석 후 수정
//$(retuenWorkerName).val(""); // 근로자(이름)명
//$(retuenWorkerID).val(""); // 근로자id
//$(retuenResident).val(""); // 주민등록번호
$(tr).find("input, select").each(function () {
if ($(this).attr("id").indexOf("ddlWORKDAY") >= 0) {
$(this).val("0");
}
else {
$(this).val("");
}
});
fnAutoTotal(null, strGrid_Gubun); // 합계 셋팅
retuenWorkerName = null;
retuenWorkerID = null;
retuenResident = null;
retuenUnitPrice = null;
}
}
// 노무비 투입 계획 그리드 외 팝업 관련
else {
retuenInputResourceName = $(tr).find("#INPUTRESOURCENAME");
retuenInputResourceID = $(tr).find("#INPUTRESOURCEID");
retuenSpecification = $(tr).find("#SPECIFICATION");
retuenUnit = $(tr).find("#UNIT");
retuenVolume = $(tr).find("#VOLUME");
retuenPrice = $(tr).find("#PRICE");
retuenSum_Volume = $(tr).find("#SUM_VOLUME");
retuenSum_Volume_ = $(tr).find("#SUM_VOLUME_");
retuenSum_Price = $(tr).find("#SUM_PRICE");
retuenSum_Price_ = $(tr).find("#SUM_PRICE_");
var statusGubun = $(tr).find("#STATUS_GUBUN").val();
if (statusGubun != "I")
$(tr).find("#STATUS_GUBUN").val("U");
if (type == "1") {
var returnValue = fnOpenPopup('popInputResource', 'CTIR_Po_Search.aspx?gubun=' + gubun, 800, 600);
}
else if (type == "2") {
// 모든 데이터를 제거하기 위해서 주석 후 수정
//$(retuenInputResourceName).val(""); // 자재명
//$(retuenInputResourceID).val(""); // 자재id
//$(retuenSpecification).val(""); // 규격
//$(retuenUnit).val(""); // 단위
$(tr).find("input").each(function () {
$(this).val("");
});
fnAutoTotal(null, strGrid_Gubun); // 합계 셋팅
retuenInputResourceName = null;
retuenInputResourceID = null;
retuenSpecification = null;
retuenUnit = null;
}
}
}
function callBackFN(InputResourceID, InputResourceName, Specification, Unit, InputResourceType) {
// 중복체크
var chk = true;
/* 자원 중복체크 해제 요청으로 주석 처리 (2016-06-17)
$(returnGrid).find("tr").each(function () {
$(this).find("#INPUTRESOURCEID").each(function () {
if(InputResourceID == $(this).val()){
alert("중복 투입자원 입니다.");
chk = false;
return false;
}
});
if(!chk)
return false;
});
*/
if(chk){
$(retuenInputResourceID).val(InputResourceID);
$(retuenInputResourceName).val(InputResourceName);
$(retuenSpecification).val(Specification);
$(retuenUnit).val(Unit);
fnSumVolumePrice(InputResourceID, InputResourceType, returnGrid);
}
}
function callBackFN_WorkerCost(WorkerID, WorkerName, Resident, WorkerCost) {
// 중복체크
var chk = true;
/* 자원 중복체크 해제 요청으로 주석 처리 (2016-06-17)
$(returnGrid).find("tr").each(function () {
$(this).find("#WORKERID").each(function () {
if(WorkerID == $(this).val()){
alert("중복 투입자원 입니다.");
chk = false;
return false;
}
});
});
*/
if(chk){
$(retuenWorkerID).val(WorkerID);
$(retuenWorkerName).val(WorkerName);
$(retuenResident).val(Resident);
$(retuenUnitPrice).val(fnGetNumberWithComma(WorkerCost, "C"));
$(retuenUnitPrice).trigger('blur');
fnSumVolumePrice(WorkerID, "worker", returnGrid);
}
}
function fnSumVolumePrice(id, type, gridGubun) {
var strGrid_Gubun = "";
// 누계 수량, 금액 데이터를 가져오기 위해서 기본정보 섹션의 공사명(공사ID)을 먼저 선택 해야함.
var popConstructID = $("#<%= this.FLD_CONSTRUCTID.ClientID%>").val();
// 투입자원이 공통 일경우
if ($(gridGubun).attr("id").indexOf("_gvListMaterial") > 0 && type == "50")
type = 10;
else if ($(gridGubun).attr("id").indexOf("_gvListEquipment") > 0 && type == "50")
type = 20;
else if ($(gridGubun).attr("id").indexOf("_gvListIndirectExpense") > 0 && type == "50")
type = 30;
else if ($(gridGubun).attr("id").indexOf("_gvListOutsideOrderExpense") > 0 && type == "50")
type = 40;
var items = [
// { InputResourceID: "1", InputResourceType: "531", ConstructID: "531" },
{ INPUTRESOURCEID: id, INPUTRESOURCETYPE: type, CONSTRUCTID: popConstructID }
];
var options = {
type: "POST",
url: window.location.pathname + "/GetSum_Volume_Price",
data: "{'items':" + JSON.stringify(items) + "}", // array to string fixes it *
contentType: "application/json; charset=utf-8",
dataType: "json",
async: false,
success: function (response) {
var parsed = $.parseJSON(response.d);
if (parsed != null) {
$.each(parsed, function (i, jsonData) {
if (type == "worker") {
var sumVolume = jsonData.SUM_VOLUME;
if (sumVolume == null || sumVolume == "")
sumVolume = 0;
else
sumVolume = parseFloat(sumVolume.replace(/,/g, ''));
var controlVolume = $(retuenWorkDay).val();
if (controlVolume == null || controlVolume == "")
controlVolume = 0;
else
controlVolume = parseFloat(controlVolume.replace(/,/g, ''));
$(retuenSum_WorkDay).val(fnGetNumberWithComma(sumVolume + controlVolume, "d"));
$(retuenSum_WorkDay_).val(jsonData.SUM_VOLUME);
}
else {
var sumVolume = jsonData.SUM_VOLUME;
if (sumVolume == null || sumVolume == "")
sumVolume = 0;
else
sumVolume = parseFloat(sumVolume.replace(/,/g, ''));
var controlVolume = $(retuenVolume).val();
if (controlVolume == null || controlVolume == "")
controlVolume = 0;
else
controlVolume = parseFloat(controlVolume.replace(/,/g, ''));
$(retuenSum_Volume).val(fnGetNumberWithComma(sumVolume + controlVolume, "d"));
$(retuenSum_Volume_).val(jsonData.SUM_VOLUME);
}
var sumPrice = jsonData.SUM_PRICE;
if (sumPrice == null || sumPrice == "")
sumPrice = 0;
else
sumPrice = parseInt(sumPrice.replace(/,/g, ''));
var controlPrice = $(retuenPrice).val();
if (controlPrice == null || controlPrice == "")
controlPrice = 0;
else
controlPrice = parseInt(controlPrice.replace(/,/g, ''));
$(retuenSum_Price).val(fnGetNumberWithComma(sumPrice + controlPrice, "C"));
$(retuenSum_Price_).val(jsonData.SUM_PRICE);
});
// 누계투입금액 합계
fnAutoTotal_SUM(null, returnGrid);
}
},
error: function (msg) { alert(msg.d); },
complete: function (data) {
returnGrid = null;
retuenInputResourceID = null;
retuenInputResourceName = null;
retuenSpecification = null;
retuenUnit = null;
retuenVolume = null;
retuenWorkerID = null;
retuenWorkerName = null;
retuenResident = null;
retuenUnitPrice = null;
retuenWorkDay = null;
retuenSum_Volume = null;
retuenSum_Volume_ = null;
retuenSum_Price = null;
retuenSum_Price_ = null;
retuenSum_WorkDay = null;
retuenSum_WorkDay_ = null;
}
};
jQuery.ajax(options);
}
//////////////////////////////////////////////////////////////////////////////
// 그리드 자동계산 관련
//////////////////////////////////////////////////////////////////////////////
function fnAutoTotal(object, strGrid_Gubun) {
// 단가, 수량 같은 입력 값이 0 일때 0을 지우고 입력해야하는 불편함을 없애기 위한 함수 (2016-05-30)
if ($(object).val() == "")
$(object).val("0");
var gridName = "";
if (strGrid_Gubun == "gvListMaterial")
gridName = "<%=gvListMaterial.ClientID %>";
else if (strGrid_Gubun == "gvListEquipment")
gridName = "<%=gvListEquipment.ClientID %>";
else if (strGrid_Gubun == "gvListWorkerCost")
gridName = "<%=gvListWorkerCost.ClientID %>";
else if (strGrid_Gubun == "gvListIndirectExpense")
gridName = "<%=gvListIndirectExpense.ClientID %>";
else if (strGrid_Gubun == "gvListOutsideOrderExpense")
gridName = "<%=gvListOutsideOrderExpense.ClientID %>";
// 노무비 투입 계획 그리드 팝업 관련
if (strGrid_Gubun == "gvListWorkerCost") {
var UnitPrice = 0;
var WorkDay = 0;
var TotalPrice = 0;
if (object != null && object != "") {
var row = object.parentNode.parentNode;
// 해당 Row의 단가, 수량 추출 후 금액 셋팅
$(row).find("input").each(function () {
var id = $(this).attr("id");
// 단가 추출
if (id == "UNITPRICE" && $(this).val() != "")
UnitPrice = $(this).val().replace(/,/g, '');
// 수량 추출
if (id == "WORKDAY" && $(this).val() != "")
WorkDay = $(this).val().replace(/,/g, '');
// 금액 셋팅
if (id == "PRICE") {
// $(this).val(UnitPrice * Volume);
$(this).val(fnGetNumberWithComma(UnitPrice * WorkDay, "d"));
}
// 누계투입일수 셋팅
if (id == "SUM_WORKDAY") {
// 누계투입일수 합계를 계산하기 위한 초기 누계투입일수
var firstSumWorkDay = parseFloat($(row).find("#SUM_WORKDAY_").val().replace(/,/g, ''));
// 투입일수
var workDay = 0.0;
$(row).find("select").each(function () {
var id = $(this).attr("id");
if (id.indexOf("ddlWORKDAY") > -1) {
workDay = parseFloat($(this).val().replace(/,/g, ''));
}
});
$(this).val(fnGetNumberWithComma(firstSumWorkDay + workDay, "C"));
}
// 누계금액 셋팅
if (id == "SUM_PRICE") {
// 누계금액 합계를 계산하기 위한 초기 누계금액
var firstSumPrice = parseInt($(row).find("#SUM_PRICE_").val().replace(/,/g, ''));
// 금액
var price = parseInt($(row).find("#PRICE").val().replace(/,/g, ''));
$(this).val(fnGetNumberWithComma(firstSumPrice + price, "C"));
}
});
}
// 그리드의 모든 단가, 수량 추출
$('#' + gridName).find("input").each(function () {
var id = $(this).attr("id");
if (id == "PRICE" && $(this).val() != "")
TotalPrice += parseFloat($(this).val().replace(/,/g, ''));
});
// 합계 셋팅
$('#' + gridName).find("span").each(function () {
var id = $(this).attr("id");
if (id.indexOf("_lblTotalPRICE") > 0)
$(this).text(fnGetNumberWithComma(TotalPrice, "d"));
});
}
// 간접경비 단가, 수량 누계수량이 제거 되면서 추가 (2016-06-15)
else if (strGrid_Gubun == "gvListIndirectExpense") {
var TotalPrice = 0;
if (object != null && object != "") {
var row = object.parentNode.parentNode;
// 해당 Row의 단가, 수량 추출 후 금액 셋팅
$(row).find("input").each(function () {
var id = $(this).attr("id");
// 누계금액 셋팅
if (id == "SUM_PRICE") {
// 누계금액 합계를 계산하기 위한 초기 누계금액
var firstSumPrice = parseInt($(row).find("#SUM_PRICE_").val().replace(/,/g, ''));
// 금액
var price = parseInt($(row).find("#PRICE").val().replace(/,/g, ''));
$(this).val(fnGetNumberWithComma(firstSumPrice + price, "C"));
}
});
}
// 그리드의 모든 단가, 수량 추출
$('#' + gridName).find("input").each(function () {
var id = $(this).attr("id");
if (id == "PRICE" && $(this).val() != "")
TotalPrice += parseInt($(this).val().replace(/,/g, ''));
});
// 합계 셋팅
$('#' + gridName).find("span").each(function () {
var id = $(this).attr("id");
if (id.indexOf("_lblTotalPRICE") > 0)
$(this).text(fnGetNumberWithComma(TotalPrice, "C"));
});
}
// 노무비 투입 계획 그리드 외 팝업 관련
else {
var UnitPrice = 0;
var Volume = 0;
var TotalPrice = 0;
if (object != null && object != "") {
var row = object.parentNode.parentNode;
// 해당 Row의 단가, 수량 추출 후 금액 셋팅
$(row).find("input").each(function () {
var id = $(this).attr("id");
// 단가 추출
if (id == "UNITPRICE" && $(this).val() != "")
UnitPrice = $(this).val().replace(/,/g, '');
// 수량 추출
if (id == "VOLUME" && $(this).val() != "")
Volume = $(this).val().replace(/,/g, '');
// 금액 셋팅
if (id == "PRICE") {
// $(this).val(UnitPrice * Volume);
$(this).val(fnGetNumberWithComma(UnitPrice * Volume, "C"));
}
// 누계수량 셋팅
if (id == "SUM_VOLUME") {
// 누계수량 합계를 계산하기 위한 초기 누계수량
var firstSumVolume = parseInt($(row).find("#SUM_VOLUME_").val().replace(/,/g, ''));
// 수량
var volume = parseInt($(row).find("#VOLUME").val().replace(/,/g, ''));
$(this).val(fnGetNumberWithComma(firstSumVolume + volume, "C"));
}
// 누계금액 셋팅
if (id == "SUM_PRICE") {
// 누계금액 합계를 계산하기 위한 초기 누계금액
var firstSumPrice = parseInt($(row).find("#SUM_PRICE_").val().replace(/,/g, ''));
// 금액
var price = parseInt($(row).find("#PRICE").val().replace(/,/g, ''));
$(this).val(fnGetNumberWithComma(firstSumPrice + price, "C"));
}
});
}
// 그리드의 모든 단가, 수량 추출
$('#' + gridName).find("input").each(function () {
var id = $(this).attr("id");
if (id == "PRICE" && $(this).val() != "")
TotalPrice += parseInt($(this).val().replace(/,/g, ''));
});
// 합계 셋팅
$('#' + gridName).find("span").each(function () {
var id = $(this).attr("id");
if (id.indexOf("_lblTotalPRICE") > 0)
$(this).text(fnGetNumberWithComma(TotalPrice, "C"));
});
}
// 해당 그리드의 누계금액 합계 셋팅
fnAutoTotal_SUM(null, $('#' + gridName));
// 총계 섹션의 "계획금액 합계" 자동계산 함수 호출
fnAutoPlanTotal();
}
//////////////////////////////////////////////////////////////////////////////
// 총계 섹션의 "금일총투입금액" 자동계산
//////////////////////////////////////////////////////////////////////////////
function fnAutoPlanTotal() {
var planTotalPrice = 0;
var tr_Material = $('#<%=gvListMaterial.ClientID %>').find('tr:last').clone();
var tr_Equipment = $('#<%=gvListEquipment.ClientID %>').find('tr:last').clone();
var tr_WorkerCost = $('#<%=gvListWorkerCost.ClientID %>').find('tr:last').clone();
var tr_IndirectExpense = $('#<%=gvListIndirectExpense.ClientID %>').find('tr:last').clone();
var tr_OutsideOrderExpense = $('#<%=gvListOutsideOrderExpense.ClientID %>').find('tr:last').clone();
// 자재
$(tr_Material).find("span").each(function () {
var id = $(this).attr("id");
if (id.indexOf("_lblTotalPRICE") > 0)
planTotalPrice += parseInt($(this).text().replace(/,/g, ''));
});
//장비
$(tr_Equipment).find("span").each(function () {
var id = $(this).attr("id");
if (id.indexOf("_lblTotalPRICE") > 0)
planTotalPrice += parseInt($(this).text().replace(/,/g, ''));
});
//노무비
$(tr_WorkerCost).find("span").each(function () {
var id = $(this).attr("id");
if (id.indexOf("_lblTotalPRICE") > 0)
planTotalPrice += parseInt($(this).text().replace(/,/g, ''));
});
//간접경비
$(tr_IndirectExpense).find("span").each(function () {
var id = $(this).attr("id");
if (id.indexOf("_lblTotalPRICE") > 0)
planTotalPrice += parseInt($(this).text().replace(/,/g, ''));
});
//외주비
$(tr_OutsideOrderExpense).find("span").each(function () {
var id = $(this).attr("id");
if (id.indexOf("_lblTotalPRICE") > 0)
planTotalPrice += parseInt($(this).text().replace(/,/g, ''));
});
$("#<%=FLD_PLANAMOUNTTOTAL.ClientID %>").val(fnGetNumberWithComma(planTotalPrice, "C"));
// 총계 섹션의 "계획금액 합계" 자동계산 함수 호출
fnAutoPlanTotal_SUM();
}
//////////////////////////////////////////////////////////////////////////////
// 그리드 자동계산 관련 (누계금액 합계)
//////////////////////////////////////////////////////////////////////////////
function fnAutoTotal_SUM(object, grid) {
var TotalPrice = 0;
// 그리드의 모든 단가, 수량 추출
$(grid).find("input").each(function () {
var id = $(this).attr("id");
if (id == "SUM_PRICE" && $(this).val() != "")
TotalPrice += parseFloat($(this).val().replace(/,/g, ''));
});
// 합계 셋팅
$(grid).find("span").each(function () {
var id = $(this).attr("id");
if (id.indexOf("lblTotalSUM_PRICE") > 0)
$(this).text(fnGetNumberWithComma(TotalPrice, "d"));
});
}
//////////////////////////////////////////////////////////////////////////////
// 총계 섹션의 "누계총투입금액" 자동계산
//////////////////////////////////////////////////////////////////////////////
function fnAutoPlanTotal_SUM() {
var planTotalPrice = null;
if ($("#<%=hdnSumAmountTotal.ClientID %>").val() == "" || $("#<%=hdnSumAmountTotal.ClientID %>").val() == "0")
planTotalPrice = parseInt("0");
else
planTotalPrice = parseInt($("#<%=hdnSumAmountTotal.ClientID %>").val());
// 금일총투입금액
var planAmountTotal = null;
if ($("#<%=FLD_PLANAMOUNTTOTAL.ClientID %>").val() == "" || $("#<%=FLD_PLANAMOUNTTOTAL.ClientID %>").val() == "0")
planAmountTotal = parseInt("0");
else
planAmountTotal = parseInt($("#<%=FLD_PLANAMOUNTTOTAL.ClientID %>").val().replace(/,/g, ''));
$("#<%=FLD_SUMAMOUNTTOTAL.ClientID %>").val(fnGetNumberWithComma(planTotalPrice + planAmountTotal, "C"));
// 총계 섹션의 "마진금액", "마진율" 자동계산
fnAutoPlanTotal_Margin();
}
//////////////////////////////////////////////////////////////////////////////
// 총계 섹션의 "마진금액", "마진율" 자동계산
//////////////////////////////////////////////////////////////////////////////
function fnAutoPlanTotal_Margin() {
// 변경금액
var changeConstructAmount = parseInt($("#<%=FLD_CHANGECONSTRUCTAMOUNT.ClientID %>").val().replace(/,/g, ''));
// 누계총투입금액
var sumAmountTotal = parseInt($("#<%=FLD_SUMAMOUNTTOTAL.ClientID %>").val().replace(/,/g, ''));
// 마진금액 (변경금액 - 누계총투입금액)
var marginAmount = changeConstructAmount - sumAmountTotal;
$("#<%=FLD_MARGIN.ClientID %>").val(fnGetNumberWithComma(marginAmount, "C"));
// 마진율 (마진금액 / 변경금액 * 100)
if(marginAmount > 0) {
var marginPer = marginAmount / changeConstructAmount * 100;
$("#<%=FLD_MARGIN_PER.ClientID %>").val(marginPer.toFixed(2));
}
else {
var marginPer = (-1 * marginAmount) / changeConstructAmount * 100;
marginPer = -1 * marginPer;
$("#<%=FLD_MARGIN_PER.ClientID %>").text(marginPer.toFixed(2));
}
}
//////////////////////////////////////////////////////////////////////////////
// 그리드 Row 추가
//////////////////////////////////////////////////////////////////////////////
function fnAddRow(object, strGrid_Gubun) {
var gridName = "";
if (strGrid_Gubun == "gvListMaterial")
gridName = "<%=gvListMaterial.ClientID %>";
else if (strGrid_Gubun == "gvListEquipment")
gridName = "<%=gvListEquipment.ClientID %>";
else if (strGrid_Gubun == "gvListWorkerCost")
gridName = "<%=gvListWorkerCost.ClientID %>";
else if (strGrid_Gubun == "gvListIndirectExpense")
gridName = "<%=gvListIndirectExpense.ClientID %>";
else if (strGrid_Gubun == "gvListOutsideOrderExpense")
gridName = "<%=gvListOutsideOrderExpense.ClientID %>";
// 합계 Row 정보
var $tr_Auto = $('#' + gridName).find('tr:last').clone();
// 합계 Row 삭제
$('#' + gridName).find('tr:last').remove();
// 합계 Row 삭제 시점의 마지막 Row
var $tr = $('#' + gridName).find('tr:last').clone();
// 합계 Row 삭제 시점의 마지막 Row 셋팅
// 합계 전의 tr
$tr.find("input, select").each(function () {
var id = $(this).attr("id");
if (id == "UNITPRICE" || id == "VOLUME" || id == "WORKDAY" || id == "PRICE" || id == "SUM_VOLUME" || id == "SUM_VOLUME_" || id == "SUM_PRICE" || id == "SUM_PRICE_")
$(this).val("0");
else if ($(this).attr("id").indexOf("ddlWORKDAY") >= 0)
$(this).val("0");
else if (id == "STATUS_GUBUN")
$(this).val("I");
else
$(this).val("");
});
// 합계 Row 삭제 시점의 마지막 Row 추가
$('#' + gridName).append($tr);
// 삭제한 합계 Row 추가
$('#' + gridName).append($tr_Auto);
}
//////////////////////////////////////////////////////////////////////////////
// 그리드 삭제, 삭제취소 버튼
//////////////////////////////////////////////////////////////////////////////
function fnAddDelete(object, strGrid_Gubun) {
var tr = object.parentNode.parentNode;
if ($(object).text() == "삭제") {
$(tr).find("input, img, button, select").each(function () {
if ($(this).attr("id") == "btnDelete")
$(this).text("삭제취소");
else if ($(this).attr("id") == "STATUS_GUBUN") {
if ($(this).val() == "I")
$(tr).remove();
else
$(this).val("D");
}
else
$(this).prop("disabled", true);
});
}
else {
$(tr).find("input, img, button, select").each(function () {
if ($(this).attr("id") == "btnDelete")
$(this).text("삭제");
else if ($(this).attr("id") == "STATUS_GUBUN") {
$(this).val("U");
}
else
$(this).prop("disabled", false);
});
}
fnAutoTotal(null, strGrid_Gubun)
}
//////////////////////////////////////////////////////////////////////////////
// 그리드 Cell 수정 함수
//////////////////////////////////////////////////////////////////////////////
function fnChange(object) {
var tr = object.parentNode.parentNode;
var statusGubun = $(tr).find("#STATUS_GUBUN").val();
if (statusGubun != "I")
$(tr).find("#STATUS_GUBUN").val("U");
// 단가, 수량 같은 입력 값이 0 일때 0을 지우고 입력해야하는 불편함을 없애기 위한 함수 (2016-05-30)
if ($(object).val() == "")
$(object).val("0");
}
//////////////////////////////////////////////////////////////////////////////
// 노무비 그리드 콤보 Cell 수정 함수
//////////////////////////////////////////////////////////////////////////////
function workDayFN(object, strGrid_Gubun) {
var tr = object.parentNode.parentNode;
var workDayValue = $(object).val();
$(tr).find("#WORKDAY").val(workDayValue);
// 자동 합계 셋팅
fnAutoTotal(object, strGrid_Gubun);
var statusGubun = $(tr).find("#STATUS_GUBUN").val();
if (statusGubun != "I")
$(tr).find("#STATUS_GUBUN").val("U");
}
//////////////////////////////////////////////////////////////////////////////
// 단가, 수량 같은 입력 값이 0 일때 0을 지우고 입력해야하는 불편함을 없애기 위한 함수 (2016-05-30)
//////////////////////////////////////////////////////////////////////////////
function fnInuptFocus(object) {
if($(object).val() == "0")
$(object).val("");
}
//////////////////////////////////////////////////////////////////////////////
// 오늘작업계획 multi 입력을 위한 텍스트 박스 추가 삭제 스크립트 (2016-06-08)
//////////////////////////////////////////////////////////////////////////////
var maxTodayWorkPlanIndex = 1; // 현재 max 인덱스
function todayWorkPlanAdd(object, value) {
// 오늘작업계획 10개까지 제한
var divInputControlCount = $("#DIV_TODAYWORKPLAN").find("input").length;
if (divInputControlCount >= 10) {
return false;
}
// 마지막 컨트롤 아이디와 인덱스 추출
var id = "";
var index = 0;
$("#DIV_TODAYWORKPLAN").find("input").each(function () {
id = $(this).attr("id");
index = id.substring(id.lastIndexOf("_") + 1, id.length);
id = id.substring(0, id.lastIndexOf("_") + 1);
});
index = parseInt(index) + 1;
// 포커스가 위치한 컨트롤 아이디와 인덱스 추출
var objectId = $(object).attr("id");
objectIndex = objectId.substring(objectId.lastIndexOf("_") + 1, objectId.length);
// 컨트롤 추가
if (objectIndex == maxTodayWorkPlanIndex) {
todayWorkPlanControlAdd(id, index, value);
}
}
function todayWorkPlanControlAdd(id, index, value) {
if (typeof (value) == 'undefined')
value = "";
var controlStr = '<input type="text" id=' + id + index + ' name=' + id + index + ' value="' + value + '" onfocus="todayWorkPlanAdd(this); return false;" class="input_text textname" maxlength="250" style="width:83%;" />';
controlStr += '<button ID="btnDeleteTodayWorkPlan_' + index + '" class="small_btn" style="padding-top:2px;" onclick="todayWorkPlanDelete(' + index + ');return false;">삭제</button>'
$("#DIV_TODAYWORKPLAN").append(controlStr);
// 현재 max 인덱스 셋팅
maxTodayWorkPlanIndex = index;
}
function todayWorkPlanDelete(index) {
var divInputControlCount = $("#DIV_TODAYWORKPLAN").find("input").length;
if (divInputControlCount <= 1) {
alert("최소 1건 입니다.");
return false;
}
$("#FLD_TODAYWORKPLAN_" + index).remove();
$("#btnDeleteTodayWorkPlan_" + index).remove();
var id = "";
var index = 0;
$("#DIV_TODAYWORKPLAN").find("input").each(function () {
id = $(this).attr("id");
index = id.substring(id.lastIndexOf("_") + 1, id.length);
id = id.substring(0, id.lastIndexOf("_") + 1);
});
maxTodayWorkPlanIndex = parseInt(index);
}
//////////////////////////////////////////////////////////////////////////////
// 오늘작업실적 multi 입력을 위한 텍스트 박스 추가 삭제 스크립트 (2016-06-08)
//////////////////////////////////////////////////////////////////////////////
var maxTodayWorkResultIndex = 1; // 현재 max 인덱스
function todayWorkResultAdd(object, value) {
// 오늘작업실적 10개까지 제한
var divInputControlCount = $("#DIV_TODAYWORKRESULT").find("input").length;
if (divInputControlCount >= 10) {
return false;
}
// 마지막 컨트롤 아이디와 인덱스 추출
var id = "";
var index = 0;
$("#DIV_TODAYWORKRESULT").find("input").each(function () {
id = $(this).attr("id");
index = id.substring(id.lastIndexOf("_") + 1, id.length);
id = id.substring(0, id.lastIndexOf("_") + 1);
});
index = parseInt(index) + 1;
// 포커스가 위치한 컨트롤 아이디와 인덱스 추출
var objectId = $(object).attr("id");
objectIndex = objectId.substring(objectId.lastIndexOf("_") + 1, objectId.length);
// 컨트롤 추가
if (objectIndex == maxTodayWorkResultIndex) {
todayWorkResultControlAdd(id, index, value);
}
}
function todayWorkResultControlAdd(id, index, value) {
if (typeof (value) == 'undefined')
value = "";
var controlStr = '<input type="text" id=' + id + index + ' name=' + id + index + ' value="' + value + '" onfocus="todayWorkResultAdd(this); return false;" class="input_text textname" maxlength="250" style="width:83%;" />';
controlStr += '<button ID="btnDeleteTodayWorkResult_' + index + '" class="small_btn" style="padding-top:2px;" onclick="todayWorkResultDelete(' + index + ');return false;">삭제</button>'
$("#DIV_TODAYWORKRESULT").append(controlStr);
// 현재 max 인덱스 셋팅
maxTodayWorkResultIndex = index;
}
function todayWorkResultDelete(index) {
var divInputControlCount = $("#DIV_TODAYWORKRESULT").find("input").length;
if (divInputControlCount <= 1) {
alert("최소 1건 입니다.");
return false;
}
$("#FLD_TODAYWORKRESULT_" + index).remove();
$("#btnDeleteTodayWorkResult_" + index).remove();
var id = "";
var index = 0;
$("#DIV_TODAYWORKRESULT").find("input").each(function () {
id = $(this).attr("id");
index = id.substring(id.lastIndexOf("_") + 1, id.length);
id = id.substring(0, id.lastIndexOf("_") + 1);
});
maxTodayWorkResultIndex = parseInt(index);
}
//////////////////////////////////////////////////////////////////////////////
// 최근 정보 불러오기 버튼 클릭 확인창 함수
//////////////////////////////////////////////////////////////////////////////
function fnLastInfoLoadConfirm() {
var popConstructID = $("#<%= this.FLD_CONSTRUCTID.ClientID%>").val();
if (popConstructID == "") {
alert("공사를 선택하세요!");
return false;
}
if (!confirm("최근 정보를 불러오면 현재 정보는 지워집니다!\n\r진행하시겠습니까?"))
return false;
}
</script>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<div class="content_width">
<!-- 화면 타이틀 -->
<div class="content_Title">공사일보 등록/수정</div>
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="title_margin">
<tr>
<td class="tab_Title">기본정보</td>
<!-- 취소 및 저장 버튼 -->
<td class="AR btn_bottom">
<asp:Button ID="btnCancel" runat="server" Text="취소" CssClass="blueBtn1" CausesValidation="false" OnClientClick="fnBaseGoBack();return false;" />
<asp:Button ID="btnLastInfoLoad" runat="server" Text="최근 정보 불러오기" CssClass="blueBtn4" OnClick="btnLastInfoLoad_Click" CommandName="Create" CausesValidation="false" OnClientClick="return fnLastInfoLoadConfirm();" Visible="false"/>
<asp:Button ID="btnSave" runat="server" Text="저장" CssClass="blueBtn1" OnClick="btnSave_Click" CommandName="Create" OnClientClick="return fnSave();" />
</td>
</tr>
</table>
<!-- 기본정보 시작 -->
<table border="1" cellpadding="0" cellspacing="0" width="100%" class="table_content">
<colgroup>
<col width="12%" />
<col width="38%" />
<col width="12%" />
<col width="38%" />
</colgroup>
<tr>
<td class="cell_left">공사명<span class="essential_text">*</span></td>
<td class="pad1">
<asp:TextBox ID="FLD_CONSTRUCTNAME" runat="server" CssClass="search_text textname" MaxLength="50"></asp:TextBox>
<input type="hidden" id="FLD_CONSTRUCTID" runat="server" />
<img src="/images/btn_popsrc.gif" class="popsrc_align" id="btnConstructSearch" runat="server" onclick="fnConstructSearchPopup();" />
<img src="/images/btn/eraser.png" class="popsrc_align" id="btnConstructReset" runat="server" onclick="fnResetVal('FLD_CONSTRUCTNAME','FLD_CONSTRUCTID');" alt="" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate ="FLD_CONSTRUCTNAME" ErrorMessage="공사명을 선택하세요." Display="None"></asp:RequiredFieldValidator>
</td>
<td class="cell_left">일자<span class="essential_text">*</span></td>
<td class="pad1">
<asp:TextBox ID="FLD_CONSTRUCTDAILYDATE" runat="server" CssClass="input_text textdate" />
<img src="/images/btn_calendar.gif" class="cal_align" onclick="popCalendar('ContentPage_FLD_CONSTRUCTDAILYDATE', this)" alt="" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate ="FLD_CONSTRUCTDAILYDATE" ErrorMessage="일자를 선택하세요." Display="None"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="cell_left">날씨</td>
<td class="pad1" colspan="3">
<asp:TextBox ID="FLD_WEATHER" runat="server" CssClass="input_text" MaxLength="50" Width="40%"></asp:TextBox>
</td>
</tr>
<tr id="TR_TODAYWORK">
<td class="cell_left">오늘작업계획</td>
<td class="pad1">
<!-- <asp:TextBox ID="FLD_TODAYWORKPLAN" runat="server" CssClass="input_text textbox_w98" MaxLength="250" Width="98%"></asp:TextBox> -->
<diV id="DIV_TODAYWORKPLAN">
<input type="text" id="FLD_TODAYWORKPLAN_1" name="FLD_TODAYWORKPLAN_1" onfocus="todayWorkPlanAdd(this); return false;" class="input_text textname" maxlength="250" style="width:83%;" /><button ID="btnDeleteTodayWorkPlan_1" class="small_btn" style="padding-top:2px;" onclick="todayWorkPlanDelete(1);return false;">삭제</button>
</diV>
</td>
<td class="cell_left">오늘작업실적</td>
<td class="pad1">
<!-- <asp:TextBox ID="FLD_TODAYWORKRESULT" runat="server" CssClass="input_text textbox_w98" MaxLength="250" Width="98%"></asp:TextBox> -->
<diV id="DIV_TODAYWORKRESULT">
<input type="text" id="FLD_TODAYWORKRESULT_1" name="FLD_TODAYWORKRESULT_1" onfocus="todayWorkResultAdd(this); return false;" class="input_text textname" maxlength="250" style="width:83%;" /><button ID="btnDeleteTodayWorkResult_1" class="small_btn" style="padding-top:2px;" onclick="todayWorkResultDelete(1);return false;">삭제</button>
</diV>
</td>
</tr>
<tr>
<td class="cell_left">비고</td>
<td class="pad1" colspan="3">
<asp:TextBox ID="FLD_REMARK" runat="server" CssClass="input_text textbox_w98" MaxLength="500" Width="99.5%"></asp:TextBox>
</td>
</tr>
<tr>
<td class="cell_left">메모</td>
<td class="pad1" colspan="3">
<asp:TextBox ID="FLD_TOMORROWWORKPLAN" runat="server" TextMode="MultiLine" Rows="5" CssClass="input_multiline textbox_w99" MaxLength="1000"></asp:TextBox>
</td>
</tr>
</table>
<!-- 기본정보 끝 -->
<!-- 자재 시작 -->
<div class="tab_Title inter_margin">자재</div>
<asp:UpdatePanel ID="MaterialUpdatePanel" runat="server">
<ContentTemplate>
<asp:GridView ID="gvListMaterial" runat="server" AutoGenerateColumns="False" DataKeyNames="MATERIALID"
ShowHeaderWhenEmpty="True" Style="margin-top: 0px" Width="100%" CellPadding="0"
CssClass="table_content btn_margin" PageSize="12" ForeColor="#333333" GridLines="both"
HorizontalAlign="Center" OnRowDataBound = "RowDataBound_Material" ShowFooter="true">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:TemplateField HeaderText="자재명" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="17%">
<ItemTemplate>
<input type="text" id="INPUTRESOURCENAME" name="INPUTRESOURCENAME" value='<%# Eval("INPUTRESOURCENAME") %>' class="search_text textname" ReadOnly="true" maxlength="100" style="width:60%;" />
<input type="hidden" id="INPUTRESOURCEID" name="INPUTRESOURCEID" value='<%# Eval("INPUTRESOURCEID") %>' />
<img src="/images/btn_popsrc.gif" class="popsrc_align" id="INPUTRESOURCE_SEARCHBTN" alt="" onclick="fnSearchPopup(this, 1, 'gvListMaterial');"/>
<img src="/images/btn/eraser.png" class="popsrc_align" id="CLIENTDELBTN" alt="" onclick="fnSearchPopup(this, 2, 'gvListMaterial');"/>
<input type="hidden" id="MATERIALID" name="MATERIALID" value='<%# Eval("MATERIALID") %>' />
<input type="hidden" id="STATUS_GUBUN" name="STATUS_GUBUN" value='' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="규격" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="8%">
<ItemTemplate>
<input type="text" id="SPECIFICATION" name="SPECIFICATION" value='<%# Eval("SPECIFICATION") %>' ReadOnly="true" class="search_text textname" style="width:90%;" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="단위" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="8%">
<ItemTemplate>
<input type="text" id="UNIT" name="UNIT" value='<%# Eval("UNIT") %>' ReadOnly="true" class="search_text textname" style="width:90%;" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="단가" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="10%">
<ItemTemplate>
<input type="text" id="UNITPRICE" name="UNITPRICE" value='<%# Eval("UNITPRICE") %>' class="input_text_number textname" style="width:90%;" onfocus="fnInuptFocus(this);" onkeyup="fnInputNumberOnly(this,'c');" onblur="fnAutoTotal(this, 'gvListMaterial'); fnChange(this);" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="투입업체" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="10%">
<ItemTemplate>
<input type="text" id="INCOMPANY" name="INCOMPANY" value='<%# Eval("INCOMPANY") %>' class="input_text textname" style="width:90%;" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="수량" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="10%">
<ItemTemplate>
<input type="text" id="VOLUME" name="VOLUME" value='<%# Eval("VOLUME") %>' class="input_text_number textname" style="width:90%;" onfocus="fnInuptFocus(this);" onkeyup="fnInputNumberOnly(this,'c');" onblur="fnAutoTotal(this, 'gvListMaterial'); fnChange(this);" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="금액" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="10%" FooterStyle-CssClass="data_AR">
<ItemTemplate>
<input type="text" id="PRICE" name="PRICE" value='<%# Eval("PRICE") %>' ReadOnly="true" class="search_text_number textname" style="width:90%;" onchange="fnInputNumberOnly(this,'c');" />
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="lblTotalPRICE" runat="server"></asp:Label>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="누계수량" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="10%">
<ItemTemplate>
<input type="text" id="SUM_VOLUME" name="SUM_VOLUME" value='<%# Eval("SUM_VOLUME") %>' ReadOnly="true" class="search_text_number textname" style="width:90%;" />
<input type="hidden" id="SUM_VOLUME_" name="SUM_VOLUME_" value='<%# Eval("SUM_VOLUME_") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="누계금액" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="10%" FooterStyle-CssClass="data_AR">
<ItemTemplate>
<input type="text" id="SUM_PRICE" name="SUM_PRICE" value='<%# Eval("SUM_PRICE") %>' ReadOnly="true" class="search_text_number textname" style="width:90%;" />
<input type="hidden" id="SUM_PRICE_" name="SUM_PRICE_" value='<%# Eval("SUM_PRICE_") %>' />
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="lblTotalSUM_PRICE" runat="server"></asp:Label>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="" HeaderStyle-CssClass="cell_center" ItemStyle-HorizontalAlign="Center" FooterStyle-HorizontalAlign="Center" FooterStyle-VerticalAlign="Middle" HeaderStyle-Width="7%">
<ItemTemplate>
<button ID="btnDelete" class="small_btn2" onclick="fnAddDelete(this, 'gvListMaterial');return false;">삭제</button>
</ItemTemplate>
<FooterTemplate>
<button ID="btnAdd" class="small_btn" onclick="fnAddRow(this, 'gvListMaterial');return false;">추가</button>
</FooterTemplate>
</asp:TemplateField>
</Columns>
<EditRowStyle BackColor="#ffffff" />
<EmptyDataRowStyle CssClass="data_AC row25" />
<EmptyDataTemplate>
데이터가 존재하지 않습니다.
</EmptyDataTemplate>
<FooterStyle BackColor="#507CD1" ForeColor="White" Font-Bold="True" />
<HeaderStyle BackColor="#eaecf3" Font-Bold="True" ForeColor="#374994" />
<PagerStyle HorizontalAlign="Center" />
<RowStyle BackColor="#ffffff" CssClass="data_AC" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F5F7FB" />
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
<SortedDescendingCellStyle BackColor="#E9EBEF" />
<SortedDescendingHeaderStyle BackColor="#4870BE" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<!-- 자재 끝 -->
<!-- 장비 시작 -->
<div class="tab_Title inter_margin">장비</div>
<asp:UpdatePanel ID="EquipmentUpdatePanel" runat="server">
<ContentTemplate>
<asp:GridView ID="gvListEquipment" runat="server" AutoGenerateColumns="False" DataKeyNames="EQUIPMENTID"
ShowHeaderWhenEmpty="True" Style="margin-top: 0px" Width="100%" CellPadding="0"
CssClass="table_content btn_margin" PageSize="12" ForeColor="#333333" GridLines="both"
HorizontalAlign="Center" OnRowDataBound = "RowDataBound_Equipment" ShowFooter="true">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:TemplateField HeaderText="장비명" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="25%">
<ItemTemplate>
<input type="text" id="INPUTRESOURCENAME" name="INPUTRESOURCENAME" value='<%# Eval("INPUTRESOURCENAME") %>' class="search_text textname" ReadOnly="true" maxlength="100" style="width:73%;" />
<input type="hidden" id="INPUTRESOURCEID" name="INPUTRESOURCEID" value='<%# Eval("INPUTRESOURCEID") %>' />
<img src="/images/btn_popsrc.gif" class="popsrc_align" id="INPUTRESOURCE_SEARCHBTN" alt="" onclick="fnSearchPopup(this, 1, 'gvListEquipment');"/>
<img src="/images/btn/eraser.png" class="popsrc_align" id="CLIENTDELBTN" alt="" onclick="fnSearchPopup(this, 2, 'gvListEquipment');"/>
<input type="hidden" id="EQUIPMENTID" name="EQUIPMENTID" value='<%# Eval("EQUIPMENTID") %>' />
<input type="hidden" id="STATUS_GUBUN" name="STATUS_GUBUN" value='' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="단위" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="8%">
<ItemTemplate>
<input type="text" id="UNIT" name="UNIT" value='<%# Eval("UNIT") %>' ReadOnly="true" class="search_text textname" style="width:90%;" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="단가" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%">
<ItemTemplate>
<input type="text" id="UNITPRICE" name="UNITPRICE" value='<%# Eval("UNITPRICE") %>' class="input_text_number textname" style="width:92%;" onfocus="fnInuptFocus(this);" onkeyup="fnInputNumberOnly(this,'c');" onblur="fnAutoTotal(this, 'gvListEquipment'); fnChange(this);" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="수량" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%">
<ItemTemplate>
<input type="text" id="VOLUME" name="VOLUME" value='<%# Eval("VOLUME") %>' class="input_text_number textname" style="width:92%;" onfocus="fnInuptFocus(this);" onkeyup="fnInputNumberOnly(this,'c');" onblur="fnAutoTotal(this, 'gvListEquipment'); fnChange(this);" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="금액" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%" FooterStyle-CssClass="data_AR">
<ItemTemplate>
<input type="text" id="PRICE" name="PRICE" value='<%# Eval("PRICE") %>' ReadOnly="true" class="search_text_number textname" style="width:92%;" onchange="fnInputNumberOnly(this,'c');" />
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="lblTotalPRICE" runat="server"></asp:Label>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="누계수량" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%">
<ItemTemplate>
<input type="text" id="SUM_VOLUME" name="SUM_VOLUME" value='<%# Eval("SUM_VOLUME") %>' ReadOnly="true" class="search_text_number textname" style="width:92%;" />
<input type="hidden" id="SUM_VOLUME_" name="SUM_VOLUME_" value='<%# Eval("SUM_VOLUME_") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="누계금액" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%" FooterStyle-CssClass="data_AR">
<ItemTemplate>
<input type="text" id="SUM_PRICE" name="SUM_PRICE" value='<%# Eval("SUM_PRICE") %>' ReadOnly="true" class="search_text_number textname" style="width:92%;" />
<input type="hidden" id="SUM_PRICE_" name="SUM_PRICE_" value='<%# Eval("SUM_PRICE_") %>' />
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="lblTotalSUM_PRICE" runat="server"></asp:Label>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="" HeaderStyle-CssClass="cell_center" ItemStyle-HorizontalAlign="Center" FooterStyle-HorizontalAlign="Center" FooterStyle-VerticalAlign="Middle" HeaderStyle-Width="7%">
<ItemTemplate>
<button ID="btnDelete" class="small_btn2" onclick="fnAddDelete(this, 'gvListEquipment');return false;">삭제</button>
</ItemTemplate>
<FooterTemplate>
<button ID="btnAdd" class="small_btn" onclick="fnAddRow(this, 'gvListEquipment');return false;">추가</button>
</FooterTemplate>
</asp:TemplateField>
</Columns>
<EditRowStyle BackColor="#ffffff" />
<EmptyDataRowStyle CssClass="data_AC row25" />
<EmptyDataTemplate>
데이터가 존재하지 않습니다.
</EmptyDataTemplate>
<FooterStyle BackColor="#507CD1" ForeColor="White" Font-Bold="True" />
<HeaderStyle BackColor="#eaecf3" Font-Bold="True" ForeColor="#374994" />
<PagerStyle HorizontalAlign="Center" />
<RowStyle BackColor="#ffffff" CssClass="data_AC" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F5F7FB" />
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
<SortedDescendingCellStyle BackColor="#E9EBEF" />
<SortedDescendingHeaderStyle BackColor="#4870BE" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<!-- 장비 끝 -->
<!-- 노무비 시작 -->
<div class="tab_Title inter_margin">노무비</div>
<asp:UpdatePanel ID="WorkerCostUpdatePanel" runat="server">
<ContentTemplate>
<asp:GridView ID="gvListWorkerCost" runat="server" AutoGenerateColumns="False" DataKeyNames="WORKERCOSTID"
ShowHeaderWhenEmpty="True" Style="margin-top: 0px" Width="100%" CellPadding="0"
CssClass="table_content btn_margin" PageSize="12" ForeColor="#333333" GridLines="both"
HorizontalAlign="Center" OnRowDataBound = "RowDataBound_WorkerCost" ShowFooter="true">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:TemplateField HeaderText="이름" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="19%">
<ItemTemplate>
<input type="text" id="WORKERNAME" name="WORKERNAME" value='<%# Eval("WORKERNAME") %>' class="search_text textname" ReadOnly="true" maxlength="100" style="width:65%;" />
<input type="hidden" id="WORKERID" name="WORKERID" value='<%# Eval("WORKERID") %>' />
<img src="/images/btn_popsrc.gif" class="popsrc_align" id="WORKER_SEARCHBTN" alt="" onclick="fnSearchPopup(this, 1, 'gvListWorkerCost');"/>
<img src="/images/btn/eraser.png" class="popsrc_align" id="CLIENTDELBTN" alt="" onclick="fnSearchPopup(this, 2, 'gvListWorkerCost');"/>
<input type="hidden" id="WORKERCOSTID" name="WORKERCOSTID" value='<%# Eval("WORKERCOSTID") %>' />
<input type="hidden" id="STATUS_GUBUN" name="STATUS_GUBUN" value='' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="주민번호" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="14%">
<ItemTemplate>
<input type="text" id="RESIDENT" name="RESIDENT" value='<%# Eval("RESIDENT") %>' ReadOnly="true" class="search_text textname" style="width:93%;" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="단가" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%">
<ItemTemplate>
<input type="text" id="UNITPRICE" name="UNITPRICE" value='<%# Eval("UNITPRICE") %>' class="input_text_number textname" style="width:92%;" onfocus="fnInuptFocus(this);" onkeyup="fnInputNumberOnly(this,'c');" onblur="fnAutoTotal(this, 'gvListWorkerCost'); fnChange(this);" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="투입일수" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%">
<ItemTemplate>
<asp:DropDownList ID="ddlWORKDAY" runat="server" CssClass="input_dropdown w100"></asp:DropDownList>
<input type="hidden" id="WORKDAY" name="WORKDAY" value='<%# Eval("WORKDAY") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="금액" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%" FooterStyle-CssClass="data_AR">
<ItemTemplate>
<input type="text" id="PRICE" name="PRICE" value='<%# Eval("PRICE") %>' ReadOnly="true" class="search_text_number textname" style="width:92%;" onchange="fnInputNumberOnly(this,'c');" />
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="lblTotalPRICE" runat="server"></asp:Label>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="누계수량" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%">
<ItemTemplate>
<input type="text" id="SUM_WORKDAY" name="SUM_WORKDAY" value='<%# Eval("SUM_WORKDAY") %>' ReadOnly="true" class="search_text_number textname" style="width:92%;" />
<input type="hidden" id="SUM_WORKDAY_" name="SUM_WORKDAY_" value='<%# Eval("SUM_WORKDAY_") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="누계금액" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%" FooterStyle-CssClass="data_AR">
<ItemTemplate>
<input type="text" id="SUM_PRICE" name="SUM_PRICE" value='<%# Eval("SUM_PRICE") %>' ReadOnly="true" class="search_text_number textname" style="width:92%;" />
<input type="hidden" id="SUM_PRICE_" name="SUM_PRICE_" value='<%# Eval("SUM_PRICE_") %>' />
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="lblTotalSUM_PRICE" runat="server"></asp:Label>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="" HeaderStyle-CssClass="cell_center" ItemStyle-HorizontalAlign="Center" FooterStyle-HorizontalAlign="Center" FooterStyle-VerticalAlign="Middle" HeaderStyle-Width="7%">
<ItemTemplate>
<button ID="btnDelete" class="small_btn2" onclick="fnAddDelete(this, 'gvListWorkerCost');return false;">삭제</button>
</ItemTemplate>
<FooterTemplate>
<button ID="btnAdd" class="small_btn" onclick="fnAddRow(this, 'gvListWorkerCost');return false;">추가</button>
</FooterTemplate>
</asp:TemplateField>
</Columns>
<EditRowStyle BackColor="#ffffff" />
<EmptyDataRowStyle CssClass="data_AC row25" />
<EmptyDataTemplate>
데이터가 존재하지 않습니다.
</EmptyDataTemplate>
<FooterStyle BackColor="#507CD1" ForeColor="White" Font-Bold="True" />
<HeaderStyle BackColor="#eaecf3" Font-Bold="True" ForeColor="#374994" />
<PagerStyle HorizontalAlign="Center" />
<RowStyle BackColor="#ffffff" CssClass="data_AC" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F5F7FB" />
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
<SortedDescendingCellStyle BackColor="#E9EBEF" />
<SortedDescendingHeaderStyle BackColor="#4870BE" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<!-- 노무비 끝 -->
<!-- 간접경비 끝 -->
<div class="tab_Title inter_margin">간접경비</div>
<asp:UpdatePanel ID="IndirectExpenseUpdatePanel" runat="server">
<ContentTemplate>
<asp:GridView ID="gvListIndirectExpense" runat="server" AutoGenerateColumns="False" DataKeyNames="INDIRECTEXPENSEID"
ShowHeaderWhenEmpty="True" Style="margin-top: 0px" Width="100%" CellPadding="0"
CssClass="table_content btn_margin" PageSize="12" ForeColor="#333333" GridLines="both"
HorizontalAlign="Center" OnRowDataBound = "RowDataBound_IndirectExpense" ShowFooter="true">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:TemplateField HeaderText="경비명" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="25%">
<ItemTemplate>
<input type="text" id="INPUTRESOURCENAME" name="INPUTRESOURCENAME" value='<%# Eval("INPUTRESOURCENAME") %>' class="search_text textname" ReadOnly="true" maxlength="100" style="width:83%;" />
<input type="hidden" id="INPUTRESOURCEID" name="INPUTRESOURCEID" value='<%# Eval("INPUTRESOURCEID") %>' />
<img src="/images/btn_popsrc.gif" class="popsrc_align" id="INPUTRESOURCE_SEARCHBTN" alt="" onclick="fnSearchPopup(this, 1, 'gvListIndirectExpense');"/>
<img src="/images/btn/eraser.png" class="popsrc_align" id="CLIENTDELBTN" alt="" onclick="fnSearchPopup(this, 2, 'gvListIndirectExpense');"/>
<input type="hidden" id="INDIRECTEXPENSEID" name="INDIRECTEXPENSEID" value='<%# Eval("INDIRECTEXPENSEID") %>' />
<input type="hidden" id="STATUS_GUBUN" name="STATUS_GUBUN" value='' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="단위" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="8%">
<ItemTemplate>
<input type="text" id="UNIT" name="UNIT" value='<%# Eval("UNIT") %>' ReadOnly="true" class="search_text textname" style="width:90%;" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="단가" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%" Visible="false">
<ItemTemplate>
<input type="text" id="UNITPRICE" name="UNITPRICE" value='<%# Eval("UNITPRICE") %>' class="input_text_number textname" style="width:92%;" onfocus="fnInuptFocus(this);" onkeyup="fnInputNumberOnly(this,'c');" onblur="fnAutoTotal(this, 'gvListIndirectExpense'); fnChange(this);" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="수량" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%" Visible="false">
<ItemTemplate>
<input type="text" id="VOLUME" name="VOLUME" value='<%# Eval("VOLUME") %>' class="input_text_number textname" style="width:92%;" onfocus="fnInuptFocus(this);" onkeyup="fnInputNumberOnly(this,'c');" onblur="fnAutoTotal(this, 'gvListIndirectExpense'); fnChange(this);" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="금액" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%" FooterStyle-CssClass="data_AR">
<ItemTemplate>
<input type="text" id="PRICE" name="PRICE" value='<%# Eval("PRICE") %>' class="input_text_number textname" style="width:92%;" onfocus="fnInuptFocus(this);" onkeyup="fnInputNumberOnly(this,'c');" onblur="fnAutoTotal(this, 'gvListIndirectExpense'); fnChange(this);" />
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="lblTotalPRICE" runat="server"></asp:Label>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="누계수량" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%" Visible="false">
<ItemTemplate>
<input type="text" id="SUM_VOLUME" name="SUM_VOLUME" value='<%# Eval("SUM_VOLUME") %>' ReadOnly="true" class="search_text_number textname" style="width:92%;" />
<input type="hidden" id="SUM_VOLUME_" name="SUM_VOLUME_" value='<%# Eval("SUM_VOLUME_") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="누계금액" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%" FooterStyle-CssClass="data_AR">
<ItemTemplate>
<input type="text" id="SUM_PRICE" name="SUM_PRICE" value='<%# Eval("SUM_PRICE") %>' ReadOnly="true" class="search_text_number textname" style="width:92%;" />
<input type="hidden" id="SUM_PRICE_" name="SUM_PRICE_" value='<%# Eval("SUM_PRICE_") %>' />
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="lblTotalSUM_PRICE" runat="server"></asp:Label>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="" HeaderStyle-CssClass="cell_center" ItemStyle-HorizontalAlign="Center" FooterStyle-HorizontalAlign="Center" FooterStyle-VerticalAlign="Middle" HeaderStyle-Width="4%">
<ItemTemplate>
<button ID="btnDelete" class="small_btn2" onclick="fnAddDelete(this, 'gvListIndirectExpense');return false;">삭제</button>
</ItemTemplate>
<FooterTemplate>
<button ID="btnAdd" class="small_btn" onclick="fnAddRow(this, 'gvListIndirectExpense');return false;">추가</button>
</FooterTemplate>
</asp:TemplateField>
</Columns>
<EditRowStyle BackColor="#ffffff" />
<EmptyDataRowStyle CssClass="data_AC row25" />
<EmptyDataTemplate>
데이터가 존재하지 않습니다.
</EmptyDataTemplate>
<FooterStyle BackColor="#507CD1" ForeColor="White" Font-Bold="True" />
<HeaderStyle BackColor="#eaecf3" Font-Bold="True" ForeColor="#374994" />
<PagerStyle HorizontalAlign="Center" />
<RowStyle BackColor="#ffffff" CssClass="data_AC" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F5F7FB" />
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
<SortedDescendingCellStyle BackColor="#E9EBEF" />
<SortedDescendingHeaderStyle BackColor="#4870BE" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<!-- 간접경비 끝 -->
<!-- 외주비 시작 -->
<div class="tab_Title inter_margin">외주비</div>
<asp:UpdatePanel ID="OutsideOrderExpenseUpdatePanel" runat="server">
<ContentTemplate>
<asp:GridView ID="gvListOutsideOrderExpense" runat="server" AutoGenerateColumns="False" DataKeyNames="OUTSIDEORDEREXPENSEID"
ShowHeaderWhenEmpty="True" Style="margin-top: 0px" Width="100%" CellPadding="0"
CssClass="table_content btn_margin" PageSize="12" ForeColor="#333333" GridLines="both"
HorizontalAlign="Center" OnRowDataBound = "RowDataBound_OutsideOrderExpense" ShowFooter="true">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:TemplateField HeaderText="외주명" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="25%">
<ItemTemplate>
<input type="text" id="INPUTRESOURCENAME" name="INPUTRESOURCENAME" value='<%# Eval("INPUTRESOURCENAME") %>' class="search_text textname" ReadOnly="true" maxlength="100" style="width:73%;" />
<input type="hidden" id="INPUTRESOURCEID" name="INPUTRESOURCEID" value='<%# Eval("INPUTRESOURCEID") %>' />
<img src="/images/btn_popsrc.gif" class="popsrc_align" id="INPUTRESOURCE_SEARCHBTN" alt="" onclick="fnSearchPopup(this, 1, 'gvListOutsideOrderExpense');"/>
<img src="/images/btn/eraser.png" class="popsrc_align" id="CLIENTDELBTN" alt="" onclick="fnSearchPopup(this, 2, 'gvListOutsideOrderExpense');"/>
<input type="hidden" id="OUTSIDEORDEREXPENSEID" name="OUTSIDEORDEREXPENSEID" value='<%# Eval("OUTSIDEORDEREXPENSEID") %>' />
<input type="hidden" id="STATUS_GUBUN" name="STATUS_GUBUN" value='' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="단위" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="8%">
<ItemTemplate>
<input type="text" id="UNIT" name="UNIT" value='<%# Eval("UNIT") %>' ReadOnly="true" class="search_text textname" style="width:90%;" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="단가" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%">
<ItemTemplate>
<input type="text" id="UNITPRICE" name="UNITPRICE" value='<%# Eval("UNITPRICE") %>' class="input_text_number textname" style="width:92%;" onfocus="fnInuptFocus(this);" onkeyup="fnInputNumberOnly(this,'c');" onblur="fnAutoTotal(this, 'gvListOutsideOrderExpense'); fnChange(this);" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="수량" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%">
<ItemTemplate>
<input type="text" id="VOLUME" name="VOLUME" value='<%# Eval("VOLUME") %>' class="input_text_number textname" style="width:92%;" onfocus="fnInuptFocus(this);" onkeyup="fnInputNumberOnly(this,'c');" onblur="fnAutoTotal(this, 'gvListOutsideOrderExpense'); fnChange(this);" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="금액" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%" FooterStyle-CssClass="data_AR">
<ItemTemplate>
<input type="text" id="PRICE" name="PRICE" value='<%# Eval("PRICE") %>' ReadOnly="true" class="search_text_number textname" style="width:92%;" onchange="fnInputNumberOnly(this,'c');" />
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="lblTotalPRICE" runat="server"></asp:Label>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="누계수량" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%">
<ItemTemplate>
<input type="text" id="SUM_VOLUME" name="SUM_VOLUME" value='<%# Eval("SUM_VOLUME") %>' ReadOnly="true" class="search_text_number textname" style="width:92%;" />
<input type="hidden" id="SUM_VOLUME_" name="SUM_VOLUME_" value='<%# Eval("SUM_VOLUME_") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="누계금액" HeaderStyle-CssClass="cell_center" HeaderStyle-Width="12%" FooterStyle-CssClass="data_AR">
<ItemTemplate>
<input type="text" id="SUM_PRICE" name="SUM_PRICE" value='<%# Eval("SUM_PRICE") %>' ReadOnly="true" class="search_text_number textname" style="width:92%;" />
<input type="hidden" id="SUM_PRICE_" name="SUM_PRICE_" value='<%# Eval("SUM_PRICE_") %>' />
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="lblTotalSUM_PRICE" runat="server"></asp:Label>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="" HeaderStyle-CssClass="cell_center" ItemStyle-HorizontalAlign="Center" FooterStyle-HorizontalAlign="Center" FooterStyle-VerticalAlign="Middle" HeaderStyle-Width="7%">
<ItemTemplate>
<button ID="btnDelete" class="small_btn2" onclick="fnAddDelete(this, 'gvListOutsideOrderExpense');return false;">삭제</button>
</ItemTemplate>
<FooterTemplate>
<button ID="btnAdd" class="small_btn" onclick="fnAddRow(this, 'gvListOutsideOrderExpense');return false;">추가</button>
</FooterTemplate>
</asp:TemplateField>
</Columns>
<EditRowStyle BackColor="#ffffff" />
<EmptyDataRowStyle CssClass="data_AC row25" />
<EmptyDataTemplate>
데이터가 존재하지 않습니다.
</EmptyDataTemplate>
<FooterStyle BackColor="#507CD1" ForeColor="White" Font-Bold="True" />
<HeaderStyle BackColor="#eaecf3" Font-Bold="True" ForeColor="#374994" />
<PagerStyle HorizontalAlign="Center" />
<RowStyle BackColor="#ffffff" CssClass="data_AC" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F5F7FB" />
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
<SortedDescendingCellStyle BackColor="#E9EBEF" />
<SortedDescendingHeaderStyle BackColor="#4870BE" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<!-- 외주비 끝 -->
<!-- 총계 시작 -->
<div class="tab_Title inter_margin">총계</div>
<table border="1" cellpadding="0" cellspacing="0" width="100%" class="table_content">
<colgroup>
<col width="18%" />
<col width="18%" />
<col width="18%" />
<col width="18%" />
<!-- 마진금액, 마진율 필요 없어서 주석 처리 (2016-06-17)
<col width="18%" />
<col width="10%" />
-->
</colgroup>
<tr>
<td class="cell_center">계약금액</td>
<td class="cell_center">변경금액</td>
<td class="cell_center">금일총투입금액</td>
<td class="cell_center">누계총투입금액</td>
<!-- 마진금액, 마진율 필요 없어서 주석 처리 (2016-06-17)
<td class="cell_center">마진금액</td>
<td class="cell_center">마진율</td>
-->
</tr>
<tr>
<td class="pad1">
<asp:HiddenField ID="FLD_CONSTRUCTAMOUNTID" runat="server" />
<!-- 계약금액 -->
<asp:TextBox ID="FLD_CONSTRUCTAMOUNT" runat="server" ReadOnly="true" CssClass="search_text_number textbox_w96" onkeyup="fnInputNumberOnly(this,'c');" onblur="fnInputNumberOnly(this,'c'); fnPlanChange();" />
</td>
<td class="pad1">
<!-- 변경금액 -->
<asp:TextBox ID="FLD_CHANGECONSTRUCTAMOUNT" runat="server" ReadOnly="true" CssClass="search_text_number textbox_w96" onkeyup="fnInputNumberOnly(this,'c');" onblur="fnInputNumberOnly(this,'c'); fnPlanChange();" />
</td>
<td class="pad1">
<!-- 금일총투입금액 -->
<asp:TextBox ID="FLD_PLANAMOUNTTOTAL" runat="server" ReadOnly="true" CssClass="search_text_number textbox_w96" />
</td>
<td class="pad1">
<!-- 누계총투입금액 -->
<asp:TextBox ID="FLD_SUMAMOUNTTOTAL" runat="server" ReadOnly="true" CssClass="search_text_number textbox_w96" />
<asp:HiddenField ID="hdnSumAmountTotal" runat="server" />
</td>
<!-- 마진금액, 마진율 필요 없어서 주석 처리 (2016-06-17)
<td class="pad1">
<!-- 마진금액
<asp:TextBox ID="FLD_MARGIN" runat="server" ReadOnly="true" CssClass="search_text_number textbox_w96" />
</td>
<td class="pad1">
<!-- 마진율
<asp:TextBox ID="FLD_MARGIN_PER" runat="server" ReadOnly="true" CssClass="search_text_number textbox_w94" />
</td>
-->
</tr>
</table>
<!-- 총계 끝 -->
</div>
<!-- 취소, 저장 버튼 -->
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="btn_bottom inter_margin">
<tr>
<td class="AR">
<asp:Button ID="btnList2" runat="server" Text="취소" CssClass="blueBtn1" CausesValidation="false" OnClientClick="fnBaseGoBack();return false;" />
<asp:Button ID="btnSave2" runat="server" Text="저장" CssClass="blueBtn1" OnClick="btnSave_Click" CommandName="Create" OnClientClick="return fnSave();" />
</td>
</tr>
</table>
<asp:HiddenField ID="FLD_REGUSER" runat="server" />
<!-- 그리드 컨트롤들의 값 셋팅하기 위한 히든컨트롤 -->
<asp:HiddenField ID="hdnMATERIALResultData" runat="server" />
<asp:HiddenField ID="hdnEQUIPMENTResultData" runat="server" />
<asp:HiddenField ID="hdnWORKERCOSTResultData" runat="server" />
<asp:HiddenField ID="hdnINDIRECTEXPENSEResultData" runat="server" />
<asp:HiddenField ID="hdnOUTSIDEORDEREXPENSEResultData" runat="server" />
<asp:HiddenField ID="hdnCONSTRUCTDAILYID" runat="server" />
<!-- 오늘작업계획, 오늘작업실적 컨트롤들의 값 셋팅하기 위한 히든컨트롤 -->
<asp:HiddenField ID="hdnDivTodayWorkPlan" runat="server" />
<asp:HiddenField ID="hdnDivTodayWorkResult" runat="server" />
<script type="text/javascript">
// 총계 섹션의 "금일총투입금액" 자동계산
fnAutoPlanTotal();
// 총계 섹션의 "누계총투입금액" 자동계산
fnAutoPlanTotal_SUM();
</script>
</asp:Content>
다음으로 .aspx.cs 부분 입니다.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using System.Data;
using FrameWork.Except;
using System.Configuration;
using System.IO;
using System.Web.Script.Serialization;
namespace ssCRM_UI.Pages__C004.CT
{
public partial class CTCD_Write : ssCRM_UI.Common.ControlUtilAuth
{
#region 전역변수
int keyId = 0; // 공사일보 키값
int keyId2 = 0; // 공사 키값
string keyName = ""; // 공사명
#endregion
#region Page_Load
protected void Page_Load(object sender, EventArgs e)
{
this.Page.Form.DefaultButton = this.btnSave.UniqueID;
this.keyId = this.GetKeyId(); // 공사일보 일련번호
this.hdnCONSTRUCTDAILYID.Value = this.keyId.ToString();
this.keyId2 = this.GetKeyId("keyId2"); // 공사 일련번호
this.keyName = DecryptKey(GetString(Request.QueryString["keyName"])); // 공사명
if (!IsPostBack)
{
this.FLD_CONSTRUCTNAME.Attributes.Add("readonly", "readonly");
// 일자 금일로 셋팅
this.FLD_CONSTRUCTDAILYDATE.Text = DateTime.Now.ToString("yyyy-MM-dd");
// 코드 표시
this.SetDataBind();
// 수정시
if (this.keyId > 0)
{
btnSave.CommandName = "Update";
// 수정일 경우 공사 정보를 변경하지 못함.
this.btnConstructSearch.Disabled = true;
this.btnConstructReset.Disabled = true;
}
else
{
// 등록시 (자재, 장비, 노무비, 경비, 외주 탭에 사용하는 프로시저는 다른 쪽과 공통으로 사용하므로 공사일련번호, 공사명 셋팅 후 초기화)
if (this.keyId2 > 0)
{
this.FLD_CONSTRUCTID.Value = this.keyId2.ToString();
this.FLD_CONSTRUCTNAME.Text = this.keyName;
this.keyId2 = 0;
}
// 최근정보불러오기 기능 추가 (2016-06-15)
this.btnLastInfoLoad.Visible = true;
}
// 데이터 가져오기
this.GetDetail("");
// 역할권한관리에서 설정한 버튼 및 데이터 권한 확인.
// 조회, 수정 화면일 경우에는 해당 정보에서 본인에 해당되는 값을 인자로 전달해야 함.
// 목록 화면일 경우에는 목록 조회 메서드에서 권한 범위에 따른 검색 항목을 전달해야 함.
// 코드 내에서 버튼 visible = true 속성을 설정할 경우에는 다음과 같이 처리해야 함. btnX.Visible = (ArrAuthList.IndexOf(btnX.CommandName) != -1);
// 2014-02-21 정한솔
string[] userIds = { this.FLD_REGUSER.Value };
CheckAuth(userIds);
}
}
#endregion
#region SetDataBind() : 코드 정보 표시
/// <summary>
/// Method 명: SetDataBind()
/// Method내용: 코드 정보 표시
/// 작 성 자:
/// 최초작성일: 2016-03-11
/// 최종수정자:
/// 최종수정일:
/// </summary>
/// <param name=""></param>
/// <returns>
/// </returns>
private void SetDataBind()
{
}
#endregion
#region GoView() : 공사일보 상세페이지 이동
/// <summary>
/// Method 명: GoView()
/// Method내용: 공사일보 상세페이지 이동
/// 작 성 자:
/// 최초작성일: 2016-03-11
/// 최종수정자:
/// 최종수정일:
/// </summary>
/// <param name=""></param>
/// <returns>
/// </returns>
private void GoView()
{
Response.Redirect("CTCD_View.aspx?keyId=" + EncryptKey(this.keyId) + "&keyId2=" + EncryptKey(this.keyId2), false);
}
#endregion
#region GetDetail() : 공사일보 조회(수정시 기존 정보 조회)
/// <summary>
/// Method 명: GetDetail()
/// Method내용: 공사일보 조회(수정시 기존 정보 조회)
/// 작 성 자:
/// 최초작성일: 2016-03-11
/// 최종수정자:
/// 최종수정일:
/// </summary>
/// <param name=""></param>
/// <returns>
/// </returns>
private void GetDetail(string getType)
{
Biz.FW.FWXmlAutoBiz oBiz = null;
Hashtable ht;
DataSet dsData = null;
int keyId_temp1 = 0;
int keyId_temp2 = 0;
try
{
#region 최근 정보 불러오기 기능 추가 (2016-06-15)
if (getType == "LastInfoLoad")
{
keyId_temp1 = this.keyId;
keyId_temp2 = this.keyId2;
ht = new Hashtable();
ht.Add("CONSTRUCTID", this.FLD_CONSTRUCTID.Value);
ht.Add("SESSIONUSERID", this.sessionUserId);
oBiz = new Biz.FW.FWXmlAutoBiz();
dsData = oBiz.XmlGetData("uspConstructDailyLastInfo__C004", ht);
if (dsData != null && dsData.Tables.Count > 0 && dsData.Tables[0].Rows.Count > 0)
{
this.keyId = Convert.ToInt32(dsData.Tables[0].Rows[0]["CONSTRUCTDAILYID"]); // 공사일보 일련번호
this.keyId2 = Convert.ToInt32(dsData.Tables[0].Rows[0]["CONSTRUCTID"]); // 공사 일련번호
}
}
#endregion
#region 기본정보
ht = new Hashtable();
ht.Add("CONSTRUCTDAILYID", this.keyId);
ht.Add("CONSTRUCTID", this.keyId2);
ht.Add("SESSIONUSERID", this.sessionUserId);
oBiz = new Biz.FW.FWXmlAutoBiz();
dsData = oBiz.XmlGetData("uspConstructDailyView__C004", ht);
if (dsData != null && dsData.Tables.Count > 0 && dsData.Tables[0].Rows.Count > 0)
{
this.FLD_CONSTRUCTID.Value = dsData.Tables[0].Rows[0]["CONSTRUCTID"].ToString(); // 공사 일련번호
this.FLD_CONSTRUCTNAME.Text = dsData.Tables[0].Rows[0]["CONSTRUCTNAME"].ToString(); // 공사명
// 최근정보불러오기에서 일자는 변경하지 않음.
if (getType != "LastInfoLoad")
this.FLD_CONSTRUCTDAILYDATE.Text = dsData.Tables[0].Rows[0]["CONSTRUCTDAILYDATE"].ToString(); // 일자
this.FLD_WEATHER.Text = dsData.Tables[0].Rows[0]["WEATHER"].ToString(); // 날씨
this.FLD_TODAYWORKPLAN.Text = dsData.Tables[0].Rows[0]["TODAYWORKPLAN"].ToString(); // 오늘작업계획
this.FLD_TODAYWORKRESULT.Text = dsData.Tables[0].Rows[0]["TODAYWORKRESULT"].ToString(); // 오늘작업실적
this.FLD_REMARK.Text = dsData.Tables[0].Rows[0]["REMARK"].ToString(); // 비고
this.FLD_TOMORROWWORKPLAN.Text = dsData.Tables[0].Rows[0]["TOMORROWWORKPLAN"].ToString(); // 내일작업계획
}
#endregion
#region 자재
ht = new Hashtable();
ht.Add("CONSTRUCTID", this.keyId2);
ht.Add("CONSTRUCTDAILYID", this.keyId);
ht.Add("PLAN_YN", "N");
ht.Add("SESSIONUSERID", this.sessionUserId);
// 최근정보불러오기에서 누계수량, 누계금액 셋팅을 위해서 추가(2016-06-15)
ht.Add("GETTYPE", getType);
oBiz = new Biz.FW.FWXmlAutoBiz();
dsData = oBiz.XmlGetData("uspMaterialList__C004", ht);
if (dsData != null && dsData.Tables.Count > 0 && dsData.Tables[0].Rows.Count > 0)
{
// 최근정보불러오기에서 자재 일련번호는 0 처리
if (getType == "LastInfoLoad")
{
dsData.Tables[0].Columns.Remove("MATERIALID");
dsData.Tables[0].Columns.Add("MATERIALID", typeof(System.Int32));
dsData.Tables[0].Columns["MATERIALID"].Expression = "0";
}
this.gvListMaterial.DataSource = dsData.Tables[0];
this.gvListMaterial.DataBind();
}
else
{
// 조회 결과 미 존재시 빈 Row 표시
DataTable dt_Material = new DataTable();
dt_Material.Columns.Add(new DataColumn("INPUTRESOURCENAME")); // 자재명
dt_Material.Columns.Add(new DataColumn("INPUTRESOURCEID")); // 자재ID
dt_Material.Columns.Add(new DataColumn("MATERIALID")); // 자재 투입 일련번호
dt_Material.Columns.Add(new DataColumn("SPECIFICATION")); // 규격
dt_Material.Columns.Add(new DataColumn("UNIT")); // 단위
dt_Material.Columns.Add(new DataColumn("UNITPRICE")); // 단가
dt_Material.Columns.Add(new DataColumn("INCOMPANY")); // 투입업체
dt_Material.Columns.Add(new DataColumn("VOLUME")); // 수량
dt_Material.Columns.Add(new DataColumn("PRICE")); // 금액
dt_Material.Columns.Add(new DataColumn("SUM_VOLUME")); // 누계수량
dt_Material.Columns.Add(new DataColumn("SUM_PRICE")); // 누계금액
dt_Material.Columns.Add(new DataColumn("SUM_VOLUME_")); // 누계수량(해당 Row의 수량을 뺀 값)
dt_Material.Columns.Add(new DataColumn("SUM_PRICE_")); // 누계금액(해당 Row의 금액을 뺀 값)
DataRow dr_Material;
dr_Material = dt_Material.NewRow();
dr_Material["INPUTRESOURCENAME"] = ""; // 자재명
dr_Material["INPUTRESOURCEID"] = ""; // 자재ID
dr_Material["MATERIALID"] = ""; // 자재 투입 일련번호
dr_Material["SPECIFICATION"] = ""; // 규격
dr_Material["UNIT"] = ""; // 단위
dr_Material["UNITPRICE"] = "0"; // 단가
dr_Material["INCOMPANY"] = ""; // 투입업체
dr_Material["VOLUME"] = "0"; // 수량
dr_Material["PRICE"] = "0"; // 금액
dr_Material["SUM_VOLUME"] = "0"; // 누계수량
dr_Material["SUM_PRICE"] = "0"; // 누계금액
dr_Material["SUM_VOLUME_"] = "0"; // 누계수량(해당 Row의 수량을 뺀 값)
dr_Material["SUM_PRICE_"] = "0"; // 누계금액(해당 Row의 금액을 뺀 값)
dt_Material.Rows.Add(dr_Material);
this.gvListMaterial.DataSource = dt_Material;
this.gvListMaterial.DataBind();
}
#endregion
#region 장비
ht = new Hashtable();
ht.Add("CONSTRUCTID", this.keyId2);
ht.Add("CONSTRUCTDAILYID", this.keyId);
ht.Add("PLAN_YN", "N");
ht.Add("SESSIONUSERID", this.sessionUserId);
// 최근정보불러오기에서 누계수량, 누계금액 셋팅을 위해서 추가(2016-06-15)
ht.Add("GETTYPE", getType);
oBiz = new Biz.FW.FWXmlAutoBiz();
dsData = oBiz.XmlGetData("uspEquipmentList__C004", ht);
if (dsData != null && dsData.Tables.Count > 0 && dsData.Tables[0].Rows.Count > 0)
{
// 최근정보불러오기에서 자재 일련번호는 0 처리
if (getType == "LastInfoLoad")
{
dsData.Tables[0].Columns.Remove("EQUIPMENTID");
dsData.Tables[0].Columns.Add("EQUIPMENTID", typeof(System.Int32));
dsData.Tables[0].Columns["EQUIPMENTID"].Expression = "0";
}
this.gvListEquipment.DataSource = dsData.Tables[0];
this.gvListEquipment.DataBind();
}
else
{
// 조회 결과 미 존재시 빈 Row 표시
DataTable dt_Equipment = new DataTable();
dt_Equipment.Columns.Add(new DataColumn("INPUTRESOURCENAME")); // 장비명
dt_Equipment.Columns.Add(new DataColumn("INPUTRESOURCEID")); // 장비ID
dt_Equipment.Columns.Add(new DataColumn("EQUIPMENTID")); // 장비 투입 일련번호
dt_Equipment.Columns.Add(new DataColumn("UNIT")); // 단위
dt_Equipment.Columns.Add(new DataColumn("UNITPRICE")); // 단가
dt_Equipment.Columns.Add(new DataColumn("VOLUME")); // 수량
dt_Equipment.Columns.Add(new DataColumn("PRICE")); // 금액
dt_Equipment.Columns.Add(new DataColumn("SUM_VOLUME")); // 누계수량
dt_Equipment.Columns.Add(new DataColumn("SUM_PRICE")); // 누계금액
dt_Equipment.Columns.Add(new DataColumn("SUM_VOLUME_")); // 누계수량(해당 Row의 수량을 뺀 값)
dt_Equipment.Columns.Add(new DataColumn("SUM_PRICE_")); // 누계금액(해당 Row의 금액을 뺀 값)
DataRow dr_Equipment;
dr_Equipment = dt_Equipment.NewRow();
dr_Equipment["INPUTRESOURCENAME"] = ""; // 장비명
dr_Equipment["INPUTRESOURCEID"] = ""; // 장비ID
dr_Equipment["EQUIPMENTID"] = ""; // 장비 투입 일련번호
dr_Equipment["UNIT"] = ""; // 단위
dr_Equipment["UNITPRICE"] = "0"; // 단가
dr_Equipment["VOLUME"] = "0"; // 수량
dr_Equipment["PRICE"] = "0"; // 금액
dr_Equipment["SUM_VOLUME"] = "0"; // 누계수량
dr_Equipment["SUM_PRICE"] = "0"; // 누계금액
dr_Equipment["SUM_VOLUME_"] = "0"; // 누계수량(해당 Row의 수량을 뺀 값)
dr_Equipment["SUM_PRICE_"] = "0"; // 누계금액(해당 Row의 금액을 뺀 값)
dt_Equipment.Rows.Add(dr_Equipment);
this.gvListEquipment.DataSource = dt_Equipment;
this.gvListEquipment.DataBind();
}
#endregion
#region 노무비
ht = new Hashtable();
ht.Add("CONSTRUCTID", this.keyId2);
ht.Add("CONSTRUCTDAILYID", this.keyId);
ht.Add("PLAN_YN", "N");
ht.Add("SESSIONUSERID", this.sessionUserId);
// 최근정보불러오기에서 누계수량, 누계금액 셋팅을 위해서 추가(2016-06-15)
ht.Add("GETTYPE", getType);
oBiz = new Biz.FW.FWXmlAutoBiz();
dsData = oBiz.XmlGetData("uspWorkerCostList__C004", ht);
if (dsData != null && dsData.Tables.Count > 0 && dsData.Tables[0].Rows.Count > 0)
{
// 최근정보불러오기에서 자재 일련번호는 0 처리
if (getType == "LastInfoLoad")
{
dsData.Tables[0].Columns.Remove("WORKERCOSTID");
dsData.Tables[0].Columns.Add("WORKERCOSTID", typeof(System.Int32));
dsData.Tables[0].Columns["WORKERCOSTID"].Expression = "0";
}
this.gvListWorkerCost.DataSource = dsData.Tables[0];
this.gvListWorkerCost.DataBind();
}
else
{
// 조회 결과 미 존재시 빈 Row 표시
DataTable dt_WorkerCost = new DataTable();
dt_WorkerCost.Columns.Add(new DataColumn("WORKERNAME")); // 근로자(이름)명
dt_WorkerCost.Columns.Add(new DataColumn("WORKERID")); // 근로자ID
dt_WorkerCost.Columns.Add(new DataColumn("WORKERCOSTID")); // 노부비 투입 일련번호
dt_WorkerCost.Columns.Add(new DataColumn("RESIDENT")); // 주민번호
dt_WorkerCost.Columns.Add(new DataColumn("UNITPRICE")); // 단가
dt_WorkerCost.Columns.Add(new DataColumn("WORKDAY")); // 투입일수
dt_WorkerCost.Columns.Add(new DataColumn("PRICE")); // 금액
dt_WorkerCost.Columns.Add(new DataColumn("SUM_WORKDAY")); // 누계수량
dt_WorkerCost.Columns.Add(new DataColumn("SUM_PRICE")); // 누계금액
dt_WorkerCost.Columns.Add(new DataColumn("SUM_WORKDAY_")); // 누계수량(해당 Row의 수량을 뺀 값)
dt_WorkerCost.Columns.Add(new DataColumn("SUM_PRICE_")); // 누계금액(해당 Row의 금액을 뺀 값)
DataRow dr_WorkerCost;
dr_WorkerCost = dt_WorkerCost.NewRow();
dr_WorkerCost["WORKERNAME"] = ""; // 근로자(이름)명
dr_WorkerCost["WORKERID"] = ""; // 근로자ID
dr_WorkerCost["WORKERCOSTID"] = ""; // 노부비 투입 일련번호
dr_WorkerCost["RESIDENT"] = ""; // 주민번호
dr_WorkerCost["UNITPRICE"] = "0"; // 단가
dr_WorkerCost["WORKDAY"] = "0"; // 투입일수
dr_WorkerCost["PRICE"] = "0"; // 금액
dr_WorkerCost["SUM_WORKDAY"] = "0"; // 누계수량
dr_WorkerCost["SUM_PRICE"] = "0"; // 누계금액
dr_WorkerCost["SUM_WORKDAY_"] = "0"; // 누계수량(해당 Row의 수량을 뺀 값)
dr_WorkerCost["SUM_PRICE_"] = "0"; // 누계금액(해당 Row의 금액을 뺀 값)
dt_WorkerCost.Rows.Add(dr_WorkerCost);
this.gvListWorkerCost.DataSource = dt_WorkerCost;
this.gvListWorkerCost.DataBind();
}
#endregion
#region 간접경비
ht = new Hashtable();
ht.Add("CONSTRUCTID", this.keyId2);
ht.Add("CONSTRUCTDAILYID", this.keyId);
ht.Add("PLAN_YN", "N");
ht.Add("SESSIONUSERID", this.sessionUserId);
// 최근정보불러오기에서 누계수량, 누계금액 셋팅을 위해서 추가(2016-06-15)
ht.Add("GETTYPE", getType);
oBiz = new Biz.FW.FWXmlAutoBiz();
dsData = oBiz.XmlGetData("uspIndirectExpenseList__C004", ht);
if (dsData != null && dsData.Tables.Count > 0 && dsData.Tables[0].Rows.Count > 0)
{
// 최근정보불러오기에서 자재 일련번호는 0 처리
if (getType == "LastInfoLoad")
{
dsData.Tables[0].Columns.Remove("INDIRECTEXPENSEID");
dsData.Tables[0].Columns.Add("INDIRECTEXPENSEID", typeof(System.Int32));
dsData.Tables[0].Columns["INDIRECTEXPENSEID"].Expression = "0";
}
this.gvListIndirectExpense.DataSource = dsData.Tables[0];
this.gvListIndirectExpense.DataBind();
}
else
{
// 조회 결과 미 존재시 빈 Row 표시
DataTable dt_IndirectExpense = new DataTable();
dt_IndirectExpense.Columns.Add(new DataColumn("INPUTRESOURCENAME")); // 장비명
dt_IndirectExpense.Columns.Add(new DataColumn("INPUTRESOURCEID")); // 장비ID
dt_IndirectExpense.Columns.Add(new DataColumn("INDIRECTEXPENSEID")); // 간접경비 투입 일련번호
dt_IndirectExpense.Columns.Add(new DataColumn("UNIT")); // 단위
dt_IndirectExpense.Columns.Add(new DataColumn("UNITPRICE")); // 단가
dt_IndirectExpense.Columns.Add(new DataColumn("VOLUME")); // 수량
dt_IndirectExpense.Columns.Add(new DataColumn("PRICE")); // 금액
dt_IndirectExpense.Columns.Add(new DataColumn("SUM_VOLUME")); // 누계수량
dt_IndirectExpense.Columns.Add(new DataColumn("SUM_PRICE")); // 누계금액
dt_IndirectExpense.Columns.Add(new DataColumn("SUM_VOLUME_")); // 누계수량(해당 Row의 수량을 뺀 값)
dt_IndirectExpense.Columns.Add(new DataColumn("SUM_PRICE_")); // 누계금액(해당 Row의 금액을 뺀 값)
DataRow dr_IndirectExpense;
dr_IndirectExpense = dt_IndirectExpense.NewRow();
dr_IndirectExpense["INPUTRESOURCENAME"] = ""; // 장비명
dr_IndirectExpense["INPUTRESOURCEID"] = ""; // 장비ID
dr_IndirectExpense["INDIRECTEXPENSEID"] = ""; // 간접경비 투입 일련번호
dr_IndirectExpense["UNIT"] = ""; // 단위
dr_IndirectExpense["UNITPRICE"] = "0"; // 단가
dr_IndirectExpense["VOLUME"] = "0"; // 수량
dr_IndirectExpense["PRICE"] = "0"; // 금액
dr_IndirectExpense["SUM_VOLUME"] = "0"; // 누계수량
dr_IndirectExpense["SUM_PRICE"] = "0"; // 누계금액
dr_IndirectExpense["SUM_VOLUME_"] = "0"; // 누계수량(해당 Row의 수량을 뺀 값)
dr_IndirectExpense["SUM_PRICE_"] = "0"; // 누계금액(해당 Row의 금액을 뺀 값)
dt_IndirectExpense.Rows.Add(dr_IndirectExpense);
this.gvListIndirectExpense.DataSource = dt_IndirectExpense;
this.gvListIndirectExpense.DataBind();
}
#endregion
#region 외주비
ht = new Hashtable();
ht.Add("CONSTRUCTID", this.keyId2);
ht.Add("CONSTRUCTDAILYID", this.keyId);
ht.Add("PLAN_YN", "N");
ht.Add("SESSIONUSERID", this.sessionUserId);
// 최근정보불러오기에서 누계수량, 누계금액 셋팅을 위해서 추가(2016-06-15)
ht.Add("GETTYPE", getType);
oBiz = new Biz.FW.FWXmlAutoBiz();
dsData = oBiz.XmlGetData("uspOutsideOrderExpenseList__C004", ht);
if (dsData != null && dsData.Tables.Count > 0 && dsData.Tables[0].Rows.Count > 0)
{
// 최근정보불러오기에서 자재 일련번호는 0 처리
if (getType == "LastInfoLoad")
{
dsData.Tables[0].Columns.Remove("OUTSIDEORDEREXPENSEID");
dsData.Tables[0].Columns.Add("OUTSIDEORDEREXPENSEID", typeof(System.Int32));
dsData.Tables[0].Columns["OUTSIDEORDEREXPENSEID"].Expression = "0";
}
this.gvListOutsideOrderExpense.DataSource = dsData.Tables[0];
this.gvListOutsideOrderExpense.DataBind();
}
else
{
// 조회 결과 미 존재시 빈 Row 표시
DataTable dt_OutsideOrderExpense = new DataTable();
dt_OutsideOrderExpense.Columns.Add(new DataColumn("INPUTRESOURCENAME")); // 장비명
dt_OutsideOrderExpense.Columns.Add(new DataColumn("INPUTRESOURCEID")); // 장비ID
dt_OutsideOrderExpense.Columns.Add(new DataColumn("OUTSIDEORDEREXPENSEID")); // 외주비 투입 일련번호
dt_OutsideOrderExpense.Columns.Add(new DataColumn("UNIT")); // 단위
dt_OutsideOrderExpense.Columns.Add(new DataColumn("UNITPRICE")); // 단가
dt_OutsideOrderExpense.Columns.Add(new DataColumn("VOLUME")); // 수량
dt_OutsideOrderExpense.Columns.Add(new DataColumn("PRICE")); // 금액
dt_OutsideOrderExpense.Columns.Add(new DataColumn("SUM_VOLUME")); // 누계수량
dt_OutsideOrderExpense.Columns.Add(new DataColumn("SUM_PRICE")); // 누계금액
dt_OutsideOrderExpense.Columns.Add(new DataColumn("SUM_VOLUME_")); // 누계수량(해당 Row의 수량을 뺀 값)
dt_OutsideOrderExpense.Columns.Add(new DataColumn("SUM_PRICE_")); // 누계금액(해당 Row의 금액을 뺀 값)
DataRow dr_OutsideOrderExpense;
dr_OutsideOrderExpense = dt_OutsideOrderExpense.NewRow();
dr_OutsideOrderExpense["INPUTRESOURCENAME"] = ""; // 장비명
dr_OutsideOrderExpense["INPUTRESOURCEID"] = ""; // 장비ID
dr_OutsideOrderExpense["OUTSIDEORDEREXPENSEID"] = ""; // 외주비 투입 일련번호
dr_OutsideOrderExpense["UNIT"] = ""; // 단위
dr_OutsideOrderExpense["UNITPRICE"] = "0"; // 단가
dr_OutsideOrderExpense["VOLUME"] = "0"; // 수량
dr_OutsideOrderExpense["PRICE"] = "0"; // 금액
dr_OutsideOrderExpense["SUM_VOLUME"] = "0"; // 누계수량
dr_OutsideOrderExpense["SUM_PRICE"] = "0"; // 누계금액
dr_OutsideOrderExpense["SUM_VOLUME_"] = "0"; // 누계수량(해당 Row의 수량을 뺀 값)
dr_OutsideOrderExpense["SUM_PRICE_"] = "0"; // 누계금액(해당 Row의 금액을 뺀 값)
dt_OutsideOrderExpense.Rows.Add(dr_OutsideOrderExpense);
this.gvListOutsideOrderExpense.DataSource = dt_OutsideOrderExpense;
this.gvListOutsideOrderExpense.DataBind();
}
#endregion
#region 총계
ht = new Hashtable();
ht.Add("CONSTRUCTDAILYID", this.keyId);
ht.Add("CONSTRUCTID", this.keyId2);
ht.Add("SESSIONUSERID", this.sessionUserId);
// 최근정보불러오기에서 누계수량, 누계금액 셋팅을 위해서 추가(2016-06-15)
ht.Add("PLAN_YN", "N");
ht.Add("GETTYPE", getType);
oBiz = new Biz.FW.FWXmlAutoBiz();
dsData = oBiz.XmlGetData("uspConstructAmountView__C004", ht);
if (dsData != null && dsData.Tables.Count > 0 && dsData.Tables[0].Rows.Count > 0)
{
this.FLD_CONSTRUCTAMOUNTID.Value = dsData.Tables[0].Rows[0]["CONSTRUCTAMOUNTID"].ToString();
this.FLD_CONSTRUCTAMOUNT.Text = dsData.Tables[0].Rows[0]["CONSTRUCTAMOUNT_"].ToString();
this.FLD_CHANGECONSTRUCTAMOUNT.Text = dsData.Tables[0].Rows[0]["CHANGECONSTRUCTAMOUNT_"].ToString();
this.FLD_SUMAMOUNTTOTAL.Text = dsData.Tables[0].Rows[0]["SUMAMOUNTTOTAL"].ToString();
this.hdnSumAmountTotal.Value = dsData.Tables[0].Rows[0]["SUMAMOUNTTOTAL_"].ToString();
}
else
{
this.FLD_CONSTRUCTAMOUNT.Text = "0";
this.FLD_CHANGECONSTRUCTAMOUNT.Text = "0";
this.FLD_PLANAMOUNTTOTAL.Text = "0";
this.FLD_SUMAMOUNTTOTAL.Text = "0";
this.FLD_MARGIN.Text = "0";
this.FLD_MARGIN_PER.Text = "0";
}
#endregion
#region 오늘작업계획
ht = new Hashtable();
ht.Add("CONSTRUCTDAILYID", this.keyId);
ht.Add("SESSIONUSERID", this.sessionUserId);
oBiz = new Biz.FW.FWXmlAutoBiz();
dsData = oBiz.XmlGetData("uspTodayWorkPlanList__C004", ht);
if (dsData != null && dsData.Tables.Count > 0 && dsData.Tables[0].Rows.Count > 0)
{
var list = new List<Dictionary<string, object>>();
foreach (DataRow row in dsData.Tables[0].Rows)
{
var dict = new Dictionary<string, object>();
foreach (DataColumn col in dsData.Tables[0].Columns)
{
dict[col.ColumnName] = (Convert.ToString(row[col]));
}
list.Add(dict);
}
JavaScriptSerializer serializer = new JavaScriptSerializer();
this.hdnDivTodayWorkPlan.Value = serializer.Serialize(list);
}
#endregion
#region 오늘작업실적
ht = new Hashtable();
ht.Add("CONSTRUCTDAILYID", this.keyId);
ht.Add("SESSIONUSERID", this.sessionUserId);
oBiz = new Biz.FW.FWXmlAutoBiz();
dsData = oBiz.XmlGetData("uspTodayWorkResultList__C004", ht);
if (dsData != null && dsData.Tables.Count > 0 && dsData.Tables[0].Rows.Count > 0)
{
var list = new List<Dictionary<string, object>>();
foreach (DataRow row in dsData.Tables[0].Rows)
{
var dict = new Dictionary<string, object>();
foreach (DataColumn col in dsData.Tables[0].Columns)
{
dict[col.ColumnName] = (Convert.ToString(row[col]));
}
list.Add(dict);
}
JavaScriptSerializer serializer = new JavaScriptSerializer();
this.hdnDivTodayWorkResult.Value = serializer.Serialize(list);
}
#endregion
#region 최근 정보 불러오기 기능 추가 (2016-06-15)
if (getType == "LastInfoLoad")
{
this.keyId = keyId_temp1;
this.keyId2 = keyId_temp2;
}
#endregion
}
catch (Exception ex)
{
ExceptionRun.ErrHandle(ex);
}
finally
{
if (oBiz != null)
{
oBiz = null;
}
}
}
#endregion
#region btnSave_Click() : 저장
/// <summary>
/// Method 명: btnSave_Click()
/// Method내용: 공사일보 저장
/// 작 성 자:
/// 최초작성일: 2016-03-11
/// 최종수정자:
/// 최종수정일:
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <returns>
/// </returns>
protected void btnSave_Click(object sender, EventArgs e)
{
// 포스트백 이벤트 로그 기록
this.LogWritePostback((Control)sender);
Biz.FW.FWXmlAutoBizTx oBiz = null;
Hashtable ht;
JavaScriptSerializer ser;
List<Dictionary<string, object>> dict;
// 결과 반환값
string pKey = string.Empty;
int iResult = 0;
int iResult_Grid = 0;
try
{
// 최초 등록 일경우에는 공사 일련번호가 존재하지 않음으로 셋팅
if(this.keyId2 == 0)
this.keyId2 = Convert.ToInt32(this.FLD_CONSTRUCTID.Value);
#region 기본정보 및 그리드 정보
ht = new Hashtable();
ht["CONSTRUCTDAILYDATE"] = this.FLD_CONSTRUCTDAILYDATE.Text; // 일자
ht["WEATHER"] = this.FLD_WEATHER.Text; // 날씨
ht["TODAYWORKPLAN"] = this.FLD_TODAYWORKPLAN.Text; // 오늘작업계획
ht["TODAYWORKRESULT"] = this.FLD_TODAYWORKRESULT.Text; // 오늘작업실적
ht["REMARK"] = this.FLD_REMARK.Text; // 비고
ht["TOMORROWWORKPLAN"] = this.FLD_TOMORROWWORKPLAN.Text; // 내일작업계획
ht.Add("CONSTRUCTDAILYID", this.keyId); // 공사 일보 일련번호
ht.Add("CONSTRUCTID", this.keyId2); // 공사 일련번호
ht.Add("SESSIONUSERID", this.sessionUserId);
// 저장
oBiz = new Biz.FW.FWXmlAutoBizTx();
iResult = oBiz.XmlNonExecuteWithPK("uspConstructDailyWrite__C004", ht, out pKey);
if (iResult > 0)
{
this.keyId = Convert.ToInt32(pKey);
#region 자재
ser = new JavaScriptSerializer();
dict = ser.Deserialize<List<Dictionary<string, object>>>(this.hdnMATERIALResultData.Value);
for (int i_Material = 0; i_Material < dict.Count; i_Material++)
{
ht = new Hashtable();
ht.Add("MATERIALID", dict[i_Material]["MATERIALID"].ToString()); // 자재 일련번호
ht.Add("INPUTRESOURCEID", dict[i_Material]["INPUTRESOURCEID"].ToString()); // 자재코드
ht.Add("UNITPRICE", dict[i_Material]["UNITPRICE"].ToString().Replace(",", "")); // 단가
ht.Add("INCOMPANY", dict[i_Material]["INCOMPANY"].ToString()); // 투입업체
ht.Add("VOLUME", dict[i_Material]["VOLUME"].ToString().Replace(",", "")); // 수량
ht.Add("PRICE", dict[i_Material]["PRICE"].ToString().Replace(",", "")); // 금액
ht.Add("PLAN_YN", "N"); // Plan_YN(Y : 실행내역정보, N : 공사일보정보)
ht.Add("STATUS_GUBUN", dict[i_Material]["STATUS_GUBUN"].ToString()); // STATUS_GUBUN (I : 등록, U : 수정, D : 삭제)
ht.Add("CONSTRUCTDAILYID", pKey); // 공사 일보 일련번호
ht.Add("CONSTRUCTID", this.keyId2); // 공사 일련번호
ht.Add("SESSIONUSERID", this.sessionUserId);
oBiz = new Biz.FW.FWXmlAutoBizTx();
iResult_Grid = oBiz.XmlNonExecute("uspMaterialWriteDelete__C004", ht);
}
#endregion
#region 장비
ser = new JavaScriptSerializer();
dict = ser.Deserialize<List<Dictionary<string, object>>>(this.hdnEQUIPMENTResultData.Value);
for (int i_Equipment = 0; i_Equipment < dict.Count; i_Equipment++)
{
ht = new Hashtable();
ht.Add("EQUIPMENTID", dict[i_Equipment]["EQUIPMENTID"].ToString()); // 장비 일련번호
ht.Add("INPUTRESOURCEID", dict[i_Equipment]["INPUTRESOURCEID"].ToString()); // 자재코드
ht.Add("UNITPRICE", dict[i_Equipment]["UNITPRICE"].ToString().Replace(",", "")); // 단가
ht.Add("VOLUME", dict[i_Equipment]["VOLUME"].ToString().Replace(",", "")); // 수량
ht.Add("PRICE", dict[i_Equipment]["PRICE"].ToString().Replace(",", "")); // 금액
ht.Add("PLAN_YN", "N"); // Plan_YN(Y : 실행내역정보, N : 공사일보정보)
ht.Add("STATUS_GUBUN", dict[i_Equipment]["STATUS_GUBUN"].ToString()); // STATUS_GUBUN (I : 등록, U : 수정, D : 삭제)
ht.Add("CONSTRUCTDAILYID", pKey); // 공사 일보 일련번호
ht.Add("CONSTRUCTID", this.keyId2); // 공사 일련번호
ht.Add("SESSIONUSERID", this.sessionUserId);
oBiz = new Biz.FW.FWXmlAutoBizTx();
iResult_Grid = oBiz.XmlNonExecute("uspEquipmentWriteDelete__C004", ht);
}
#endregion
#region 노무비
ser = new JavaScriptSerializer();
dict = ser.Deserialize<List<Dictionary<string, object>>>(this.hdnWORKERCOSTResultData.Value);
for (int i_WorkerCost = 0; i_WorkerCost < dict.Count; i_WorkerCost++)
{
ht = new Hashtable();
ht.Add("WORKERCOSTID", dict[i_WorkerCost]["WORKERCOSTID"].ToString()); // 노무비 일련번호
ht.Add("WORKERID", dict[i_WorkerCost]["WORKERID"].ToString()); // 근로자코드
ht.Add("UNITPRICE", dict[i_WorkerCost]["UNITPRICE"].ToString().Replace(",", "")); // 단가
ht.Add("WORKDAY", dict[i_WorkerCost]["WORKDAY"].ToString()); // 투입일수
ht.Add("PRICE", dict[i_WorkerCost]["PRICE"].ToString().Replace(",", "")); // 금액
ht.Add("PLAN_YN", "N"); // Plan_YN(Y : 실행내역정보, N : 공사일보정보)
ht.Add("STATUS_GUBUN", dict[i_WorkerCost]["STATUS_GUBUN"].ToString()); // STATUS_GUBUN (I : 등록, U : 수정, D : 삭제)
ht.Add("CONSTRUCTDAILYID", pKey); // 공사 일보 일련번호
ht.Add("CONSTRUCTID", this.keyId2); // 공사 일련번호
ht.Add("SESSIONUSERID", this.sessionUserId);
oBiz = new Biz.FW.FWXmlAutoBizTx();
iResult_Grid = oBiz.XmlNonExecute("uspWorkerCostWriteDelete__C004", ht);
}
#endregion
#region 간접경비
ser = new JavaScriptSerializer();
dict = ser.Deserialize<List<Dictionary<string, object>>>(this.hdnINDIRECTEXPENSEResultData.Value);
for (int i_IndirectExpense = 0; i_IndirectExpense < dict.Count; i_IndirectExpense++)
{
ht = new Hashtable();
ht.Add("INDIRECTEXPENSEID", dict[i_IndirectExpense]["INDIRECTEXPENSEID"].ToString()); // 간접경비 일련번호
ht.Add("INPUTRESOURCEID", dict[i_IndirectExpense]["INPUTRESOURCEID"].ToString()); // 자재코드
// 간접경비 단가, 수량 누계수량이 제거 되면서 주석 (2016-06-15)
//ht.Add("UNITPRICE", dict[i_IndirectExpense]["UNITPRICE"].ToString().Replace(",", "")); // 단가
//ht.Add("VOLUME", dict[i_IndirectExpense]["VOLUME"].ToString().Replace(",", "")); // 수량
ht.Add("PRICE", dict[i_IndirectExpense]["PRICE"].ToString().Replace(",", "")); // 금액
ht.Add("PLAN_YN", "N"); // Plan_YN(Y : 실행내역정보, N : 공사일보정보)
ht.Add("STATUS_GUBUN", dict[i_IndirectExpense]["STATUS_GUBUN"].ToString()); // STATUS_GUBUN (I : 등록, U : 수정, D : 삭제)
ht.Add("CONSTRUCTDAILYID", pKey); // 공사 일보 일련번호
ht.Add("CONSTRUCTID", this.keyId2); // 공사 일련번호
ht.Add("SESSIONUSERID", this.sessionUserId);
oBiz = new Biz.FW.FWXmlAutoBizTx();
iResult_Grid = oBiz.XmlNonExecute("uspIndirectExpenseWriteDelete__C004", ht);
}
#endregion
#region 외주비
ser = new JavaScriptSerializer();
dict = ser.Deserialize<List<Dictionary<string, object>>>(this.hdnOUTSIDEORDEREXPENSEResultData.Value);
for (int i_OutsideOrderExpense = 0; i_OutsideOrderExpense < dict.Count; i_OutsideOrderExpense++)
{
ht = new Hashtable();
ht.Add("OUTSIDEORDEREXPENSEID", dict[i_OutsideOrderExpense]["OUTSIDEORDEREXPENSEID"].ToString()); // 외주비 일련번호
ht.Add("INPUTRESOURCEID", dict[i_OutsideOrderExpense]["INPUTRESOURCEID"].ToString()); // 자재코드
ht.Add("UNITPRICE", dict[i_OutsideOrderExpense]["UNITPRICE"].ToString().Replace(",", "")); // 단가
ht.Add("VOLUME", dict[i_OutsideOrderExpense]["VOLUME"].ToString().Replace(",", "")); // 수량
ht.Add("PRICE", dict[i_OutsideOrderExpense]["PRICE"].ToString().Replace(",", "")); // 금액
ht.Add("PLAN_YN", "N"); // Plan_YN(Y : 실행내역정보, N : 공사일보정보)
ht.Add("STATUS_GUBUN", dict[i_OutsideOrderExpense]["STATUS_GUBUN"].ToString()); // STATUS_GUBUN (I : 등록, U : 수정, D : 삭제)
ht.Add("CONSTRUCTDAILYID", pKey); // 공사 일보 일련번호
ht.Add("CONSTRUCTID", this.keyId2); // 공사 일련번호
ht.Add("SESSIONUSERID", this.sessionUserId);
oBiz = new Biz.FW.FWXmlAutoBizTx();
iResult_Grid = oBiz.XmlNonExecute("uspOutsideOrderExpenseWriteDelete__C004", ht);
}
#endregion
#region 오늘작업계획
// DB의 내용 삭제
ht = new Hashtable();
ht.Add("CONSTRUCTDAILYID", pKey); // 공사 일보 일련번호
oBiz = new Biz.FW.FWXmlAutoBizTx();
iResult_Grid = oBiz.XmlNonExecute("uspTodayWorkPlanDelete__C004", ht);
// DB에 내용 저작
ht = new Hashtable();
ht.Add("CONSTRUCTDAILYID", pKey); // 공사 일보 일련번호
ht.Add("TODAYWORKPLAN", this.hdnDivTodayWorkPlan.Value); // 오늘작업계획
ht.Add("SESSIONUSERID", this.sessionUserId);
oBiz = new Biz.FW.FWXmlAutoBizTx();
iResult_Grid = oBiz.XmlNonExecute("uspTodayWorkPlanWrite__C004", ht);
#endregion
#region 오늘작업실적
// DB의 내용 삭제
ht = new Hashtable();
ht.Add("CONSTRUCTDAILYID", pKey); // 공사 일보 일련번호
oBiz = new Biz.FW.FWXmlAutoBizTx();
iResult_Grid = oBiz.XmlNonExecute("uspTodayWorkResultDelete__C004", ht);
// DB에 내용 저작
ht = new Hashtable();
ht.Add("CONSTRUCTDAILYID", pKey); // 공사 일보 일련번호
ht.Add("TODAYWORKRESULT", this.hdnDivTodayWorkResult.Value); // 오늘작업실적
ht.Add("SESSIONUSERID", this.sessionUserId);
oBiz = new Biz.FW.FWXmlAutoBizTx();
iResult_Grid = oBiz.XmlNonExecute("uspTodayWorkResultWrite__C004", ht);
#endregion
}
#endregion
this.LogWritePostback((Control)sender, "keyId=" + EncryptKey(this.keyId));
if (iResult > 0)
{
this.GoView();
}
}
catch (Exception ex)
{
ExceptionRun.ErrHandle(ex);
}
finally
{
if (oBiz != null)
{
oBiz = null;
}
}
}
#endregion
#region RowDataBound_Material : 자재 그리드 합계
int Total_Price_Material = 0; // 금액
int Total_Sum_Price_Material = 0; // 누계금액
protected void RowDataBound_Material(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow )
{
DataRow dr = ((System.Data.DataRowView)e.Row.DataItem).Row;
// 금액
int price = 0;
// 누계금액
int sumPrice = 0;
bool chkPrice = int.TryParse(dr["PRICE"].ToString().Replace(",", ""), out price);
if (chkPrice)
{
Total_Price_Material += price;
}
bool chksumPrice = int.TryParse(dr["SUM_PRICE"].ToString().Replace(",", ""), out sumPrice);
if (chksumPrice)
{
Total_Sum_Price_Material += sumPrice;
}
}
else if (e.Row.RowType == DataControlRowType.Footer)
{
e.Row.Cells.RemoveAt(1);
e.Row.Cells.RemoveAt(1);
e.Row.Cells.RemoveAt(1);
e.Row.Cells.RemoveAt(1);
e.Row.Cells.RemoveAt(1);
e.Row.Cells[0].ColumnSpan = 6;
e.Row.Cells[0].Text = "금일투입금액";
e.Row.Cells[2].Text = "누계투입금액";
e.Row.Cells[0].HorizontalAlign = HorizontalAlign.Center;
e.Row.Cells[2].HorizontalAlign = HorizontalAlign.Center;
Label lblPRICE = (Label)e.Row.FindControl("lblTotalPRICE");
lblPRICE.Text = SetComma(Total_Price_Material);
Label lblSUM_PRICE = (Label)e.Row.FindControl("lblTotalSUM_PRICE");
lblSUM_PRICE.Text = SetComma(Total_Sum_Price_Material);
}
}
#endregion
#region RowDataBound_Equipment : 장비 그리드 합계
int Total_Price_Equipment = 0; // 금액
int Total_Sum_Price_Equipment = 0; // 누계금액
protected void RowDataBound_Equipment(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DataRow dr = ((System.Data.DataRowView)e.Row.DataItem).Row;
// 금액
int price = 0;
// 누계금액
int sumPrice = 0;
bool chkPrice = int.TryParse(dr["PRICE"].ToString().Replace(",", ""), out price);
if (chkPrice)
{
Total_Price_Equipment += price;
}
bool chksumPrice = int.TryParse(dr["SUM_PRICE"].ToString().Replace(",", ""), out sumPrice);
if (chksumPrice)
{
Total_Sum_Price_Equipment += sumPrice;
}
}
else if (e.Row.RowType == DataControlRowType.Footer)
{
e.Row.Cells.RemoveAt(1);
e.Row.Cells.RemoveAt(1);
e.Row.Cells.RemoveAt(1);
e.Row.Cells[0].ColumnSpan = 4;
e.Row.Cells[0].Text = "금일투입금액";
e.Row.Cells[2].Text = "누계투입금액";
e.Row.Cells[0].HorizontalAlign = HorizontalAlign.Center;
e.Row.Cells[2].HorizontalAlign = HorizontalAlign.Center;
Label lblPRICE = (Label)e.Row.FindControl("lblTotalPRICE");
lblPRICE.Text = SetComma(Total_Price_Equipment);
Label lblSUM_PRICE = (Label)e.Row.FindControl("lblTotalSUM_PRICE");
lblSUM_PRICE.Text = SetComma(Total_Sum_Price_Equipment);
}
}
#endregion
#region RowDataBound_WorkerCost : 노무비 그리드 합계
decimal Total_Price_WorkerCost = 0; // 금액
int Total_Sum_Price_WorkerCost = 0; // 누계금액
protected void RowDataBound_WorkerCost(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DataRow dr = ((System.Data.DataRowView)e.Row.DataItem).Row;
// 투입일수 콤보 셋팅
DropDownList ddlWORKDAY = (e.Row.FindControl("ddlWORKDAY") as DropDownList);
ddlWORKDAY.Items.AddRange(this.GetCodeList("1260", "select"));
ddlWORKDAY.Attributes["onchange"] = "workDayFN(this, '" + this.gvListWorkerCost.ID.ToString() + "');";
ddlWORKDAY.SelectedValue = dr["WORKDAY"].ToString();
// 금액
decimal price = 0;
// 누계금액
int sumPrice = 0;
bool chkPrice = decimal.TryParse(dr["PRICE"].ToString().Replace(",", ""), out price);
if (chkPrice)
{
Total_Price_WorkerCost += price;
}
bool chksumPrice = int.TryParse(dr["SUM_PRICE"].ToString().Replace(",", ""), out sumPrice);
if (chksumPrice)
{
Total_Sum_Price_WorkerCost += sumPrice;
}
}
else if (e.Row.RowType == DataControlRowType.Footer)
{
e.Row.Cells.RemoveAt(1);
e.Row.Cells.RemoveAt(1);
e.Row.Cells.RemoveAt(1);
e.Row.Cells[0].ColumnSpan = 4;
e.Row.Cells[0].Text = "금일투입금액";
e.Row.Cells[2].Text = "누계투입금액";
e.Row.Cells[0].HorizontalAlign = HorizontalAlign.Center;
e.Row.Cells[2].HorizontalAlign = HorizontalAlign.Center;
Label lblPRICE = (Label)e.Row.FindControl("lblTotalPRICE");
lblPRICE.Text = SetComma(Total_Price_WorkerCost);
Label lblSUM_PRICE = (Label)e.Row.FindControl("lblTotalSUM_PRICE");
lblSUM_PRICE.Text = SetComma(Total_Sum_Price_WorkerCost);
}
}
#endregion
#region RowDataBound_IndirectExpense : 간접경비 그리드 합계
int Total_Price_IndirectExpense = 0; // 금액
int Total_Sum_Price_IndirectExpense = 0; // 누계금액
protected void RowDataBound_IndirectExpense(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DataRow dr = ((System.Data.DataRowView)e.Row.DataItem).Row;
// 금액
int price = 0;
// 누계금액
int sumPrice = 0;
bool chkPrice = int.TryParse(dr["PRICE"].ToString().Replace(",", ""), out price);
if (chkPrice)
{
Total_Price_IndirectExpense += price;
}
bool chksumPrice = int.TryParse(dr["SUM_PRICE"].ToString().Replace(",", ""), out sumPrice);
if (chksumPrice)
{
Total_Sum_Price_IndirectExpense += sumPrice;
}
}
else if (e.Row.RowType == DataControlRowType.Footer)
{
/* 간접경비 단가, 수량, 누계수량 제거로 인해서 주석 후 수정 (2016-06-15)
e.Row.Cells.RemoveAt(1);
e.Row.Cells.RemoveAt(1);
e.Row.Cells.RemoveAt(1);
e.Row.Cells[0].ColumnSpan = 4;
e.Row.Cells[0].Text = "금일투입금액";
e.Row.Cells[2].Text = "누계투입금액";
e.Row.Cells[0].HorizontalAlign = HorizontalAlign.Center;
e.Row.Cells[2].HorizontalAlign = HorizontalAlign.Center;
Label lblPRICE = (Label)e.Row.FindControl("lblTotalPRICE");
lblPRICE.Text = SetComma(Total_Price_IndirectExpense);
Label lblSUM_PRICE = (Label)e.Row.FindControl("lblTotalSUM_PRICE");
lblSUM_PRICE.Text = SetComma(Total_Sum_Price_IndirectExpense);
*/
e.Row.Cells.RemoveAt(1);
e.Row.Cells[0].ColumnSpan = 2;
e.Row.Cells[0].Text = "금일투입금액(누계투입금액)";
e.Row.Cells[0].HorizontalAlign = HorizontalAlign.Center;
Label lblPRICE = (Label)e.Row.FindControl("lblTotalPRICE");
lblPRICE.Text = SetComma(Total_Price_IndirectExpense);
Label lblSUM_PRICE = (Label)e.Row.FindControl("lblTotalSUM_PRICE");
lblSUM_PRICE.Text = SetComma(Total_Sum_Price_IndirectExpense);
}
}
#endregion
#region RowDataBound_OutsideOrderExpense : 외주비 그리드 합계
int Total_Price_OutsideOrderExpense = 0; // 금액
int Total_Sum_Price_OutsideOrderExpense = 0; // 누계금액
protected void RowDataBound_OutsideOrderExpense(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DataRow dr = ((System.Data.DataRowView)e.Row.DataItem).Row;
// 금액
int price = 0;
// 누계금액
int sumPrice = 0;
bool chkPrice = int.TryParse(dr["PRICE"].ToString().Replace(",", ""), out price);
if (chkPrice)
{
Total_Price_OutsideOrderExpense += price;
}
bool chksumPrice = int.TryParse(dr["SUM_PRICE"].ToString().Replace(",", ""), out sumPrice);
if (chksumPrice)
{
Total_Sum_Price_OutsideOrderExpense += sumPrice;
}
}
else if (e.Row.RowType == DataControlRowType.Footer)
{
e.Row.Cells.RemoveAt(1);
e.Row.Cells.RemoveAt(1);
e.Row.Cells.RemoveAt(1);
e.Row.Cells[0].ColumnSpan = 4;
e.Row.Cells[0].Text = "금일투입금액";
e.Row.Cells[2].Text = "누계투입금액";
e.Row.Cells[0].HorizontalAlign = HorizontalAlign.Center;
e.Row.Cells[2].HorizontalAlign = HorizontalAlign.Center;
Label lblPRICE = (Label)e.Row.FindControl("lblTotalPRICE");
lblPRICE.Text = SetComma(Total_Price_OutsideOrderExpense);
Label lblSUM_PRICE = (Label)e.Row.FindControl("lblTotalSUM_PRICE");
lblSUM_PRICE.Text = SetComma(Total_Sum_Price_OutsideOrderExpense);
}
}
#endregion
#region 해당 공사의 해당 투입자원에 관한 누계수량, 누계금액 추출
[System.Web.Services.WebMethod]
public static string GetSum_Volume_Price(object items)
{
string result = string.Empty;
// 리스트 형식
List<object> lstItems = new JavaScriptSerializer().ConvertToType<List<object>>(items);
for (int i = 0; i < lstItems.Count; i++)
{
Biz.FW.FWXmlAutoBiz oBiz = null;
Hashtable ht = new Hashtable();
DataSet dsData = null;
foreach (KeyValuePair<string, object> kvp in (IEnumerable)lstItems[i])
{
ht.Add(kvp.Key, kvp.Value.ToString());
}
ht.Add("PLAN_YN", "N");
oBiz = new Biz.FW.FWXmlAutoBiz();
dsData = oBiz.XmlGetData("uspSumVolumePriceView__C004", ht);
if (dsData != null && dsData.Tables.Count > 0 && dsData.Tables[0].Rows.Count > 0)
{
var list = new List<Dictionary<string, object>>();
foreach (DataRow row in dsData.Tables[0].Rows)
{
var dict = new Dictionary<string, object>();
foreach (DataColumn col in dsData.Tables[0].Columns)
{
dict[col.ColumnName] = (Convert.ToString(row[col]));
}
list.Add(dict);
}
JavaScriptSerializer serializer = new JavaScriptSerializer();
result = serializer.Serialize(list);
}
}
return result;
}
#endregion
#region 해당 공사의 해당 투입자원에 관한 누계수량, 누계금액 추출
[System.Web.Services.WebMethod]
public static string GetConstructDailyDup(object items)
{
string result = string.Empty;
// 리스트 형식
List<object> lstItems = new JavaScriptSerializer().ConvertToType<List<object>>(items);
for (int i = 0; i < lstItems.Count; i++)
{
Biz.FW.FWXmlAutoBiz oBiz = null;
Hashtable ht = new Hashtable();
DataSet dsData = null;
foreach (KeyValuePair<string, object> kvp in (IEnumerable)lstItems[i])
{
ht.Add(kvp.Key, kvp.Value.ToString());
}
ht.Add("PLAN_YN", "N");
oBiz = new Biz.FW.FWXmlAutoBiz();
dsData = oBiz.XmlGetData("uspConstructDailyDup__C004", ht);
if (dsData != null && dsData.Tables.Count > 0 && dsData.Tables[0].Rows.Count > 0)
{
var list = new List<Dictionary<string, object>>();
foreach (DataRow row in dsData.Tables[0].Rows)
{
var dict = new Dictionary<string, object>();
foreach (DataColumn col in dsData.Tables[0].Columns)
{
dict[col.ColumnName] = (Convert.ToString(row[col]));
}
list.Add(dict);
}
JavaScriptSerializer serializer = new JavaScriptSerializer();
result = serializer.Serialize(list);
}
}
return result;
}
#endregion
#region btnLastInfoLoad_Click() : 최근 정보 불러오기
/// <summary>
/// Method 명: btnLastInfoLoad_Click()
/// Method내용: 최근 정보 불러오기
/// 작 성 자:
/// 최초작성일: 2016-06-15
/// 최종수정자:
/// 최종수정일:
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <returns>
/// </returns>
protected void btnLastInfoLoad_Click(object sender, EventArgs e)
{
// 데이터 가져오기
this.GetDetail("LastInfoLoad");
}
#endregion
}
}
이상으로 .net Html, GridView jquery이용하여 추가 삭제 구현에 관해서 알아보았습니다.
aspx 전체소스 다운로드
aspx.cs 전체소스 다운로드
댓글
댓글 쓰기