取费管理
功能实现
取费管理的数据处理主要有:添加、删除、复制、粘贴、导出、导入
取费管理的添加,会弹出一个窗体,里面只有取费分类列表名,而其它的字段可以双击列名为名称和单位那两列时,会弹出一个小窗体,双击小窗体就能添加数据。删除就是选择一行进行删除。
取费管理的复制、粘贴:对现有的数据进行复制、粘贴,为了进行区分,粘贴后的数据,代号会自动跟着”复制“二字,只要是通过最后的几位整数来区分取费分类列表名,不让其重复。
取费管理的导出、导入:系统将自动给出一个路径,把取费的所有数据导入到一张Excel表。导入:先手动填写一些数据,这些数据要根据数据库的参数来写,一一对应才能导入
取费明细的数据处理主要有,添加父节、同级插入、下级插入、升级、删去。
点击添加,他就会自动新增一行数据,我们可以对那一行数据进行一些修改操作,我们还可以对数据做下级插入,同级插入数据,删去数据。
//下面就是取费明细;
//下面就是treegrid点击添加的代码:
第一步:存储过程:
第二步:逻辑层添加父节点
public int insertcostdetailedMame(string Str_text, int Int_GetPriceDetailID_fur, int Int_GetPriceClassifyID, bool Bool_IfPrint)
{
SqlParameter[] mySQL = {
new SqlParameter("@type",SqlDbType.Char),
new SqlParameter("@GetPriceName",SqlDbType.Char),
new SqlParameter("@GetPriceDetailID_fur",SqlDbType.Int),
new SqlParameter("@GetPriceClassifyID",SqlDbType.Int),
new SqlParameter("@IfPrint",SqlDbType.Bit),
};
mySQL[0].Value = "insertcostdetailedMame";//这类型要对应存储过程的@type类型
mySQL[1].Value = Str_text;
mySQL[2].Value = Int_GetPriceDetailID_fur;
mySQL[3].Value = Int_GetPriceClassifyID;
mySQL[4].Value = Bool_IfPrint;
int i = getprice.DAL_OPTableDB_Par("GetPriceManage", mySQL);//这就是存储过程名GetPriceManage,通过它来新增数据然后返回
return i;
}
第三步:控制器添加父节点
public ContentResult insertcostdetailedMame(string Str_text, string Int_GetPriceDetailID_fur, string Int_GetPriceClassifyID, string Bool_IfPrint)
{
int i = getprice.insertcostdetailedMame(Str_text, Convert.ToInt32(Int_GetPriceDetailID_fur), Convert.ToInt32(Int_GetPriceClassifyID), Convert.ToBoolean(Bool_IfPrint));//这就是调用逻辑层的方法,来进行数据新增
string k = i.ToString();
return Content(k);这就是返回给界面的值
}
第四步:界面层添加父节点:
//添加父节点
function addparampanelPoint(){
$.getJSON("/QuFeiGuanLi/insertcostdetailedMame?Str_text="+"(没命名)"+"&"
+"Int_GetPriceDetailID_fur="+0+"&"
+"Int_GetPriceClassifyID="+$('#getpriceclasify').datagrid('getSelected').GetPriceClassifyID+"&"
+"Bool_IfPrint="+"false",
function(data){
$.getJSON("/QuFeiGuanLi/Inquiretree?Int_GetPriceClassifyID="+ $('#getpriceclasify').datagrid('getSelected').GetPriceClassifyID
,
function(data){
$('#Tbl_treedetailed').treegrid('loadData',data);d=0;yy=0;// d=0;yy=0;这两个是在treegrid点击事件里面用到的变量
});
});
}
//接下来就是treegrid点击事件
var editIndex=undefined;
var Gh=false;
var d=0;
var gg=false;
var yy=0;
//点击行编制下拉树
function onClickRowdetailed(index,data,dd){
if (editIndex != $('#Tbl_treedetailed').treegrid('getSelected').id) {
if(d==1){ //刚开始d=0这是为了要让它下一次再执行,这样editIndex就会有值
if(document.getElementById("IfPrint"+editIndex).checked){//这是判断他是不是为真,如果是就把值付给Gh
Gh=document.getElementById("IfPrint"+editIndex).checked;
if(Gh==true){
document.getElementById("IfPrint"+editIndex).checked=true;gg=true}else{}//这里面声明的gg是为了下面的结束编制后,修改用到
}else{
Gh=false;gg=false;
}
}
if (endEditing(false)){//这方法endEditing()调用了下面的方法
var index=$('#Tbl_treedetailed').treegrid('getSelected').id;
$('#Tbl_treedetailed').treegrid('select', index)
.datagrid('beginEdit', index);//这就是开始编制
yy=1;// 这yy=1;是为了让这endEditing()下一次再执行
} else {
$('#Tbl_treedetailed').treegrid('select', editIndex);
}
editIndex = $('#Tbl_treedetailed').treegrid('getSelected').id; //再把选中的值赋给editIndex
d=1;
}
}
//