You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.9 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/////////////////////////////////////////////////////////////////
//
// (C) Copyright 2013, Kenneth, Inc.
// All rights reserved. Confidential. Except as pursuant
// to a written agreement with Kenneth, this software may
// not be used or distributed. This software may be covered
// by one or more patents.
//
// 本软件为 ** 公司开发版权所有违者必究23810511@qq.com
//
/////////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
using System.IO;
using System.Reflection;
using System.Data;
using System.Data.SqlClient;
using System.Transactions;
using QuiltingCommon;
using MySql.Data.MySqlClient;
namespace QuiltingBusiness
{
public partial class Printpage
{
private static void ConvertSingleData(PrintpageEntityExtension data)
{
var user = SysUserPool.GetById(data.CreateBy);
if (user != null)
{
data.CreateByDisplayer = user.UserName;
}
user = SysUserPool.GetById(data.ModifyBy);
if (user != null)
{
data.ModifyByDisplayer = user.UserName;
}
var PageTypeobj = PagetypePool.GetById(data.PageType);
if (PageTypeobj != null)
{
data.PageTypeDisplayer = PageTypeobj.TypeName;
}
}
public static string DeletePage(string currentUserId, string currentClientId, string currentSendParameter)
{
string connectionString = AppHelper.GetLinkString();
using (MySqlConnection connection = new MySqlConnection(connectionString))
{
PrintpageEntityExtension pt = JsonConvert.DeserializeObject<PrintpageEntityExtension>(currentSendParameter);
if (pt != null)
{
MysqlHelper.ExecuteNonQuery(connection, string.Format("delete from PrintPage where PageType='{0}' and PageIndex = '{1}'", pt.PageType, pt.PageIndex));
}
//更新池
PrintpagePool.InitializeResults();
OutEntity oe = new OutEntity() { ErrorCode = ErrorCode.Success, ReturnObj = JsonConvert.SerializeObject(true) };
return JsonConvert.SerializeObject(oe);
}
}
public static string LoadPrintPages(string currentUserId, string currentClientId, string currentSendParameter)
{
var rows = PrintpagePool.BufferPool;
foreach (var row in rows)
{
ConvertSingleData(row);
}
OutEntity oe = new OutEntity() { ErrorCode = ErrorCode.Success, ReturnObj = JsonConvert.SerializeObject(rows) };
return JsonConvert.SerializeObject(oe);
}
}
}