Browse Source

Merge branch 'master' of https://gitee.com/zxyabc/COMONE

master
TML 4 years ago
parent
commit
9df3b4ea7d
  1. 12
      Models/ScpEntity/SCP_OTD_EXPORT.cs
  2. 37
      SCP/Admin/MakeInitUser.aspx
  3. 161
      SCP/Admin/MakeInitUser.aspx.cs
  4. 96
      SCP/Admin/MakeInitUser.aspx.designer.cs
  5. 1
      SCP/Handlers/ReceiveHandler.ashx
  6. 73
      SCP/Handlers/ReceiveHandler.ashx.cs
  7. 1
      SCP/Handlers/ServiceHandler.ashx
  8. 34
      SCP/Handlers/ServiceHandler.ashx.cs
  9. 16
      SCP/SCP.csproj

12
Models/ScpEntity/SCP_OTD_EXPORT.cs

@ -6,6 +6,18 @@ using System.Threading.Tasks;
namespace CK.SCP.Models.ScpEntity
{
public class InvoiceCreateQueryParm
{
public string ReceiveID { set; get; }
public string VendId { set; get; }
public string Modify { set; get; }
public string IsAll { set; get; }
public string Tax { set; get; }
public string CJ { set; get; }
public string TZ { set; get; }
}
public class SCP_OTD_EXPORT
{
public string VendId { get; set; } //供应商编号

37
SCP/Admin/MakeInitUser.aspx

@ -1,37 +0,0 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MakeInitUser.aspx.cs" Inherits="SCP.Admin.MakeInitUser" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" BodyPadding="5px"
ShowBorder="false" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start"
ShowHeader="false" Title="用户管理">
<Items>
<f:Form ID="Form2" runat="server" Height="36px" BodyPadding="5px" ShowHeader="false"
ShowBorder="false" LabelAlign="Right">
<Rows>
<f:FormRow ID="FormRow1" runat="server">
<Items>
<f:Button Text="生成供应商用户" runat="server" ID="BTN_Make" OnClick="BTN_Make_Click"></f:Button>
<f:Button Text="生成供应商生成对应关系" runat="server" ID="Button2" OnClick="Button2_Click"></f:Button>
<f:Button Text="生成供应商相关对应地点" runat="server" ID="Button1" OnClick="Button1_Click"></f:Button>
</Items>
</f:FormRow>
</Rows>
</f:Form>
</Items>
</f:Panel>
<f:Window ID="Window1" runat="server" IsModal="true" Hidden="true" Target="Top" EnableResize="true"
EnableMaximize="true" EnableIFrame="true" IFrameUrl="about:blank" Width="800px"
Height="500px" >
</f:Window>
</form>
</body>
</html>

161
SCP/Admin/MakeInitUser.aspx.cs

@ -1,161 +0,0 @@
using CK.SCP.Models.AppBoxEntity;
using CK.SCP.Models.AppBoxEntity.ExcelImportEntity;
using CK.SCP.Utils;
using FineUI;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace SCP.Admin
{
public partial class MakeInitUser : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void BTN_Make_Click(object sender, EventArgs e)
{
try
{
var vendList = SCPDB.TA_VENDER.ToList();
List<APPBOX_USER_EXCEL> list = new List<APPBOX_USER_EXCEL>();
foreach (var itm in vendList)
{
APPBOX_USER_EXCEL excel = new APPBOX_USER_EXCEL();
excel. = itm.VendId;
excel. = "666666";
excel. = "男";
excel. = itm.VendName;
excel. = itm.VendId + "@163.com";
excel. = itm.VendId;
excel. = itm.Site;
list.Add(excel);
}
List<User> _ls = new List<CK.SCP.Models.AppBoxEntity.User>();
list.ForEach(itm =>
{
var userList = DB.Users.Where(p => p.Name == itm.).ToList();
if(userList.Count==0)
{
User item = new User();
item.Name = itm. + "@" + itm.;
item.Password = PasswordUtil.CreateDbPassword(itm..Trim());
item.ChineseName = itm..Trim();
item.Gender = itm.;
item.CompanyEmail = itm..Trim();
item.Email = itm..Trim();
item.Remark = itm.;
item.Enabled = true;
item.CreateTime = DateTime.Now;
item.SupplierCode = itm.;
if (!string.IsNullOrEmpty(itm.))
{
var _role = DB.Roles.Where(p => p.Name == "供应商").FirstOrDefault();
if (_role != null)
{
item.Roles = new List<Role>();
int[] roleIDs = new int[] { _role.ID };
AddEntities<Role>(item.Roles, roleIDs);
}
item.SupplierCode = itm.;
}
DB.Users.Add(item);
}
});
if (DB.SaveChanges() != -1)
{
}
}
catch (Exception ex)
{
Alert.Show(ex.Message);
}
}
protected void BTN_Rel_Click(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
try
{
var _userlist = DB.Users.ToList();
foreach (var itm in _userlist)
{
if (!string.IsNullOrEmpty(itm.Remark))
{
var _factory = itm.Remark;
var _f = DB.TA_FACTORY.Where(p => p.FactoryId == _factory).FirstOrDefault();
int[] titleIDs = new int[] { _f.ID };
AddEntities<TA_FACTORY>(itm.TA_FACTORY, titleIDs);
}
}
DB.SaveChanges();
}
catch (Exception ex)
{
Alert.Show(ex.Message);
return;
}
}
protected void Button2_Click(object sender, EventArgs e)
{
try
{
var _userlist = DB.Users.ToList();
foreach (var itm in _userlist)
{
if (!string.IsNullOrEmpty(itm.Remark))
{
var _VenderUsers = DB.VenderUsers.Where(p => p.UserId == itm.ID).ToList();
if (_VenderUsers != null && _VenderUsers.Count > 0)
{
DB.VenderUsers.RemoveRange(_VenderUsers);
}
List<VenderUsers> _vList = new List<VenderUsers>();
VenderUsers _vus = new VenderUsers();
_vus.UserId = itm.ID;
_vus.VenderId = itm.Name.Split('@')[0];
_vList.Add(_vus);
if (_vList.Count > 0)
{
var ls = _vList.Where(p => p.UserId > 0 && !string.IsNullOrEmpty(p.VenderId));
DB.VenderUsers.AddRange(ls.ToArray());
}
}
}
DB.SaveChanges();
}
catch (Exception ex)
{
Alert.Show(ex.Message);
return;
}
}
}
}

96
SCP/Admin/MakeInitUser.aspx.designer.cs

@ -1,96 +0,0 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Admin {
public partial class MakeInitUser {
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Form2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Form Form2;
/// <summary>
/// FormRow1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow1;
/// <summary>
/// BTN_Make 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BTN_Make;
/// <summary>
/// Button2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button2;
/// <summary>
/// Button1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button1;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window Window1;
}
}

1
SCP/Handlers/ReceiveHandler.ashx

@ -1 +0,0 @@
<%@ WebHandler Language="C#" CodeBehind="ReceiveHandler.ashx.cs" Class="SCP.Handlers.ReceiveHandler" %>

73
SCP/Handlers/ReceiveHandler.ashx.cs

@ -1,73 +0,0 @@
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace SCP.Handlers
{
/// <summary>
/// ReceiveHandler 的摘要说明
/// </summary>
public class ReceiveHandler : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
string rowId = context.Request.QueryString["id"];
int rowIdInt = Convert.ToInt32(rowId);
JObject jo = new JObject();
JArray ja = new JArray();
Random rd = new Random();
for (int i = 0; i < 3; i++)
{
JObject joItem = new JObject();
if (i == 0)
{
joItem.Add("type", "入学");
}
else if (i == 1)
{
joItem.Add("type", "期中");
}
else if (i == 2)
{
joItem.Add("type", "期末");
}
int randomMinValue = 80;
int randomMaxValue = 100;
if (rowIdInt % 2 == 0)
{
randomMinValue = 40;
randomMaxValue = 80;
}
joItem.Add("yuwen", rd.Next(randomMinValue, randomMaxValue));
joItem.Add("shuxue", rd.Next(randomMinValue, randomMaxValue));
joItem.Add("yingwen", rd.Next(randomMinValue, randomMaxValue));
joItem.Add("wuli", rd.Next(randomMinValue, randomMaxValue));
joItem.Add("huaxue", rd.Next(randomMinValue, randomMaxValue));
ja.Add(joItem);
}
jo.Add("data", ja);
jo.Add("total", ja.Count);
context.Response.ContentType = "text/plain";
context.Response.Write(jo.ToString(Newtonsoft.Json.Formatting.None));
}
public bool IsReusable
{
get
{
return false;
}
}
}
}

