中间单价
功能实现
中间单价包含三个部分:一个是中间单价列表,一个是中间单价定额组成表,一个是中间单价定额人材机组成表,中间单价列表,你可以对其进行新增,删除和修改。当点击时,点击添加会在datagrid里面增加一行数据,而数据里面的代号是自动增加,增加完一行数据,你就可以对他进行相应的修改,而修改是在datagrid里面操作的。
中间单价定额组成表数据处理包括添加定额、新建定额、删除 。
点击一下中间单价的添加定额、会弹出一个窗体,里面有数据的我们·可以通过多条件查询把数据给查询出来,然后双击把数据添加到定额表,而定额里面的数据,我们也可以通过新建定额来进行添加。我们如果觉得数据不好还可以把它给删除。
中间人材机的功能有添加,删去,替换,复制、粘贴,上移,下移:复制现有的数据,复制后的数据代号后会有”复制“两字,整数进行区分。然后进行粘贴到最后一行。
//下面就是增加人材机的方法
第一步:点击确定后给添加人材机赋值、存储过程
第二步:点击确定后增加人材机、逻辑层
public int confirmaddtAlentsChance(string Str_Code, string Str_Name, string Int_Unit, string Str_Amount, int Int_CenterPriceQuoteComeposeID, string Int_BudgetPrice, string Str_Type, string Str_Remark)
{
SqlParameter[] mySQL = {
new SqlParameter("@type",SqlDbType.Char),
new SqlParameter("@Code",SqlDbType.Char),
new SqlParameter("@Name",SqlDbType.Char),
new SqlParameter("@Unit",SqlDbType.Char),
new SqlParameter("@QuoteAmout",SqlDbType.Char),
new SqlParameter("@CenterPriceQuoteComeposeID",SqlDbType.Int),
new SqlParameter("@BudgetPrice",SqlDbType.Char),
new SqlParameter("@Type1",SqlDbType.Char),
new SqlParameter("@Remark",SqlDbType.Char),
};
mySQL[0].Value = "confirmaddtAlentsChance";//这是对应了存储过程@type类型
mySQL[1].Value = Str_Code;
mySQL[2].Value = Str_Name;
mySQL[3].Value = Int_Unit;
mySQL[4].Value = Str_Amount;
mySQL[5].Value = Int_CenterPriceQuoteComeposeID;
mySQL[6].Value = Int_BudgetPrice;
mySQL[7].Value = Str_Type;
mySQL[8].Value = Str_Remark;
int i = Centre.DAL_OPTableDB_Par("CenterPrice", mySQL);//这是把参数传进数据库
return i;
}
第三步:点击确定后增加人材机、控制器
string BudgetPrice = "";
public ContentResult confirmaddtAlentsChance(string Str_Code, string Str_Name, string Int_Unit, string Str_Amount, string Int_CenterPriceQuoteComeposeID, string Int_BudgetPrice, string Str_Type, string Str_Remark)
{
if (Int_BudgetPrice == "null")
{
BudgetPrice = "";
}
else
{
BudgetPrice = Int_BudgetPrice;
}
int i = Centre.confirmaddtAlentsChance(Str_Code, Str_Name, Int_Unit, Str_Amount, Convert.ToInt32(Int_CenterPriceQuoteComeposeID), BudgetPrice, Str_Type, Str_Remark);//这是调用逻辑层的方法
string k = i.ToString();
return Content(k);
}
第四步:点击确定后增加人材机、界面层
function confirmaddtAlentsChance(){
for(var i=0;i< $('#Addconfirmcount').datagrid('getData').rows.length;i++){//这是遍历所有数据,增加进数据库
$.getJSON("/ZhongJianDanJia/confirmaddtAlentsChance?Str_Code=" + $('#Addconfirmcount').datagrid('getData').rows[i]["daihao"]+ "&"
+"Str_Name="+ $('#Addconfirmcount').datagrid('getData').rows[i]["mingcheng"]+"&"
+"Int_Unit="+ $('#Addconfirmcount').datagrid('getData').rows[i]["danwei"]+"&"
+"Str_Amount="+$('#Addconfirmcount').datagrid('getData').rows[i]["shuliang"]+"&"
+"Int_CenterPriceQuoteComeposeID="+$('#CentreConstitute').datagrid('getSelected').CenterPriceQuoteComeposeID+"&"
+"Int_BudgetPrice="+ $('#Addconfirmcount').datagrid('getData').rows[i]["yusuanjiage"]+"&"
+"Str_Type="+ $('#Addconfirmcount').datagrid('getData').rows[i]["leixing"]+"&"
+"Str_Remark="+$('#Addconfirmcount').datagrid('getData').rows[i]["Remark"]+"&"
,
function (data) {
machinery=0; manpower=0; material=0; coordinate=0;
$('#w添加人材机').window('close');//这是关闭窗体
$('#Addconfirmcount').datagrid('loadData',{total:0,rows:[]}); //这是清空数据
//查询人材机
$.getJSON("/ZhongJianDanJia/inquireAlentsChance?Int_CenterPriceQuoteComeposeID=" +$('#CentreConstitute').datagrid('getSelected').CenterPriceQuoteComeposeID+ "&",
function(data){
$('#AmongConstitute').datagrid('loadData',data);//这是把查出来的数据绑定给相应的datagrid
});
});
}
}
//接下来就到了删去的方法
第一步:删去人材机、存储过程
第二步:删去人材机、逻辑层
public int deleteRowtalents(int Int_CenterPriceQuoteMachineID)
{
SqlParameter[] mySQL = {
new SqlParameter("@type",SqlDbType.Char),