private string CheckInfo() { bool isEdit = false; if (Request.Form["state"] == "edit") { isEdit = true; } DataSet ds = LeaveStockInfoManage.CheckInfo(Request.Form["dataType"]); int standartNumber = 0;//插入模式不允许查询到记录 if (isEdit) { standartNumber = 1;//编辑模式最多查询到1条记录 } string res = "数据库读取失败!"; if (ds != null) { if (ds.Tables[0].Rows.Count > standartNumber) { res += "数据模板名称已存在,请重新输入!"; } else { res = "T"; } } return(res); }
private string getFormDetail() { string res = ""; Dictionary <string, string> dict = LeaveStockInfoManage.GetFormDetail(Request.Form["dataType"]); res = JsonHelper.SerializeObject(dict); return(res); }
private string getTemplate() { string res = ""; string type = Request.Form["type"]; Dictionary <string, string> dict = LeaveStockInfoManage.GetTemplate(type); res = JsonHelper.SerializeObject(dict); return(res); }
private string getDatalist() { string res = ""; DataSet ds = LeaveStockInfoManage.GetDatalistInfo(); if (ds != null) { res = JsonHelper.DataTableToJsonForEasyUiDataGridLoadDataMethod(ds.Tables[0].Rows.Count, ds.Tables[0]); } return(res); }
private string Import() { string res = "F"; string json = Request.Form["json"]; string type = Request.Form["type"]; Dictionary <string, string> dict = JsonHelper.DeserializeJsonToObject <Dictionary <string, string> >(json); if (!dict["状态"].Contains("已导入")) { dict = LeaveStockInfoManage.ImportInfos(dict, type); } res = JsonHelper.SerializeObject(dict); return(res); }
private string Insert() { string res = "F"; DataTable dt = ExcelHelperV2_0.Import(Request); if (dt != null) { res = LeaveStockInfoManage.InsertInfos(ref dt, Request.Form["dataType"]); if (res.IndexOf("error:") != 0) { res = JsonHelper.DataTableToJsonForEasyUiDataGridLoadDataMethod(dt.Rows.Count, dt); } } return(res); }
private string getData(string start, string end) { string json = "F"; DateTime dateStart = Convert.ToDateTime(start); DateTime dateEnd = Convert.ToDateTime(end); string sort = Request.Form["sort"]; string order = Request.Form["order"]; string type = Request.Form["type"]; DataSet ds = LeaveStockInfoManage.GetInfos(dateStart, dateEnd, type == null?"":type); if (ds != null) { DataTable dt = PinYinHelper.SortByPinYin(ds.Tables[0], sort, order); json = JsonHelper.DataTableToJsonForEasyUiDataGridLoadDataMethod(dt, ds.Tables[1]); } return(json); }
private string add() { string res = ""; DataSet ds = LeaveStockInfoManage.GetTemplateInfo(); if (ds != null) { ArrayList list = new ArrayList(); foreach (DataRow row in ds.Tables[0].Rows) { Dictionary <string, string> dict = new Dictionary <string, string>(); string val = Request.Form[row["field"].ToString()]; dict.Add("field", row["field"].ToString()); dict.Add("alias", val); dict.Add("type", Request.Form["type"]); list.Add(dict); } res = LeaveStockInfoManage.InsertTemplate(list); } return(res); }
private string ShowFile() { string res = "F"; DataTable dt = ExcelHelperV2_0.Import(Request); // 最后一行是统计行 需删除 dt.Rows.RemoveAt(dt.Rows.Count - 1); dt = LeaveStockInfoManage.FillBlankCell(dt, "过帐"); if (dt != null) { dt.Columns.Add("状态"); dt.Columns["状态"].SetOrdinal(0);//调整到第一列 for (int i = 0; i < dt.Rows.Count; i++) { dt.Rows[i]["状态"] = "未导入"; } res = JsonHelper.DataTableToJsonForEasyUiDataGridLoadDataMethod(dt.Rows.Count, dt); } return(res); }
private string getDataType() { string res = ""; string needAll = Request.Params["needAll"]; DataSet ds = LeaveStockInfoManage.GetDatalistInfo(); if (ds != null) { if (needAll != null) { DataTable dt = ds.Tables[0]; if (dt != null) { DataRow dr = dt.NewRow(); dr["type"] = "全部"; dt.Rows.InsertAt(dr, 0); } } res = JsonHelper.DataTable2Json(ds.Tables[0]); } return(res); }
private string delete() { return(LeaveStockInfoManage.DeleteTemplate(Request.Form["type"])); }
private string delete() { string ids = Request.Form["ids"]; return(LeaveStockInfoManage.DeleteData(ids)); }