1
SCP/Handlers/ServiceHandler.ashx

@ -1 +0,0 @@
<%@ WebHandler Language="C#" CodeBehind="ServiceHandler.ashx.cs" Class="SCP.Handlers.ServiceHandler" %>

34
SCP/Handlers/ServiceHandler.ashx.cs

@ -1,34 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace SCP.Handlers
{
/// <summary>
/// ServiceHandler 的摘要说明
/// </summary>
public class ServiceHandler : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "json";
context.Response.Write("Hello World");
}
public bool IsReusable
{
get
{
return false;
}
}
//public string GetUnCompleteAsk()
//{
//}
}
}

16
SCP/SCP.csproj

@ -177,7 +177,6 @@
<Content Include="Admin\help\wannianli.htm" />
<Content Include="Admin\log.aspx" />
<Content Include="Admin\log_view.aspx" />
<Content Include="Admin\MakeInitUser.aspx" />
<Content Include="Admin\menu.aspx" />
<Content Include="Admin\menu_edit.aspx" />
<Content Include="Admin\menu_new.aspx" />
@ -2906,12 +2905,10 @@
<Content Include="Handlers\FileUpload.ashx" />
<Content Include="grf\Material.grf" />
<Content Include="Handlers\MakeVerifyCode.ashx" />
<Content Include="Handlers\ReceiveHandler.ashx" />
<Content Include="grf\SendBill.grf" />
<Content Include="Handlers\GenerateReport.ashx" />
<Content Include="grf\SmallBarCode.grf" />
<Content Include="grf\InvRecBill.grf" />
<Content Include="Handlers\ServiceHandler.ashx" />
<None Include="Properties\PublishProfiles\COM.pubxml" />
<None Include="Scripts\jquery-1.10.2.intellisense.js" />
<Content Include="main.aspx" />
@ -4644,13 +4641,6 @@
<Compile Include="Admin\log_view.aspx.designer.cs">
<DependentUpon>log_view.aspx</DependentUpon>
</Compile>
<Compile Include="Admin\MakeInitUser.aspx.cs">
<DependentUpon>MakeInitUser.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Admin\MakeInitUser.aspx.designer.cs">
<DependentUpon>MakeInitUser.aspx</DependentUpon>
</Compile>
<Compile Include="Admin\menu.aspx.cs">
<DependentUpon>menu.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -4890,12 +4880,6 @@
<Compile Include="Handlers\MakeVerifyCode.ashx.cs">
<DependentUpon>MakeVerifyCode.ashx</DependentUpon>
</Compile>
<Compile Include="Handlers\ReceiveHandler.ashx.cs">
<DependentUpon>ReceiveHandler.ashx</DependentUpon>
</Compile>
<Compile Include="Handlers\ServiceHandler.ashx.cs">
<DependentUpon>ServiceHandler.ashx</DependentUpon>
</Compile>
<Compile Include="Views\BasicData\Price.aspx.cs">
<DependentUpon>Price.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>

Loading…
Cancel
Save