public string update_proc(Model.project_specific_item_model model, string actionstr, string categorySid) { SqlParameter[] parameters = { new SqlParameter("@ActionType", SqlDbType.NVarChar, 20), new SqlParameter("@sid", SqlDbType.Int), new SqlParameter("@name", SqlDbType.NVarChar, 100), new SqlParameter("@group_sid", SqlDbType.NVarChar, 50), new SqlParameter("@s_sid", SqlDbType.NVarChar, 50), new SqlParameter("@sequence", SqlDbType.Int), new SqlParameter("@remark", SqlDbType.Text), new SqlParameter("@isChild", SqlDbType.NVarChar, 50), new SqlParameter("@parent_sid", SqlDbType.NVarChar, 50), new SqlParameter("@category_sid", SqlDbType.NVarChar, 50), new SqlParameter("@Error", SqlDbType.NVarChar, 200) }; parameters[0].Value = actionstr; parameters[1].Value = model.sid; parameters[2].Value = model.name; parameters[3].Value = model.group_sid; parameters[4].Value = model.s_sid; parameters[5].Value = model.sequence; parameters[6].Value = model.remark; parameters[7].Value = model.isChild; parameters[8].Value = model.parent_sid; parameters[9].Value = categorySid; parameters[10].Direction = ParameterDirection.Output; DataSet ds = DbHelperSQL.RunProcedure("Proc_ProjectContent_model", parameters, ""); string reVal = parameters[10].Value.ToString().Trim(); return(reVal); }
/// <summary> /// 分页获取数据列表 /// </summary> //public DataSet GetList(int PageSize,int PageIndex,string strWhere) //{ //return dal.GetList(PageSize,PageIndex,strWhere); //} #endregion BasicMethod #region ExtensionMethod public string add(Model.project_specific_item_model model) { try { if (dal.exists(" where name='" + model.name + "' and s_sid=" + model.s_sid)) { return("<" + model.name + ">已存在"); } else { if (dal.Add(model) > 0) { return("success"); } else { return("保存失败!"); } } } catch (Exception exc) { return(exc.Message); } }
public string updateItem(Model.project_specific_item_model model) { try { if (dal.exists(" where name='" + model.name + "' and parent_sid=" + model.parent_sid + " and sid!=" + model.sid)) { return("<" + model.name + ">已存在"); } else { if (dal.update(model)) { return("success"); } else { return("保存失败!"); } } } catch (Exception exc) { return(exc.Message); } }
private string ProItemAdd(HttpContext context) { string content = context.Request.Params["item_name"].Trim(); string pcontent = context.Request.Params["pcontent"].Trim(); string remark = context.Request.Params["item_remark"].Trim(); string pssid = context.Request.Params["item_pssid"].Trim(); string sequence = context.Request.Params["forwarditem"].Trim(); Model.project_specific_item_model model = new Model.project_specific_item_model(); model.name = content; model.parent_sid = int.Parse(pcontent); model.remark = remark; model.s_sid = pssid; model.isChild = 1; model.sequence = int.Parse(sequence); return(new BLL.project_specific_item_model().addItem(model)); }
private string ProContentAdd(HttpContext context) { string type = context.Request.Params["type"].Trim(); string content = context.Request.Params["pw_name"] == null ? "" : context.Request.Params["pw_name"].Trim(); string categorySid = context.Request.Params["pw_sid"] == null ? "" : context.Request.Params["pw_sid"].Trim(); string pgroup = context.Request.Params["pgroup"] == null ? "" : context.Request.Params["pgroup"].Trim(); string remark = context.Request.Params["pc_remark"] == null ? "" : context.Request.Params["pc_remark"].Trim(); string pssid = context.Request.Params["c_pssid"] == null ? "" : context.Request.Params["c_pssid"].Trim(); string sequence = context.Request.Params["forwardContent"] == null ? "" : context.Request.Params["forwardContent"].Trim(); Model.project_specific_item_model model = new Model.project_specific_item_model(); model.name = content; model.group_sid = pgroup; model.remark = remark; model.s_sid = pssid; model.isChild = 0; model.parent_sid = 0; model.sequence = sequence == ""?0: int.Parse(sequence); //return new BLL.project_specific_item_model().add(model); string revalue = ""; switch (type) { case "0": revalue = new DAL.project_specific_item_model().insert_proc(model, "Insert1"); break; case "2": revalue = new DAL.project_specific_item_model().insert_proc(model, "Insert2", categorySid); break; case "3": revalue = new DAL.project_specific_item_model().insert_proc(model, "Insert2", categorySid); break; default: revalue = "操作失败。"; break; } return(revalue); }