MvcBug/Controllers/DepartmentController.cs
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Data;
using Common;
using System.Data.SqlClient;
namespace MvcBug.Controllers
{
public class DepartmentController : Controller
{
//
// GET: /Department/
public ActionResult Index()
{
return View();
}
public string GetDataGridJson()
{
string pagesize = "10";
string curpage = "1";
int totalcount;
pagesize = string.IsNullOrEmpty(Request.Params["rows"]) ? pagesize : Request.Params["rows"];
curpage = string.IsNullOrEmpty(Request.Params["page"]) ? curpage : Request.Params["page"];
DataTable dt = new DAL.QueryDAL().GetDataTable("department", "Id", "Id,Code,Name", "", "", "", curpage, pagesize, out totalcount);
string jsonstr = JsonHelper.DataGridJson(dt, totalcount);
return jsonstr;
}
public string AddUpdate(FormCollection forms)
{
int Id=forms["Id"]==""?0:Convert.ToInt32(forms["Id"]);
string Code=forms["Code"];
string Name=forms["Name"];
string jsonstr = string.Empty;
try
{
int result = new DAL.DepartmentDAL().AddUpdate(Id, Code, Name);
if (result > 0)
{
jsonstr = "{\"success\":true}";
}
}
catch (SqlException ex)
{
jsonstr = "{\"errorMsg\":\"" + ex.Errors[0].ToString() + "\"}";
}
return jsonstr;
}
public string Del()
后面还有 21 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。