tijian_jichuang/Code/SOH.JianYan/frmAddZhiKongPin.cs
2025-02-20 11:54:48 +08:00

101 lines
2.7 KiB
C#

using SOH.Kernel;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SOH.Entities;
using EAS.Services;
using SOH.BLL;
using SOH.Data;
namespace SOH.JianYan
{
public partial class frmAddZhiKongPin : Form
{
public string yqbh = "";
frm_QC_Object fmQCO1;
QC_Object qcobjects;
public frmAddZhiKongPin()
{
InitializeComponent();
}
public frmAddZhiKongPin(string yq,QC_Object qcobject,frm_QC_Object fmQCO)
{
InitializeComponent();
yqbh = yq;
this.fmQCO1 = fmQCO;
qcobjects = qcobject;
}
private void button1_Click(object sender, EventArgs e)
{
QC_Object qco = new QC_Object();
if (qcobjects != null)
{
qco.QCOID = qcobjects.QCOID;
}
else
{
qco.QCOID = 0;
}
qco.yqbh = yqbh;
qco.qybj= cbQybj.Checked==true ? 1 : 0;
qco.pch = this.txb_pch.Text.Trim();
qco.sccj = this.txb_sccj.Text;
qco.ndName = this.cbNd.Text;
qco.jyff = this.txb_jyff.Text;
qco.hxsj = this.txb_hxsj.Text;
qco.bz = this.txb_bz.Text;
qco.strrq = this.dtp_strrq.Value;
qco.endrq = this.dtp_endrq.Value;
addorupdate(qco);
}
private void addorupdate(QC_Object qco)
{
var qcoId = qco.QCOID;
//throw new NotImplementedException();
var vser = ServiceContainer.GetService<IJianYan>();
OperationResult or = vser.qcobject(qco);
if (or.State != 1)
{
MessageBox.Show(or.Message);
return;
}
else
{
fmQCO1.showxq();
this.Close();
}
}
private void button2_Click(object sender, EventArgs e)
{
this.Close();
}
private void frmAddZhiKongPin_Load(object sender, EventArgs e)
{
if (qcobjects != null)
{
this.txb_pch.Text = qcobjects.pch;
this.txb_jyff.Text = qcobjects.jyff;
this.txb_sccj.Text = qcobjects.sccj;
this.txb_hxsj.Text = qcobjects.hxsj;
this.cbNd.Text = qcobjects.ndName;
this.txb_bz.Text = qcobjects.bz;
this.dtp_strrq.Value = qcobjects.strrq;
this.dtp_endrq.Value = qcobjects.endrq;
}
}
}
}