protected override string btnAdd_Click() { Model.C_CostDetalis cd = BLL.C_CostDetalis.GetModel(Convert.ToInt32(Request.Form["cid"])); if (cd.IsDelete != 0) { return("状态已改变,请刷新重试"); } cd.IsDelete = 1; if (BLL.C_CostDetalis.Update(cd)) { return("删除成功"); } else { return("删除失败"); } }
protected override string btnOther_Click() { Model.C_CostDetalis cd = BLL.C_CostDetalis.GetModel(Convert.ToInt32(Request.Form["cid"])); if (cd.IsDelete != 0) { return("审核失败,数据状态已改变,请刷新"); } cd.IsDelete = 2; if (BLL.C_CostDetalis.Update(cd)) { return("审核成功"); } else { return("审核失败"); } }
//protected override void SetValue(string id) //{ // cartast = BLL.C_CarTast.GetModel(int.Parse(id)); // listcost = BLL.C_CostDetalis.GetModelList(" CID=" + cartast.ID); // cid.Value = id; //} protected override string btnAdd_Click() { try { // Model.C_CarTast cartast = BLL.C_CarTast.GetModel(int.Parse(Request.Form["cid"])); // List<Model.C_CostDetalis> listcost = BLL.C_CostDetalis.GetModelList(" CID=" + cartast.ID); //if (cartast.TState == 1) // return "非法操作,此任务已结束"; // decimal money= Convert.ToDecimal(Request.Form["txtMHB"]); // Model.C_CostType ct= BLL.C_CostType.GetModel(cartast.CostType); //decimal totalmoney= listcost.Sum(m=>m.CostMoney); //if (ct.XEMoney < money + totalmoney) //{ // return "此任务最多可以申请费用额为"+(ct.XEMoney-totalmoney); //} Model.C_CostDetalis apply = new Model.C_CostDetalis(); apply.CID = 0; apply.CostMoney = Convert.ToDecimal(Request.Form["txtMHB"]); apply.MID = TModel.MID; apply.Remark = Request.Form["txtName"]; apply.CostImgUrl = Request.Form["uploadurl"]; apply.CareteDate = DateTime.Now; apply.IsDelete = 0; if (BLL.C_CostDetalis.Add(apply) > 0) { return("费用申请已提交"); } else { return("数据有误,请重试"); } } catch (Exception e) { return(e.Message); } }