public string RefuseJH(HttpContext context) { int placeID; int sid; int.TryParse(context.Request["placeID"], out placeID); int.TryParse(context.Request["sid"], out sid); WCDataProvider db = new WCDataProvider(); WCDataStoreProcedures dsp = new WCDataStoreProcedures("Sp_Project_Material_Submit", WCDataAction.Update8); //dsp.InputPars.Add("@Where", " ParentID=0 "); dsp.InputPars.Add("@sid", sid); dsp.InputPars.Add("@projectSpaceID", placeID); dsp.InputPars.Add("@SubmitPerson", ((Model.BaseUser)context.Session["login"]).UserID); if (db.Execute(dsp).ExecuteState) { return(Convert.ToString(dsp.OutputDataSet.Tables[0].Rows[0]["out_str"].ToString())); } else { return(Convert.ToString(dsp.OutputDataSet.Tables[0].Rows[0]["out_str"].ToString())); } }
/// <summary> /// 获取下载部门列表 /// </summary> /// <param name="context"></param> /// <returns></returns> public string GetDowmPer(HttpContext context) { WCDataProvider db1 = new WCDataProvider(); WCDataStoreProcedures dsp1 = new WCDataStoreProcedures("pro_folder", WCDataAction.Query1); DataTable dt = new DataTable(); DataTable per_dt = new DataTable(); if (db1.Execute(dsp1).ExecuteState) { dt = dsp1.OutputDataSet.Tables[0]; } //string sql = ""; //string key = context.Request["key"] != null ? context.Request["key"].Trim() : ""; //dsp1.InputPars.Add("@folder_id", key); //if (key != null || !string.IsNullOrEmpty(key)) // dt = db1.Execute(dsp1).OutputDataSet.Tables[0]; //for (int i = 0; i < dt.Rows.Count; i++) //{ // sql = @sql + GetDeptID(per_dt, dt.Rows[i]["ParentDeptID"].ToString(), dt.Rows[i]["DeptID"].ToString()) + ","; //} //WCDataProvider db = new WCDataProvider(); //WCDataStoreProcedures dsp = new WCDataStoreProcedures("pro_folder", WCDataAction.Query2); //dsp.InputPars.Add("@sql", sql); //if (db.Execute(dsp).ExecuteState) //{ // dt = dsp.OutputDataSet.Tables[0]; //} return(jsonHelper.DataTable2Json_Tree(dt, "DeptID", "DeptName", "ParentDeptID", "NULL", "", "")); }
private string Stage_Edit(HttpContext context) { Model.BaseUser bu = (Model.BaseUser)context.Session["login"]; WCDataProvider db = new WCDataProvider(); WCDataStoreProcedures dsp = new WCDataStoreProcedures("ProjectTemplateType", WCDataAction.Insert1); dsp.InputPars.Add("@Sql", " " + context.Request["SQLString"].Substring(0, context.Request["SQLString"].Length - 1)); dsp.InputPars.Add("@UserName", bu.UserName); dsp.InputPars.Add("@ptt_sid", context.Request["ptt_sid"]); dsp.InputPars.Add("@ptt_name", context.Request["ptt_name"]); dsp.InputPars.Add("@pptt_sid", context.Request["pptt_sid"]); if (db.Execute(dsp).ExecuteState) { if (!string.IsNullOrWhiteSpace(dsp.OutputPars["@error"].ToString())) { return(dsp.OutputPars["@error"].ToString()); } else { return("success~" + dsp.OutputPars["@outputStr"].ToString()); } } else { return("保存失败。"); } }
public string CheckPathName(string level_ID, string ID, string name) { DataTable dt = new DataTable(); WCDataProvider db = new WCDataProvider(); WCDataStoreProcedures dsp = new WCDataStoreProcedures("pro_folder", WCDataAction.Query12); if (level_ID == "") { dsp.InputPars.Add("@folder_id", ID); } else { dsp.InputPars.Add("@folder_level", level_ID); } dsp.InputPars.Add("@folder_name", name); if (db.Execute(dsp).ExecuteState) { if (dsp.OutputDataSet.Tables[0].Rows.Count > 0) { return("文件夹名重复!请重新输入文件夹名称!"); } else { return(""); } } else { return("出错!"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (PageID == null) { string url = HttpContext.Current.Request.Url.AbsolutePath.Trim(); if (url.IndexOf('/') == 0) { url = url.Substring(1); } DataTable dt = new DataTable(); try { dt = new BLL.Common().GetList("select PageID from BaseMenu where LinkUrl like '%" + url + "%'").Tables[0]; PageID = dt.Rows[0]["PageID"].ToString().Trim(); } catch { } } WCDataProvider db = new WCDataProvider(); WCDataStoreProcedures dsp = new WCDataStoreProcedures("sp_permission", WCDataAction.Query4); dsp.InputPars.Add("@PageID", PageID); dsp.InputPars.Add("@RolseIDs", (Session["login"] as Model.BaseUser).Roles); if (db.Execute(dsp).ExecuteState) { jsValue = dsp.OutputPars["@strOut"].ToString(); } jsValue = string.IsNullOrWhiteSpace(jsValue) ? IDS : jsValue; } }
private string Approve(HttpContext context) { //Model.BaseUser bu = (Model.BaseUser)context.Session["login"]; //string sid = context.Request.Params["sid"].Trim(); //string results = context.Request.Params["results"].Trim(); //string status = context.Request.Params["status"].Trim(); //string apprContent = context.Request.Params["apprContent"].Trim(); //return new BLL.project_review().approve(sid, status, results, apprContent, bu.UserName); WCDataProvider db = new WCDataProvider(); WCDataStoreProcedures dsp = new WCDataStoreProcedures("Proc_ProjectAppr", WCDataAction.Insert1); dsp.InputPars.Add("@sql", context.Request["str"]); dsp.InputPars.Add("@type", context.Request["type"]); dsp.InputPars.Add("@sid", context.Request["sid"]); dsp.InputPars.Add("@reviewer", (context.Session["login"] as Model.BaseUser).UserName); if (db.Execute(dsp).ExecuteState) { return("success"); } else { return("保存失败。"); } }
public string GetPM_B_List(HttpContext context) { string where = "1=1 "; string projectID = context.Request.Params["projectID"] == null ? "" : context.Request.Params["projectID"].Trim(); string ptID = context.Request.Params["ptID"] == null ? "" : context.Request.Params["ptID"].Trim(); //if (!string.IsNullOrEmpty(projectID)) //{ where += " and ProjectID='" + projectID + "' "; //} if (!string.IsNullOrEmpty(ptID)) { if (ptID != "-1") { where += " and productTypeRootID='" + ptID + "' "; } } WCDataProvider db = new WCDataProvider(); WCDataStoreProcedures dsp = new WCDataStoreProcedures("Sp_Project_Material_Submit", WCDataAction.Query3); dsp.InputPars.Add("@Where", where); dsp.InputPars.Add("@Sort", " productTypeRootID,space,place "); dsp.InputPars.Add("@PageSize", context.Request.Form["rows"]); dsp.InputPars.Add("@PageIndex", context.Request.Form["page"]); if (db.Execute(dsp).ExecuteState) { //if (dsp.OutputDataSet.Tables[0].Rows.Count > 0) //{ return(JsonHelper.DataTable2Json_Datagrid(dsp.OutputDataSet.Tables[0], Convert.ToInt32(dsp.OutputPars["@RecordCount"].ToString()))); //} } return("{\"total\":0,\"rows\":[]}"); }
/// <summary> /// 页面加载 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Model.BaseUser bu = (Model.BaseUser)Session["login"]; WCDataProvider db = new WCDataProvider(); WCDataStoreProcedures dsp = new WCDataStoreProcedures("Sp_Disktop", WCDataAction.Query1); dsp.InputPars.Add("@end_date", DateTime.Now.AddDays(1).ToString("yyyy-MM-dd")); dsp.InputPars.Add("@begin_date", DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd")); dsp.InputPars.Add("@username", bu.UserName); dsp.InputPars.Add("@ApprRole", bu.ApprRole); dsp.InputPars.Add("@DeptID", bu.DeptID); if (db.Execute(dsp).ExecuteState) { projectNotice = GetProjectNotice(dsp.OutputDataSet.Tables[0]); projectNonticeCount = dsp.OutputDataSet.Tables[0].Rows.Count.ToString(); myProjectPlane = GetMyProjectPlane(dsp.OutputDataSet.Tables[1]); myProjectPlaneCount = dsp.OutputDataSet.Tables[1].Rows.Count.ToString(); projectPlanAppr = GetProjectPlanAppr(dsp.OutputDataSet.Tables[2]); projectPlanApprCount = dsp.OutputDataSet.Tables[2].Rows.Count.ToString(); apprRequest = GetApprRequest(dsp.OutputDataSet.Tables[3]); apprRequestCount = dsp.OutputDataSet.Tables[3].Rows.Count.ToString(); } } }
private string Stage_Delete1(HttpContext context) { WCDataProvider db = new WCDataProvider(); WCDataStoreProcedures dsp = new WCDataStoreProcedures("ProjectTemplateType", WCDataAction.Delete2); dsp.InputPars.Add("@stage_sid", context.Request["sid"]); return(db.Execute(dsp).ExecuteState ? "ok" : ""); }
/// <summary> /// 保存 /// </summary> /// <param name="context"></param> /// <returns></returns> public string save(HttpContext context) { string mainPath = ConfigurationManager.AppSettings["FolderPath"]; string folder_path; string t = DateTime.Now.ToString("yyyyMMddhhmmss"); Random rnd = new Random(); int i = rnd.Next(100, 999); string r = i.ToString(); DataTable dt = ParentPath(context.Request["level_ID"].ToString()); string checkPathName = CheckPathName(context.Request["level_ID"].ToString(), "", context.Request["folder_name"].ToString()); if (checkPathName != "") { return(checkPathName); } else { if (dt.Rows.Count > 0) { folder_path = dt.Rows[0]["folder_path"].ToString() + "/" + context.Request["folder_name"].ToString(); } else { folder_path = "/" + context.Request["folder_name"].ToString(); } string data = ""; Model.BaseUser buModel = (Model.BaseUser)context.Session["login"]; WCDataProvider db = new WCDataProvider(); WCDataStoreProcedures dsp = new WCDataStoreProcedures("pro_folder", WCDataAction.Insert1); dsp.InputPars.Add("@folder_name", context.Request["folder_name"].ToString()); dsp.InputPars.Add("@folder_level", context.Request["level_ID"].ToString()); dsp.InputPars.Add("@remark", context.Request["remark"].ToString()); dsp.InputPars.Add("@up_permission", context.Request["up_user"].ToString()); dsp.InputPars.Add("@dowm_permission", context.Request["dowm_user"].ToString()); dsp.InputPars.Add("@folder_path", folder_path); dsp.InputPars.Add("@create_person", buModel.Name); if (db.Execute(dsp).ExecuteState) { data = "success," + dsp.OutputPars["@OutID"].ToString(); string createPath = System.Web.HttpContext.Current.Server.MapPath(mainPath + folder_path); if (!Directory.Exists(createPath)) { Directory.CreateDirectory(createPath); } } else { if (dsp.OutputPars["Error"].ToString() != "" || string.IsNullOrEmpty(dsp.OutputPars["Error"].ToString())) { data = dsp.OutputPars["Error"].ToString(); } } return(data); } }
private void LoadData() { WCDataProvider db = new WCDataProvider(); WCDataStoreProcedures dsp = new WCDataStoreProcedures("sp_kaoqin", WCDataAction.Query4); string where = " a.UserID=" + buModel.UserID; if (STime != "" & ETime != "") { where += " and a.KaoQinRiQi between '" + STime + "' and '" + ETime + "'"; } if (status != "") { string s = ""; switch (status) { case "1": s = "'%(正常)%'"; break; case "2": s = "'%(迟到)%'"; break; case "3": s = "'%(早退)%'"; break; case "4": s = "'%未登记%'"; break; default: break; } if (status == "1") { where += " and (DengJiTime1 like " + s + " and DengJiTime2 like " + s + " and DengJiTime3 like " + s + " and DengJiTime4 like " + s + ")"; } else { where += " and (DengJiTime1 like " + s + " or DengJiTime2 like " + s + " or DengJiTime3 like " + s + " or DengJiTime4 like " + s + ")"; } } dsp.InputPars.Add("@where", where); if (db.Execute(dsp).ExecuteState) { DataTable dt = dsp.OutputDataSet.Tables[0]; //this.ReportViewer1.LocalReport.DisplayName = "我的考勤("+buModel.Name+")"; //this.ReportViewer1.LocalReport.LoadReportDefinition(GetRdlc()); //this.ReportViewer1.LocalReport.DataSources.Clear(); //ReportDataSource rds = new ReportDataSource("DataSet1", dt); //ReportViewer1.LocalReport.DataSources.Add(rds); //ReportViewer1.LocalReport.Refresh(); } }
public string GetB(HttpContext context) { WCDataProvider db = new WCDataProvider(); WCDataStoreProcedures dsp = new WCDataStoreProcedures("Sp_Project_Material_Submit", WCDataAction.Query2); if (db.Execute(dsp).ExecuteState) { return("success"); } return("{\"total\":0,\"rows\":[]}"); }
private string GetRolePage(HttpContext context) { string result = ""; WCDataProvider db = new WCDataProvider(); WCDataStoreProcedures dsp = new WCDataStoreProcedures("sp_permission", WCDataAction.Query1); dsp.InputPars.Add("@RolseID", context.Request["RolseID"]); if (db.Execute(dsp).ExecuteState) { result = dsp.OutputPars["@strOut"].ToString(); } return(result); }
public string updata(HttpContext context) { string mainPath = ConfigurationManager.AppSettings["FolderPath"]; string checkPathName = CheckPathName("", context.Request["level_ID"].ToString(), context.Request["folder_name"].ToString()); Model.BaseUser buModel = (Model.BaseUser)context.Session["login"]; string data = ""; WCDataProvider db = new WCDataProvider(); WCDataStoreProcedures dsp = new WCDataStoreProcedures("pro_folder", WCDataAction.Update2); //data = CheckData(context.Request["level_ID"].ToString(), context.Request["up_user"].ToString(), context.Request["dowm_user"].ToString()); if (checkPathName != "") { return(checkPathName); } else { if (data == "" || string.IsNullOrEmpty(data)) { dsp.InputPars.Add("@folder_name", context.Request["folder_name"].ToString()); dsp.InputPars.Add("@folder_id", context.Request["folder_id"].ToString()); dsp.InputPars.Add("@folder_level", context.Request["level_ID"].ToString()); dsp.InputPars.Add("@remark", context.Request["remark"].ToString()); dsp.InputPars.Add("@up_permission", context.Request["up_user"].ToString()); dsp.InputPars.Add("@dowm_permission", context.Request["dowm_user"].ToString()); dsp.InputPars.Add("@update_person", buModel.Name); dsp.InputPars.Add("@ups_add", context.Request["ups_add"].ToString()); dsp.InputPars.Add("@ups_del", context.Request["ups_del"].ToString()); dsp.InputPars.Add("@downs_add", context.Request["downs_add"].ToString()); dsp.InputPars.Add("@downs_del", context.Request["downs_del"].ToString()); if (db.Execute(dsp).ExecuteState) { string oldPath = System.Web.HttpContext.Current.Server.MapPath(mainPath + dsp.OutputPars["@OutSql"].ToString()); string newPath = System.Web.HttpContext.Current.Server.MapPath(mainPath + dsp.OutputPars["@OutSql2"].ToString()); if (oldPath != newPath) { if (Directory.Exists(oldPath)) { Directory.Move(oldPath, newPath); } } data = "success"; } else { data = "修改失败!"; } } return(data); } }
public DataTable ParentPath(string level_ID) { DataTable dt = new DataTable(); WCDataProvider db = new WCDataProvider(); WCDataStoreProcedures dsp = new WCDataStoreProcedures("pro_folder", WCDataAction.Query10); dsp.InputPars.Add("@folder_ID", level_ID); if (db.Execute(dsp).ExecuteState) { dt = dsp.OutputDataSet.Tables[0]; } return(dt); }
/// <summary> /// 保存基本信息 /// </summary> /// <param name="context"></param> /// <returns></returns> private string add_img(HttpContext context) { string revalue = ""; if (context.Session["login"] == null) { System.Web.HttpContext.Current.Response.Write("<script>alert('登录信息安全时限过期,请重新登录!');top.location='../Login.aspx'</script>"); } else { revalue = UploadImg(context); if (revalue.Split('|')[0] == "OK") { //revalue = ""; HttpPostedFile hpfile = context.Request.Files["uploadify"]; string fileName = hpfile.FileName.Substring(hpfile.FileName.LastIndexOf("\\") + 1); string path = ConfigurationManager.AppSettings["ImagPath"]; Model.BaseUser buModel = (Model.BaseUser)context.Session["login"]; WCDataProvider db = new WCDataProvider(); WCDataStoreProcedures dsp = new WCDataStoreProcedures("sp_ad_img", WCDataAction.Insert1); dsp.InputPars.Add("@img_name", context.Request["img_name"]); dsp.InputPars.Add("@title", context.Request["title"]); dsp.InputPars.Add("@CreateUserID", buModel.UserID); dsp.InputPars.Add("@v1", revalue.Split('|')[1]); if (context.Request["ckb"] == "on") { if (CheckImgShow(context) != "") { return(CheckImgShow(context)); } dsp.InputPars.Add("@show", 1); } else { dsp.InputPars.Add("@show", 0); } if (db.Execute(dsp).ExecuteState) { revalue = "|OK|" + dsp.InputPars["@v1"].ToString(); } else { revalue = dsp.ErrorMessage; } } } return(revalue); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { sid = Request.Params["sid"] == null ? "" : Request.Params["sid"].Trim(); type = Request.Params["action"] == null ? "" : Request.Params["action"].Trim(); DataSet ds = new DataSet(); if (sid != "") { WCDataProvider db = new WCDataProvider(); WCDataStoreProcedures dsp = new WCDataStoreProcedures("Sp_Pruchase", WCDataAction.Query1); //dsp.InputPars.Add("@Where", " ParentID=0 "); dsp.InputPars.Add("@ID", sid); if (db.Execute(dsp).ExecuteState) { //return Convert.ToString(dsp.OutputDataSet.Tables[0].Rows[0]["out_str"].ToString()); ds = dsp.OutputDataSet; } Code = ds.Tables[0].Rows[0]["Code"].ToString(); DeliveryOdd = ds.Tables[0].Rows[0]["DeliveryOdd"].ToString(); PriceReduction = ds.Tables[0].Rows[0]["PriceReduction"].ToString(); Currency = ds.Tables[0].Rows[0]["Currency"].ToString(); ExchangeRate = ds.Tables[0].Rows[0]["ExchangeRate"].ToString(); DiscountRate = ds.Tables[0].Rows[0]["DiscountRate"].ToString(); TaxRate = ds.Tables[0].Rows[0]["TaxRate"].ToString(); PayTerm = ds.Tables[0].Rows[0]["PayTerm"].ToString(); AccountsMode = ds.Tables[0].Rows[0]["AccountsMode"].ToString(); OtherFees = ds.Tables[0].Rows[0]["OtherFees"].ToString(); Handled = ds.Tables[0].Rows[0]["Handled"].ToString(); Prepayments = ds.Tables[0].Rows[0]["Prepayments"].ToString(); //FactoryDate = ds.Tables[0].Rows[0]["FactoryDate"].ToString().Length > 9 ? ds.Tables[0].Rows[0]["FactoryDate"].ToString().Substring(0, 9) : ds.Tables[0].Rows[0]["FactoryDate"].ToString(); //Transport = ds.Tables[0].Rows[0]["Transport"].ToString(); DeliveryAddress = ds.Tables[0].Rows[0]["DeliveryAddress"].ToString(); remark = ds.Tables[0].Rows[0]["remark"].ToString(); SupplierName = ds.Tables[0].Rows[0]["Abbreviation"].ToString(); SupplierHandled = ds.Tables[0].Rows[0]["SupplierHandled"].ToString(); LinkMan = ds.Tables[0].Rows[0]["Handled"].ToString(); Mobile = ds.Tables[0].Rows[0]["Mobile"].ToString(); total = ds.Tables[0].Rows[0]["total"].ToString(); //create_date = ds.Tables[0].Rows[0]["create_date"].ToString().Length > 9 ? ds.Tables[0].Rows[0]["create_date"].ToString().Substring(0, 9) : ds.Tables[0].Rows[0]["create_date"].ToString(); } } }
/// <summary> /// 删除图片 /// </summary> /// <param name="context"></param> /// <returns></returns> private string del_img(HttpContext context) { string v = context.Request["v1"]; System.IO.File.Delete(context.Server.MapPath(context.Request["v1"])); WCDataProvider db = new WCDataProvider(); WCDataStoreProcedures dsp = new WCDataStoreProcedures("sp_ad_img", WCDataAction.Delete1); dsp.InputPars.Add("@id", context.Request["id"]); if (db.Execute(dsp).ExecuteState) { return("success"); } else { return("删除失败!"); } }
//public string CheckData(string ID,string up_per,string dowm_per) //{ // string data=""; // bool b = false; // bool b1 = false; // WCDataProvider db = new WCDataProvider(); // WCDataStoreProcedures dsp = new WCDataStoreProcedures("pro_folder", WCDataAction.Query9); // dsp.InputPars.Add("@folder_id", ID); // DataTable dt = new DataTable(); // if (db.Execute(dsp).ExecuteState) // { // dt = dsp.OutputDataSet.Tables[0]; // } // if (dt.Rows.Count > 0) // { // for (int i = 0; i < dt.Rows.Count; i++) // { // if (up_per.Length< dt.Rows[i]["up_permission"].ToString().Length) // { // b = true; // } // if (dowm_per.Length<dt.Rows[i]["dowm_permission"].ToString().Length) // { // b1 = true; // } // } // } // if (b) // { // data += "修改后该文件夹的上传权限小于它的子文件夹的上传权限\n,"; // } // if (b1) // { // data+="修改后该文件夹的下载权限小于它的子文件夹的下载权限\n,"; // } // return data; //} public string Del(HttpContext context) { string data = ""; string ftype = context.Request.Params["ftype"].Trim(); if (ftype == "1") { WCDataProvider db = new WCDataProvider(); WCDataStoreProcedures dsp = new WCDataStoreProcedures("pro_folder", WCDataAction.Query11); dsp.InputPars.Add("@folder_id", context.Request["ID"].ToString()); if (db.Execute(dsp).ExecuteState) { if (dsp.OutputPars["@Error"].ToString() == "" || string.IsNullOrEmpty(dsp.OutputPars["@Error"].ToString())) { data = "success"; string mainPath = ConfigurationManager.AppSettings["FolderPath"]; string Path = System.Web.HttpContext.Current.Server.MapPath(mainPath + dsp.OutputPars["@OutPath"].ToString()); if (Directory.Exists(Path)) { Directory.Delete(Path); } } else { data = dsp.OutputPars["@Error"].ToString() + "请将该文件夹下的子文件夹和文件删除,再进行该操作!"; } } else { data = "删除失败!"; } } else if (ftype == "2") { int fileid = int.Parse(context.Request["ID"].Substring(2)); string path = context.Server.MapPath(ConfigurationManager.AppSettings["FolderPath"] + "/" + context.Request["folder_path"]); if (System.IO.File.Exists(path)) { System.IO.File.Delete(path); } data = new BLL.File().Delete(fileid) ? "success" : "删除失败"; } return(data); }
private string Sh_B(HttpContext context) { string sid = context.Request["sid"].ToString(); WCDataProvider db = new WCDataProvider(); WCDataStoreProcedures dsp = new WCDataStoreProcedures("Sp_Project_Material_Submit", WCDataAction.Update9); //dsp.InputPars.Add("@Where", " ParentID=0 "); dsp.InputPars.Add("@sid", sid); dsp.InputPars.Add("@SubmitPerson", ((Model.BaseUser)context.Session["login"]).UserID); if (db.Execute(dsp).ExecuteState) { return(Convert.ToString(dsp.OutputDataSet.Tables[0].Rows[0]["out_str"].ToString())); } else { return(Convert.ToString(dsp.OutputDataSet.Tables[0].Rows[0]["out_str"].ToString())); } }
public string GetList(HttpContext context) { WCDataProvider db = new WCDataProvider(); WCDataStoreProcedures dsp = new WCDataStoreProcedures("SP_StockMessage", WCDataAction.Query7); //dsp.InputPars.Add("@Where", " ParentID=0 "); dsp.InputPars.Add("@Where", " 1=1 "); dsp.InputPars.Add("@Sort", " ID desc"); dsp.InputPars.Add("@PageSize", context.Request.Form["rows"]); dsp.InputPars.Add("@PageIndex", context.Request.Form["page"]); if (db.Execute(dsp).ExecuteState) { if (dsp.OutputDataSet.Tables[0].Rows.Count > 0) { return(JsonHelper.DataTable2Json_Datagrid(dsp.OutputDataSet.Tables[0], Convert.ToInt32(dsp.OutputPars["@RecordCount"].ToString()))); } } return("{\"total\":0,\"rows\":[]}"); }
private string CheckImgShow(HttpContext context) { string revalue = ""; WCDataProvider db = new WCDataProvider(); WCDataStoreProcedures dsp = new WCDataStoreProcedures("sp_ad_img", WCDataAction.Query2); if (context.Request["img_id"] != "") { dsp.InputPars.Add("@id", context.Request["img_id"]); } else { dsp.InputPars.Add("@id", 0); } if (db.Execute(dsp).ExecuteState) { revalue = dsp.OutputPars["@Error"].ToString(); } return(revalue); }
public string ProductList(HttpContext context) { //DataTable dt = new DataTable(); //dt=DBUtility.DbHelperSQL.s WCDataProvider db = new WCDataProvider(); WCDataStoreProcedures dsp = new WCDataStoreProcedures("Sp_Product", WCDataAction.Query5); //dsp.InputPars.Add("@Where", " ParentID=0 "); dsp.InputPars.Add("@Where", " 1=1 "); dsp.InputPars.Add("@Sort", "ptName,psName,Name"); dsp.InputPars.Add("@PageSize", context.Request.Form["rows"]); dsp.InputPars.Add("@PageIndex", context.Request.Form["page"]); if (db.Execute(dsp).ExecuteState) { if (dsp.OutputDataSet.Tables[0].Rows.Count > 0) { return(JsonHelper.DataTable2Json_Datagrid(dsp.OutputDataSet.Tables[0], Convert.ToInt32(dsp.OutputPars["@RecordCount"].ToString()))); } } return("{\"total\":0,\"rows\":[]}"); }
private string SubPer(HttpContext context) { WCDataProvider db = new WCDataProvider(); WCDataStoreProcedures dsp = new WCDataStoreProcedures("sp_permission", WCDataAction.Query2); dsp.InputPars.Add("@sql", context.Request["SQLString"]); dsp.InputPars.Add("@RolseID", context.Request["RolseID"]); //dsp.InputPars.Add("@name", ((Model.BaseUser)context.Session["login"]).UserName); //dsp.InputPars.Add("@operation", "修改"); dsp.InputPars.Add("@createPerson", ((Model.BaseUser)context.Session["login"]).UserName); //dsp.InputPars.Add("@updatePerson", ((Model.BaseUser)context.Session["login"]).UserName); //dsp.InputPars.Add("@updateTime",DateTime.Now); if (db.Execute(dsp).ExecuteState) { return("保存成功。"); } else { return("保存失败。"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["login"] == null) { string tmp = DateTime.Now.ToString("yyyy/MM/dd hh:mm:ss").Trim(); Response.Write("<script type='text/javascript'>window.top.location.href='Login.aspx';</script>"); return; } //Model.BaseUser bu = (Model.BaseUser)Session["login"]; //Response.Write("<script>alert("+bu.UserID+");</script>"); buModel = (Model.BaseUser)Session["login"]; //BLL.BaseMenu bmBLL = new BLL.BaseMenu(); //DataTable dt =bmBLL.GetList("1=1 order by idx asc").Tables[0];//重组树状数据源,所以此处的SQL可以不用排序 //alter by zxf value0 = buModel.Value0; WCDataProvider db = new WCDataProvider(); WCDataStoreProcedures dsp = new WCDataStoreProcedures("sp_permission", WCDataAction.Query3); dsp.InputPars.Add("@RolseIDs", buModel.Roles); DataTable dt = new DataTable(); if (db.Execute(dsp).ExecuteState) { dt = dsp.OutputDataSet.Tables[0]; } menu = GetTreeList(dt, "MenuID", "ParentMenuID", 0, "MenuID"); if (menu.Length > 0) { menu = "[" + menu.Substring(0, menu.Length - 1) + "]"; } else { menu = "[]"; } showMainPage = new BLL.BaseRolePagePermission().exists(buModel.Roles, 9, 9); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { WCDataProvider db = new WCDataProvider(); WCDataStoreProcedures dsp = new WCDataStoreProcedures("sp_ad_img", WCDataAction.Query3); if (db.Execute(dsp).ExecuteState) { ad_img.DataSource = dsp.OutputDataSet.Tables[0]; ad_img.DataBind(); } string table = " notice "; string sort = " CreateTime "; string show = " id, title, summary "; int total = 0; DataTable dt = DbHelperSQL.GetList_ProcPage(table, sort, show, 1, 4, out total, "desc", " 1=1 ").Tables[0]; foreach (DataRow dr in dt.Rows) { htmlstring += "<li><a href='ADAndNotice/noticeview.aspx?id=" + dr["id"] + "' target='_blank' title='" + dr["summary"] + "'>" + dr["title"] + "</a></li>"; } } }
/// <summary> /// 获取下载人员列表 /// </summary> /// <param name="context"></param> /// <returns></returns> public string GetDowmUser(HttpContext context) { WCDataProvider db = new WCDataProvider(); WCDataStoreProcedures dsp = new WCDataStoreProcedures("pro_folder", WCDataAction.Query3); DataTable dt = new DataTable(); DataTable per_dt = new DataTable(); //per_dt = new BLL.BaseDepartment().GetList(" 1=1").Tables[0]; string sql = ""; string key = context.Request.Form["key"] != null ? context.Request.Form["key"].Trim() : ""; string folder_id = context.Request.Form["folder_id"] != null ? context.Request.Form["folder_id"].Trim() : ""; //string where = " 1=1"; if (key != "" || !string.IsNullOrEmpty(key)) { //if (folder_id != "" || !string.IsNullOrEmpty(folder_id)) //{ // sql = GetDeptID2(per_dt, key); // dsp.InputPars.Add("@sql", sql); // dsp.InputPars.Add("@folder_id", folder_id); // if (db.Execute(dsp).ExecuteState) // { // dt = dsp.OutputDataSet.Tables[0]; // } //} dsp.InputPars.Add("@DeptID", key); if (db.Execute(dsp).ExecuteState) { if (dsp.OutputDataSet.Tables.Count > 0) { dt = dsp.OutputDataSet.Tables[0]; } } } return(DBUtility.JsonHelper.DataTable2Json_Datagrid(dt, dt.Rows.Count)); }
protected void Page_Load(object sender, EventArgs e) { action = Request["action"].ToString(); if (action == "add") { folder_id = ""; folder_name = ""; level_id = ""; up_permission = ","; dowm_permission = ","; } else if (action == "edit") { folder_id = Request["id"].ToString(); WCDataProvider db = new WCDataProvider(); WCDataStoreProcedures dsp = new WCDataStoreProcedures("pro_folder", WCDataAction.Query6); dsp.InputPars.Add("@folder_id", folder_id); if (db.Execute(dsp).ExecuteState) { folder_name = dsp.OutputDataSet.Tables[0].Rows[0]["folder_name"].ToString(); level_id = dsp.OutputDataSet.Tables[0].Rows[0]["folder_level"].ToString(); remark = dsp.OutputDataSet.Tables[0].Rows[0]["remark"].ToString(); if (dsp.OutputDataSet.Tables[1].Rows.Count > 0) { up_permission = dsp.OutputDataSet.Tables[1].Rows[0]["up_permission"].ToString(); dowm_permission = dsp.OutputDataSet.Tables[1].Rows[0]["dowm_permission"].ToString(); } if (up_permission == "" || string.IsNullOrEmpty(up_permission)) { up_permission = "," + up_permission; } if (dowm_permission == "" || string.IsNullOrEmpty(dowm_permission)) { dowm_permission = "," + dowm_permission; } } } }
private string ChangeProcessCategory(HttpContext context) { string pssid = context.Request["pssid"] == null ? "0" : context.Request["pssid"].Trim(); string csid = context.Request["csid"] == null ? "0" : context.Request["csid"].Trim(); string result = ""; WCDataProvider db = new WCDataProvider(); WCDataStoreProcedures dsp = new WCDataStoreProcedures("sp_Project", WCDataAction.Update1); dsp.InputPars.Add("@s_sid", pssid); dsp.InputPars.Add("@ppcm_sid", csid); if (db.Execute(dsp).ExecuteState) { if (dsp.OutputPars["@out_str"].ToString().Trim() == "" || string.IsNullOrEmpty(dsp.OutputPars["@out_str"].ToString())) { result = "success"; } else { result = dsp.OutputPars["@out_str"].ToString(); } } return(result); }
public string dowm_dept_users(HttpContext context) { DataTable dt = new DataTable(); WCDataProvider db = new WCDataProvider(); WCDataStoreProcedures dsp = new WCDataStoreProcedures("pro_folder", WCDataAction.Query8); if (context.Request["folder_id"] != "0") { if (context.Request["folder_id"] != "" || !string.IsNullOrEmpty(context.Request["folder_id"])) { dsp.InputPars.Add("@folder_id", context.Request["folder_id"]); if (db.Execute(dsp).ExecuteState) { dt = dsp.OutputDataSet.Tables[0]; } } return(DBUtility.JsonHelper.DataTable2Json_Datagrid(dt, dt.Rows.Count)); } else { return("{\"total\":0,\"rows\":[]}"); } }