添加拍照保存和刷身份证显示学籍信息逻辑

Former-commit-id: 641f1a46bbd0f18041e8bd43ebc36567b2f1c602
TangShanKaiPing
wanggang 5 years ago
parent ea209e9982
commit 398b74b9d5

@ -38,7 +38,7 @@ public static class ImageHelper
var info = ImageCodecInfo.GetImageEncoders().First(o => o.FormatID == ImageFormat.Jpeg.Guid);
using (var encoderParams = new EncoderParameters(1))
{
using (var param = new EncoderParameter(Encoder.Quality, 90L))
using (var param = new EncoderParameter(Encoder.Quality, 70L))
{
encoderParams.Param[0] = param;
image.Save("temp.jpg", info, encoderParams);

@ -53,6 +53,8 @@
this.tab2 = new System.Windows.Forms.TabPage();
this.groupGrid = new System.Windows.Forms.DataGridView();
this.tab3 = new System.Windows.Forms.TabPage();
this.pull = new System.Windows.Forms.Button();
this.push = new System.Windows.Forms.Button();
this.totalPageValue = new System.Windows.Forms.Label();
this.pageIndexSelector = new System.Windows.Forms.ComboBox();
this.pageMenu = new System.Windows.Forms.FlowLayoutPanel();
@ -66,16 +68,6 @@
this.label1 = new System.Windows.Forms.Label();
this.classSelector = new System.Windows.Forms.ComboBox();
this.dataGrid = new System.Windows.Forms.DataGridView();
this.tab4 = new System.Windows.Forms.TabPage();
this.tabControl2 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.checkUpdate = new System.Windows.Forms.Button();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.tabPage4 = new System.Windows.Forms.TabPage();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.statusLabel = new System.Windows.Forms.ToolStripStatusLabel();
this.versionLabel = new System.Windows.Forms.ToolStripStatusLabel();
this.StudentName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Sex = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Nation = new System.Windows.Forms.DataGridViewTextBoxColumn();
@ -88,9 +80,32 @@
this.HasChedked = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.HasUploaded = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.StudentId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.tab4 = new System.Windows.Forms.TabPage();
this.tabControl2 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.checkUpdate = new System.Windows.Forms.Button();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.tabPage4 = new System.Windows.Forms.TabPage();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.statusLabel = new System.Windows.Forms.ToolStripStatusLabel();
this.versionLabel = new System.Windows.Forms.ToolStripStatusLabel();
this.save = new System.Windows.Forms.Button();
this.idCard = new CameraCard.IdCard();
this.push = new System.Windows.Forms.Button();
this.pull = new System.Windows.Forms.Button();
this.stuName = new System.Windows.Forms.Label();
this.stuSex = new System.Windows.Forms.Label();
this.stuNation = new System.Windows.Forms.Label();
this.stuBirthday = new System.Windows.Forms.Label();
this.stuCardType = new System.Windows.Forms.Label();
this.stuCardNo = new System.Windows.Forms.Label();
this.stuStudentNumber = new System.Windows.Forms.Label();
this.stuExamNo = new System.Windows.Forms.Label();
this.stuLanguage = new System.Windows.Forms.Label();
this.stuStudentType = new System.Windows.Forms.Label();
this.stuSchool = new System.Windows.Forms.Label();
this.stuYear = new System.Windows.Forms.Label();
this.stuClassNo = new System.Windows.Forms.Label();
this.stuNameValue = new System.Windows.Forms.Label();
tab1 = new System.Windows.Forms.TabPage();
tab1.SuspendLayout();
this.idcGroupBox.SuspendLayout();
@ -111,6 +126,7 @@
//
// tab1
//
tab1.Controls.Add(this.save);
tab1.Controls.Add(this.idcGroupBox);
tab1.Controls.Add(this.groupBox1);
tab1.Controls.Add(this.shotBtn);
@ -142,13 +158,27 @@
//
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox1.Controls.Add(this.stuNameValue);
this.groupBox1.Controls.Add(this.stuClassNo);
this.groupBox1.Controls.Add(this.stuYear);
this.groupBox1.Controls.Add(this.stuSchool);
this.groupBox1.Controls.Add(this.stuStudentType);
this.groupBox1.Controls.Add(this.stuLanguage);
this.groupBox1.Controls.Add(this.stuExamNo);
this.groupBox1.Controls.Add(this.stuStudentNumber);
this.groupBox1.Controls.Add(this.stuCardNo);
this.groupBox1.Controls.Add(this.stuCardType);
this.groupBox1.Controls.Add(this.stuBirthday);
this.groupBox1.Controls.Add(this.stuNation);
this.groupBox1.Controls.Add(this.stuSex);
this.groupBox1.Controls.Add(this.stuName);
this.groupBox1.Controls.Add(this.photo);
this.groupBox1.Location = new System.Drawing.Point(173, 9);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(426, 249);
this.groupBox1.TabIndex = 6;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "学籍信息";
this.groupBox1.Text = "学生考籍信息";
//
// photo
//
@ -164,7 +194,7 @@
// shotBtn
//
this.shotBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.shotBtn.Location = new System.Drawing.Point(764, 462);
this.shotBtn.Location = new System.Drawing.Point(714, 462);
this.shotBtn.Name = "shotBtn";
this.shotBtn.Size = new System.Drawing.Size(75, 34);
this.shotBtn.TabIndex = 4;
@ -370,6 +400,25 @@
this.tab3.Text = "图像管理";
this.tab3.UseVisualStyleBackColor = true;
//
// pull
//
this.pull.Location = new System.Drawing.Point(20, 18);
this.pull.Name = "pull";
this.pull.Size = new System.Drawing.Size(75, 23);
this.pull.TabIndex = 15;
this.pull.Text = "下载";
this.pull.UseVisualStyleBackColor = true;
this.pull.Click += new System.EventHandler(this.pull_Click);
//
// push
//
this.push.Location = new System.Drawing.Point(893, 19);
this.push.Name = "push";
this.push.Size = new System.Drawing.Size(75, 23);
this.push.TabIndex = 14;
this.push.Text = "上传";
this.push.UseVisualStyleBackColor = true;
//
// totalPageValue
//
this.totalPageValue.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
@ -531,6 +580,94 @@
this.dataGrid.VirtualMode = true;
this.dataGrid.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.grid_CellFormatting);
//
// StudentName
//
this.StudentName.DataPropertyName = "Name";
this.StudentName.HeaderText = "姓名";
this.StudentName.Name = "StudentName";
this.StudentName.ReadOnly = true;
//
// Sex
//
this.Sex.DataPropertyName = "Sex";
this.Sex.HeaderText = "性别";
this.Sex.Name = "Sex";
this.Sex.ReadOnly = true;
//
// Nation
//
this.Nation.DataPropertyName = "Nation";
this.Nation.HeaderText = "民族";
this.Nation.Name = "Nation";
this.Nation.ReadOnly = true;
//
// IdCardNo
//
this.IdCardNo.DataPropertyName = "IdCardNo";
this.IdCardNo.HeaderText = "身份证号";
this.IdCardNo.Name = "IdCardNo";
this.IdCardNo.ReadOnly = true;
//
// Class
//
this.Class.DataPropertyName = "Class";
this.Class.HeaderText = "班级";
this.Class.Name = "Class";
this.Class.ReadOnly = true;
//
// Number
//
this.Number.DataPropertyName = "Number";
this.Number.HeaderText = "学籍号";
this.Number.Name = "Number";
this.Number.ReadOnly = true;
//
// Image
//
this.Image.DataPropertyName = "Image";
this.Image.HeaderText = "图像";
this.Image.ImageLayout = System.Windows.Forms.DataGridViewImageCellLayout.Zoom;
this.Image.Name = "Image";
this.Image.ReadOnly = true;
//
// HasImage
//
this.HasImage.DataPropertyName = "HasImage";
this.HasImage.HeaderText = "已采集";
this.HasImage.Name = "HasImage";
this.HasImage.ReadOnly = true;
//
// HasIdCard
//
this.HasIdCard.DataPropertyName = "HasIdCard";
this.HasIdCard.HeaderText = "已验证身份证";
this.HasIdCard.Name = "HasIdCard";
this.HasIdCard.ReadOnly = true;
//
// HasChedked
//
this.HasChedked.DataPropertyName = "HasChecked";
this.HasChedked.HeaderText = "已审核";
this.HasChedked.Name = "HasChedked";
this.HasChedked.ReadOnly = true;
this.HasChedked.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.HasChedked.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
//
// HasUploaded
//
this.HasUploaded.DataPropertyName = "HasUploaded";
this.HasUploaded.HeaderText = "已上传";
this.HasUploaded.Name = "HasUploaded";
this.HasUploaded.ReadOnly = true;
//
// StudentId
//
this.StudentId.DataPropertyName = "Id";
this.StudentId.HeaderText = "Id";
this.StudentId.Name = "StudentId";
this.StudentId.ReadOnly = true;
this.StudentId.Visible = false;
//
// tab4
//
this.tab4.Controls.Add(this.tabControl2);
@ -632,93 +769,16 @@
this.versionLabel.Size = new System.Drawing.Size(14, 17);
this.versionLabel.Text = "v";
//
// StudentName
//
this.StudentName.DataPropertyName = "Name";
this.StudentName.HeaderText = "姓名";
this.StudentName.Name = "StudentName";
this.StudentName.ReadOnly = true;
// save
//
// Sex
//
this.Sex.DataPropertyName = "Sex";
this.Sex.HeaderText = "性别";
this.Sex.Name = "Sex";
this.Sex.ReadOnly = true;
//
// Nation
//
this.Nation.DataPropertyName = "Nation";
this.Nation.HeaderText = "民族";
this.Nation.Name = "Nation";
this.Nation.ReadOnly = true;
//
// IdCardNo
//
this.IdCardNo.DataPropertyName = "IdCardNo";
this.IdCardNo.HeaderText = "身份证号";
this.IdCardNo.Name = "IdCardNo";
this.IdCardNo.ReadOnly = true;
//
// Class
//
this.Class.DataPropertyName = "Class";
this.Class.HeaderText = "班级";
this.Class.Name = "Class";
this.Class.ReadOnly = true;
//
// Number
//
this.Number.DataPropertyName = "Number";
this.Number.HeaderText = "学籍号";
this.Number.Name = "Number";
this.Number.ReadOnly = true;
//
// Image
//
this.Image.DataPropertyName = "Image";
this.Image.HeaderText = "图像";
this.Image.ImageLayout = System.Windows.Forms.DataGridViewImageCellLayout.Zoom;
this.Image.Name = "Image";
this.Image.ReadOnly = true;
//
// HasImage
//
this.HasImage.DataPropertyName = "HasImage";
this.HasImage.HeaderText = "已采集";
this.HasImage.Name = "HasImage";
this.HasImage.ReadOnly = true;
//
// HasIdCard
//
this.HasIdCard.DataPropertyName = "HasIdCard";
this.HasIdCard.HeaderText = "已验证身份证";
this.HasIdCard.Name = "HasIdCard";
this.HasIdCard.ReadOnly = true;
//
// HasChedked
//
this.HasChedked.DataPropertyName = "HasChecked";
this.HasChedked.HeaderText = "已审核";
this.HasChedked.Name = "HasChedked";
this.HasChedked.ReadOnly = true;
this.HasChedked.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.HasChedked.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
//
// HasUploaded
//
this.HasUploaded.DataPropertyName = "HasUploaded";
this.HasUploaded.HeaderText = "已上传";
this.HasUploaded.Name = "HasUploaded";
this.HasUploaded.ReadOnly = true;
//
// StudentId
//
this.StudentId.DataPropertyName = "Id";
this.StudentId.HeaderText = "Id";
this.StudentId.Name = "StudentId";
this.StudentId.ReadOnly = true;
this.StudentId.Visible = false;
this.save.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.save.Location = new System.Drawing.Point(795, 462);
this.save.Name = "save";
this.save.Size = new System.Drawing.Size(75, 34);
this.save.TabIndex = 8;
this.save.Text = "保存";
this.save.UseVisualStyleBackColor = true;
this.save.Click += new System.EventHandler(this.save_Click);
//
// idCard
//
@ -727,24 +787,131 @@
this.idCard.Size = new System.Drawing.Size(420, 200);
this.idCard.TabIndex = 8;
//
// push
//
this.push.Location = new System.Drawing.Point(893, 19);
this.push.Name = "push";
this.push.Size = new System.Drawing.Size(75, 23);
this.push.TabIndex = 14;
this.push.Text = "上传";
this.push.UseVisualStyleBackColor = true;
//
// pull
//
this.pull.Location = new System.Drawing.Point(20, 18);
this.pull.Name = "pull";
this.pull.Size = new System.Drawing.Size(75, 23);
this.pull.TabIndex = 15;
this.pull.Text = "下载";
this.pull.UseVisualStyleBackColor = true;
this.pull.Click += new System.EventHandler(this.pull_Click);
// stuName
//
this.stuName.AutoSize = true;
this.stuName.Location = new System.Drawing.Point(7, 21);
this.stuName.Name = "stuName";
this.stuName.Size = new System.Drawing.Size(41, 12);
this.stuName.TabIndex = 6;
this.stuName.Text = "姓名:";
//
// stuSex
//
this.stuSex.AutoSize = true;
this.stuSex.Location = new System.Drawing.Point(107, 21);
this.stuSex.Name = "stuSex";
this.stuSex.Size = new System.Drawing.Size(41, 12);
this.stuSex.TabIndex = 7;
this.stuSex.Text = "性别:";
//
// stuNation
//
this.stuNation.AutoSize = true;
this.stuNation.Location = new System.Drawing.Point(215, 21);
this.stuNation.Name = "stuNation";
this.stuNation.Size = new System.Drawing.Size(41, 12);
this.stuNation.TabIndex = 8;
this.stuNation.Text = "民族:";
//
// stuBirthday
//
this.stuBirthday.AutoSize = true;
this.stuBirthday.Location = new System.Drawing.Point(6, 43);
this.stuBirthday.Name = "stuBirthday";
this.stuBirthday.Size = new System.Drawing.Size(65, 12);
this.stuBirthday.TabIndex = 9;
this.stuBirthday.Text = "出生日期:";
//
// stuCardType
//
this.stuCardType.AutoSize = true;
this.stuCardType.Location = new System.Drawing.Point(7, 69);
this.stuCardType.Name = "stuCardType";
this.stuCardType.Size = new System.Drawing.Size(65, 12);
this.stuCardType.TabIndex = 10;
this.stuCardType.Text = "证件类型:";
//
// stuCardNo
//
this.stuCardNo.AutoSize = true;
this.stuCardNo.Location = new System.Drawing.Point(6, 92);
this.stuCardNo.Name = "stuCardNo";
this.stuCardNo.Size = new System.Drawing.Size(65, 12);
this.stuCardNo.TabIndex = 11;
this.stuCardNo.Text = "证件号码:";
//
// stuStudentNumber
//
this.stuStudentNumber.AutoSize = true;
this.stuStudentNumber.Location = new System.Drawing.Point(7, 114);
this.stuStudentNumber.Name = "stuStudentNumber";
this.stuStudentNumber.Size = new System.Drawing.Size(53, 12);
this.stuStudentNumber.TabIndex = 12;
this.stuStudentNumber.Text = "学籍号:";
//
// stuExamNo
//
this.stuExamNo.AutoSize = true;
this.stuExamNo.Location = new System.Drawing.Point(7, 136);
this.stuExamNo.Name = "stuExamNo";
this.stuExamNo.Size = new System.Drawing.Size(53, 12);
this.stuExamNo.TabIndex = 13;
this.stuExamNo.Text = "考籍号:";
//
// stuLanguage
//
this.stuLanguage.AutoSize = true;
this.stuLanguage.Location = new System.Drawing.Point(7, 158);
this.stuLanguage.Name = "stuLanguage";
this.stuLanguage.Size = new System.Drawing.Size(77, 12);
this.stuLanguage.TabIndex = 14;
this.stuLanguage.Text = "外语语种号:";
//
// stuStudentType
//
this.stuStudentType.AutoSize = true;
this.stuStudentType.Location = new System.Drawing.Point(146, 161);
this.stuStudentType.Name = "stuStudentType";
this.stuStudentType.Size = new System.Drawing.Size(65, 12);
this.stuStudentType.TabIndex = 15;
this.stuStudentType.Text = "学生标识:";
//
// stuSchool
//
this.stuSchool.AutoSize = true;
this.stuSchool.Location = new System.Drawing.Point(7, 227);
this.stuSchool.Name = "stuSchool";
this.stuSchool.Size = new System.Drawing.Size(65, 12);
this.stuSchool.TabIndex = 16;
this.stuSchool.Text = "所属学校:";
//
// stuYear
//
this.stuYear.AutoSize = true;
this.stuYear.Location = new System.Drawing.Point(7, 204);
this.stuYear.Name = "stuYear";
this.stuYear.Size = new System.Drawing.Size(65, 12);
this.stuYear.TabIndex = 17;
this.stuYear.Text = "注册年份:";
//
// stuClassNo
//
this.stuClassNo.AutoSize = true;
this.stuClassNo.Location = new System.Drawing.Point(7, 181);
this.stuClassNo.Name = "stuClassNo";
this.stuClassNo.Size = new System.Drawing.Size(65, 12);
this.stuClassNo.TabIndex = 18;
this.stuClassNo.Text = "班级编码:";
//
// stuNameValue
//
this.stuNameValue.AutoSize = true;
this.stuNameValue.Location = new System.Drawing.Point(45, 21);
this.stuNameValue.Name = "stuNameValue";
this.stuNameValue.Size = new System.Drawing.Size(17, 12);
this.stuNameValue.TabIndex = 19;
this.stuNameValue.Text = "空";
//
// MainForm
//
@ -764,6 +931,7 @@
tab1.ResumeLayout(false);
this.idcGroupBox.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.photo)).EndInit();
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
@ -844,5 +1012,20 @@
private System.Windows.Forms.DataGridViewTextBoxColumn StudentId;
private System.Windows.Forms.Button pull;
private System.Windows.Forms.Button push;
private System.Windows.Forms.Button save;
private System.Windows.Forms.Label stuClassNo;
private System.Windows.Forms.Label stuYear;
private System.Windows.Forms.Label stuSchool;
private System.Windows.Forms.Label stuStudentType;
private System.Windows.Forms.Label stuLanguage;
private System.Windows.Forms.Label stuExamNo;
private System.Windows.Forms.Label stuStudentNumber;
private System.Windows.Forms.Label stuCardNo;
private System.Windows.Forms.Label stuCardType;
private System.Windows.Forms.Label stuBirthday;
private System.Windows.Forms.Label stuNation;
private System.Windows.Forms.Label stuSex;
private System.Windows.Forms.Label stuName;
private System.Windows.Forms.Label stuNameValue;
}
}

File diff suppressed because one or more lines are too long

@ -47,7 +47,7 @@ namespace WebApi.Controllers
Class = $"{i % 10 + 1}班",
Sex = "男",
Nation = "汉",
IdCardNo = $"01234567891234{i + 1}",
IdCardNo = $"22012219830118253{i + 2}",
Number = $"01234567891234{i + 1}"
});
}

Loading…
Cancel
Save