Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace ARMTitan.Forms
- {
- public partial class Blocks : Form //класс формы!
- {
- private DateTime nullDate = DateTime.Parse("01.01.0001 00:00:00"); //зачем? за шкафом!
- private readonly string conString = "сплошные секреты";
- SqlConnection con;
- bool mode;
- int block;
- PreBlock bl;
- public Blocks(bool mode, int block)
- {
- InitializeComponent();
- this.mode = mode; //true = добавление . false = редактирование
- this.block = block; //номер блока который будем редктировать
- SqlConnection con; = new SqlConnection(conString);
- //загрузка справочников
- try
- {
- LoadDict(); //грузим справочники
- bl = new PreBlock(con); //создаем экземпляр класса
- if (mode == false)
- {
- BlockText.Text = block.ToString();
- BlockText.Enabled = false;
- bl.Prepare(block); //запрос
- //начинаем присваивать данные
- //осн.
- MassBlockText.Text = bl.BlockMass.ToString();
- CatBlockText.Text = Category.Text = bl.Category.ToString();
- CritOtklText.Text = bl.CritOtkl;
- OtklSKPText.Text = bl.OtklSKP;
- //аппарат восстановления
- VostProcNumber.Text = bl.VostProcNumber.ToString();
- nCondensat.Value = bl.nCondensat;
- nVostRetorta.Value = bl.nVostRetorta;
- nVostCover.Value = bl.nVostCover;
- nChvost.Value = bl.nChvost;
- nSlivPipe.Value = bl.nSlivPipe;
- nVostStove.Value = bl.nVostStove;
- nVostStove2.Value = bl.nVostStove2;
- nVostVentDU32.Value = bl.nVostVentDU32;
- nVostVentDU50.Value = bl.nVostVentDU50;
- nTask80.Value = bl.nTask80;
- CleanCover.SelectedIndex = bl.CleanCover - 1;
- TestCleanAndParts.SelectedIndex = bl.TestCleanAndParts - 1;
- ControlCondFire.SelectedIndex = bl.ControlCondFire - 1;
- ControlCondOnAir.Value = bl.ControlCondOnAir;
- WeldControlCover.SelectedIndex = bl.WeldControlCover - 1;
- GrillSet.SelectedIndex = bl.GrillSet - 1;
- POstatApp.Text = bl.POstatApp.ToString();
- POstatChange.Text = bl.POstatChange.ToString();
- AVControl.SelectedIndex = bl.AVControl - 1;
- TiCl4Doze1.SelectedIndex = bl.TiCl4Doze1 - 1;
- VdAfterDoze1.SelectedIndex = bl.VdAfterDoze1 - 1;
- ExP.Text = bl.ExP.ToString();
- AVDecision220.SelectedIndex = bl.AVDecision220 - 1;
- SlivMgCl2.Value = bl.SlivMgCl2;
- TestGrillSet.SelectedIndex = bl.TestGrillSet - 1;
- MgCond.Value = bl.MgCond;
- CleanMg.SelectedIndex = bl.CleanMg - 1;
- ZalitoMg.Value = bl.ZalitoMg;
- CalcMg.Value = bl.CalcMg;
- VostProtokAr.SelectedIndex = bl.VostProtokAr - 1;
- TiCl4Stop.SelectedIndex = bl.TiCl4Stop - 1;
- KIM.Text = bl.KIM.ToString();
- SlivMgCl2AfterR.Text = bl.SlivMgCl2AfterR.ToString();
- LastSlivControl.SelectedIndex = bl.LastSlivControl - 1;
- PodslivMgCl2.SelectedIndex = bl.PodslivMgCl2 - 1;
- AVProgar.SelectedIndex = bl.AVProgar-1;
- AVProgarSeam.Value = bl.AVProgarSeam;
- AVComment460.SelectedIndex = bl.AVComment460 - 1;
- AVComment460Other.Text = bl.AVComment460Other;
- if (bl.DTMontagAV!=nullDate) DTMontagAV.DateTime = bl.DTMontagAV;
- if (bl.DTDemontagAV!=nullDate) DTDemontagAV.DateTime = bl.DTDemontagAV;
- //аппарат сепарации
- DistProcNumber.Text = bl.DistProcNumber.ToString();
- OutView1220.SelectedIndex = bl.OutView1220 - 1;
- Comment1220.Text = bl.Comment1220;
- ProcessDecision.SelectedIndex = bl.ProcessDecision - 1;
- nDistStove.Value = bl.nDistStove;
- nDistStove2.Value = bl.nDistStove2;
- nKesson.Value = bl.nKesson;
- nDistCover.Value = bl.nDistCover;
- nDistRetorta.Value = bl.nDistRetorta;
- nDistRetortaCond.Value = bl.nDistRetortaCond;
- nDistVentDU50.Value = bl.nDistVentDU50;
- PracticWork690.Value = bl.PracticWork690;
- TestCleanRetorta.SelectedIndex = bl.TestCleanRetorta - 1;
- WeldControlRetorta.SelectedIndex = bl.WeldControlRetorta - 1;
- POstatRet.Text = bl.POstatRet.ToString();
- TestVacuumRet.Text = bl.TestVacuumRet.ToString();
- ChangePulseTube.SelectedIndex = bl.ChangePulseTube - 1;
- CleanMaterialPipe.SelectedIndex = bl.CleanMaterialPipe - 1;
- TestCleanCoverDemont.SelectedIndex = bl.TestCleanCoverDemont - 1;
- TestCleanHeatScreen.SelectedIndex = bl.TestCleanHeatScreen - 1;
- ArToDistApp.SelectedIndex = bl.ArToDistApp - 1;
- ArValueDist.Text = bl.ArValueDist.ToString();
- ASAssembly.SelectedIndex = bl.ASAssembly - 1;
- ASDecision830.SelectedIndex = bl.ASDecision830 - 1;
- VacuumPumpParam.Text = bl.VacuumPumpParam.ToString();
- TestHermeticApp.Text = bl.TestHermeticApp.ToString();
- ExPControlBeforeVac.SelectedIndex = bl.ExPControlBeforeVac - 1;
- CritParamVost.SelectedIndex = bl.CritParamVost - 1;
- CritParamDist.SelectedIndex = bl.CritParamDist - 1;
- CritParamCool.SelectedIndex = bl.CritParamCool - 1;
- CritParamRegistration.SelectedIndex = bl.CritParamRegistration - 1;
- ASVdTime.Value = bl.ASVdTime;
- ExPControlAfterExtract.SelectedIndex = bl.ExPControlAfterExtract - 1;
- RetTGControl.SelectedIndex = bl.RetTGControl - 1;
- RetTGControlSeam.Value = bl.RetTGControlSeam;
- CoolTime1060.SelectedIndex = bl.CoolTime1060 - 1;
- passivation1061.SelectedIndex = bl.passivation1061 - 1;
- passivation1062.SelectedIndex = bl.passivation1062 - 1;
- RetDemount.SelectedIndex = bl.RetDemount - 1;
- RetDemountNLift.Value = bl.RetDemountNLift;
- LiftRetInAppDemount.SelectedIndex = bl.LiftRetInAppDemount - 1;
- DeleteMgFromRet.SelectedIndex = bl.DeleteMgFromRet - 1;
- BreakApp.SelectedIndex = bl.BreakApp - 1;
- BreakAppSeam.Value = bl.BreakAppSeam;
- RetPipeTest.SelectedIndex = bl.RetPipeTest - 1;
- RetCleanTest.SelectedIndex = bl.RetCleanTest - 1;
- ASComment1150.SelectedIndex = bl.ASComment1150 - 1;
- DTBlockDelivery.DateTime = bl.DTBlockDelivery;
- FlanzCleanTest.SelectedIndex = bl.FlanzCleanTest - 1;
- BurningInPrevProc.SelectedIndex = bl.BurningInPrevProc - 1;
- TableCleanTest.SelectedIndex = bl.TableCleanTest - 1;
- DTBlockProcessing.DateTime = bl.DTBlockProcessing;
- NProbe1170.Text = bl.NProbe1170.ToString();
- NResult1170.Text = bl.NResult1170.ToString();
- NProbe1200.Text = bl.NProbe1200.ToString();
- NResult1200.Text = bl.NResult1200.ToString();
- DTMontagAC.DateTime = bl.DTMontagAC;
- DTDemontagAC.DateTime = bl.DTDemontagAC;
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- }
- /// <summary>
- /// Загружаем справочники
- /// </summary>
- public void LoadDict()
- {
- SqlConnection conD = con;
- try
- {
- string sql = "SELECT [nCode],[Description] FROM [dbo].[BlockAV220Dict] Where nCode>0";
- //Открываем соединение
- if (conD.State == ConnectionState.Closed)
- conD.Open();
- //220
- using (SqlCommand command1 = new SqlCommand(sql, con))
- {
- SqlDataReader dataReader1 = command1.ExecuteReader();
- while (dataReader1.Read())
- {
- string n = dataReader1["Description"].ToString();
- AVDecision220.Items.Add(n.Trim());
- //fraction.BeginInvoke(new Action<string>((s) => fraction.Items.Add(s)), n);
- }
- dataReader1.Close();
- }
- //460
- sql = "SELECT [nCode],[Description] FROM [dbo].[BlockAV460Dict] Where nCode>0";
- using (SqlCommand command1 = new SqlCommand(sql, con))
- {
- SqlDataReader dataReader1 = command1.ExecuteReader();
- while (dataReader1.Read())
- {
- string n = dataReader1["Description"].ToString();
- AVComment460.Items.Add(n.Trim());
- }
- dataReader1.Close();
- }
- //830
- sql = "SELECT [nCode],[Description] FROM [dbo].[BlockAS830Dict] Where nCode>0";
- using (SqlCommand command1 = new SqlCommand(sql, con))
- {
- SqlDataReader dataReader1 = command1.ExecuteReader();
- while (dataReader1.Read())
- {
- string n = dataReader1["Description"].ToString();
- ASDecision830.Items.Add(n.Trim());
- }
- dataReader1.Close();
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- con.Close();
- }
- private void SaveBtn_Click(object sender, EventArgs e)
- {
- SyncBlock();
- }
- /// <summary>
- /// Синхронизировать PreBlock с введеными даными на форме
- /// </summary>
- public void SyncBlock()
- {
- try
- {
- //осн.
- bl.BlockNumber = Convert.ToInt32(BlockText.Text); //ОШИБКА!!
- bl.BlockMass = Convert.ToInt32(MassBlockText.Text);
- bl.Category = Category.SelectedIndex + 1;
- bl.CritOtkl = CritOtklText.Text;
- bl.OtklSKP = OtklSKPText.Text;
- //аппарат восстановления
- bl.VostProcNumber = Convert.ToInt32(VostProcNumber.Text);
- bl.nCondensat = (int)nCondensat.Value;
- bl.nVostRetorta = (int)nVostRetorta.Value;
- bl.nVostCover = (int)nVostCover.Value;
- bl.nChvost = (int)nChvost.Value;
- bl.nSlivPipe = (int)nSlivPipe.Value;
- bl.nVostStove = (int)nVostStove.Value;
- bl.nVostStove2 = (int)nVostStove2.Value;
- bl.nVostVentDU32 = (int)nVostVentDU32.Value;
- bl.nVostVentDU50 = (int)nVostVentDU50.Value;
- bl.nTask80 = (int)nTask80.Value;
- bl.CleanCover = CleanCover.SelectedIndex + 1;
- bl.TestCleanAndParts = TestCleanAndParts.SelectedIndex + 1;
- bl.ControlCondFire = ControlCondFire.SelectedIndex + 1;
- bl.ControlCondOnAir = (int)ControlCondOnAir.Value;
- bl.WeldControlCover = WeldControlCover.SelectedIndex + 1;
- bl.GrillSet = GrillSet.SelectedIndex + 1;
- bl.POstatApp = Convert.ToDouble(POstatApp.Text);
- bl.POstatChange = Convert.ToDouble(POstatChange.Text);
- bl.AVControl = AVControl.SelectedIndex + 1;
- bl.TiCl4Doze1 = TiCl4Doze1.SelectedIndex + 1;
- bl.VdAfterDoze1 = VdAfterDoze1.SelectedIndex + 1;
- bl.ExP = Convert.ToDouble(ExP.Text);
- bl.AVDecision220 = AVDecision220.SelectedIndex + 1;
- bl.SlivMgCl2 = (int)SlivMgCl2.Value;
- bl.TestGrillSet = TestGrillSet.SelectedIndex + 1;
- bl.MgCond = (int)MgCond.Value;
- bl.CleanMg = CleanMg.SelectedIndex + 1;
- bl.ZalitoMg = (int)ZalitoMg.Value;
- bl.CalcMg = (int)CalcMg.Value;
- bl.VostProtokAr = VostProtokAr.SelectedIndex + 1;
- bl.TiCl4Stop = TiCl4Stop.SelectedIndex + 1;
- bl.KIM = Convert.ToDouble(KIM.Text);
- bl.SlivMgCl2AfterR = Convert.ToDouble(SlivMgCl2AfterR.Text);
- bl.LastSlivControl = LastSlivControl.SelectedIndex + 1;
- bl.PodslivMgCl2 = PodslivMgCl2.SelectedIndex + 1;
- bl.AVProgar = AVProgar.SelectedIndex + 1;
- bl.AVProgarSeam = (int)AVProgarSeam.Value;
- bl.AVComment460 = AVComment460.SelectedIndex + 1;
- bl.AVComment460Other = AVComment460Other.Text;
- if (DTMontagAV.DateTime != nullDate) bl.DTMontagAV = DTMontagAV.DateTime;
- if (DTDemontagAV.DateTime != nullDate) bl.DTDemontagAV = DTDemontagAV.DateTime;
- //аппарат сепарации
- bl.DistProcNumber = Convert.ToInt32(DistProcNumber.Text);
- bl.OutView1220 = OutView1220.SelectedIndex + 1;
- bl.Comment1220 = Comment1220.Text;
- bl.ProcessDecision = ProcessDecision.SelectedIndex + 1;
- bl.nDistStove = (int)nDistStove.Value;
- bl.nDistStove2 = (int)nDistStove2.Value;
- bl.nKesson = (int)nKesson.Value;
- bl.nDistCover = (int)nDistCover.Value;
- bl.nDistRetorta = (int)nDistRetorta.Value;
- bl.nDistRetortaCond = (int)nDistRetortaCond.Value;
- bl.nDistVentDU50 = (int)nDistVentDU50.Value;
- bl.PracticWork690 = (int)PracticWork690.Value;
- bl.TestCleanRetorta = TestCleanRetorta.SelectedIndex + 1;
- bl.WeldControlRetorta = WeldControlRetorta.SelectedIndex + 1;
- bl.POstatRet = Convert.ToDouble(POstatRet.Text);
- bl.TestVacuumRet = Convert.ToDouble(TestVacuumRet.Text);
- bl.ChangePulseTube = ChangePulseTube.SelectedIndex + 1;
- bl.CleanMaterialPipe = CleanMaterialPipe.SelectedIndex + 1;
- bl.TestCleanCoverDemont = TestCleanCoverDemont.SelectedIndex + 1;
- bl.TestCleanHeatScreen = TestCleanHeatScreen.SelectedIndex + 1;
- bl.ArToDistApp = ArToDistApp.SelectedIndex + 1;
- bl.ArValueDist = Convert.ToDouble(ArValueDist.Text);
- bl.ASAssembly = ASAssembly.SelectedIndex + 1;
- bl.ASDecision830 = ASDecision830.SelectedIndex + 1;
- bl.VacuumPumpParam = Convert.ToDouble(VacuumPumpParam.Text);
- bl.TestHermeticApp = Convert.ToDouble(TestHermeticApp.Text);
- bl.ExPControlBeforeVac = ExPControlBeforeVac.SelectedIndex + 1;
- bl.CritParamVost = CritParamVost.SelectedIndex + 1;
- bl.CritParamDist = CritParamDist.SelectedIndex + 1;
- bl.CritParamCool = CritParamCool.SelectedIndex + 1;
- bl.CritParamRegistration = CritParamRegistration.SelectedIndex + 1;
- bl.ASVdTime = (int)ASVdTime.Value;
- bl.ExPControlAfterExtract = ExPControlAfterExtract.SelectedIndex + 1;
- bl.RetTGControl = RetTGControl.SelectedIndex + 1;
- bl.RetTGControlSeam = (int)RetTGControlSeam.Value;
- bl.CoolTime1060 = CoolTime1060.SelectedIndex + 1;
- bl.passivation1061 = passivation1061.SelectedIndex + 1;
- bl.passivation1062 = passivation1062.SelectedIndex + 1;
- bl.RetDemount = RetDemount.SelectedIndex + 1;
- bl.RetDemountNLift = (int)RetDemountNLift.Value;
- bl.LiftRetInAppDemount = LiftRetInAppDemount.SelectedIndex + 1;
- bl.DeleteMgFromRet = DeleteMgFromRet.SelectedIndex + 1;
- bl.BreakApp = BreakApp.SelectedIndex + 1;
- bl.BreakAppSeam = (int)BreakAppSeam.Value;
- bl.RetPipeTest = RetPipeTest.SelectedIndex + 1;
- bl.RetCleanTest = RetCleanTest.SelectedIndex + 1;
- bl.ASComment1150 = ASComment1150.SelectedIndex + 1;
- bl.DTBlockDelivery = DTBlockDelivery.DateTime;
- bl.FlanzCleanTest = FlanzCleanTest.SelectedIndex + 1;
- bl.BurningInPrevProc = BurningInPrevProc.SelectedIndex + 1;
- bl.TableCleanTest = TableCleanTest.SelectedIndex + 1;
- bl.DTBlockProcessing = DTBlockProcessing.DateTime;
- bl.NProbe1170 = Convert.ToInt32(NProbe1170.Text);
- bl.NResult1170 = Convert.ToDouble(NResult1170.Text);
- bl.NProbe1200 = Convert.ToInt32(NProbe1200.Text);
- bl.NResult1200 = Convert.ToDouble(NResult1200.Text);
- bl.DTMontagAC = DTMontagAC.DateTime;
- bl.DTDemontagAC = DTDemontagAC.DateTime;
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- }
- }
- ////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////
- // Класс для загрузки данных о Блоке
- ////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////
- public class PreBlock
- {
- public PreBlock(SqlConnection conn)
- {
- con = conn;
- }
- SqlConnection con;
- private DateTime nullDate = DateTime.Parse("01.01.0001 00:00:00");
- //main
- public int BlockNumber;
- public string BlockIndex;
- public int BlockMass;
- public int Category;
- public string CritOtkl;
- public string OtklSKP;
- //Аппарат востановления
- public int VostProcNumber;
- public int nCondensat;
- public int nVostRetorta;
- public int nVostCover;
- public int nChvost;
- public int nSlivPipe;
- public int nVostStove;
- public int nVostStove2;
- public int nVostVentDU32;
- public int nVostVentDU50;
- public int nTask80;
- public int CleanCover;
- public int TestCleanAndParts;
- public int ControlCondFire;
- public int ControlCondOnAir;
- public int WeldControlCover;
- public int GrillSet;
- public double POstatApp;
- public double POstatChange;
- public int AVControl;
- public int TiCl4Doze1;
- public int VdAfterDoze1;
- public double ExP;
- public int AVDecision220;
- public int SlivMgCl2;
- public int TestGrillSet;
- public int MgCond;
- public int CleanMg;
- public int ZalitoMg;
- public int CalcMg;
- public int VostProtokAr;
- public int TiCl4Stop;
- public double KIM;
- public double SlivMgCl2AfterR;
- public int LastSlivControl;
- public int PodslivMgCl2;
- public int AVProgar;
- public int AVProgarSeam;
- public int AVComment460;
- public string AVComment460Other;
- public DateTime DTMontagAV;
- public DateTime DTDemontagAV;
- //аппарат сепарации
- public int DistProcNumber;
- public int OutView1220;
- public string Comment1220;
- public int ProcessDecision;
- public int nDistStove;
- public int nDistStove2;
- public int nKesson;
- public int nDistCover;
- public int nDistRetorta;
- public int nDistRetortaCond;
- public int nDistVentDU50;
- public int PracticWork690;
- public int TestCleanRetorta;
- public int WeldControlRetorta;
- public double POstatRet;
- public double TestVacuumRet;
- public int ChangePulseTube;
- public int CleanMaterialPipe;
- public int TestCleanCoverDemont;
- public int TestCleanHeatScreen;
- public int ArToDistApp;
- public double ArValueDist;
- public int ASAssembly;
- public int ASDecision830;
- public double VacuumPumpParam;
- public double TestHermeticApp;
- public int ExPControlBeforeVac;
- public int CritParamVost;
- public int CritParamDist;
- public int CritParamCool;
- public int CritParamRegistration;
- public int ASVdTime;
- public int ExPControlAfterExtract;
- public int RetTGControl;
- public int RetTGControlSeam;
- public int CoolTime1060;
- public int passivation1061;
- public int passivation1062;
- public int RetDemount;
- public int RetDemountNLift;
- public int LiftRetInAppDemount;
- public int DeleteMgFromRet;
- public int BreakApp;
- public int BreakAppSeam;
- public int RetPipeTest;
- public int RetCleanTest;
- public int ASComment1150;
- public DateTime DTBlockDelivery;
- public int FlanzCleanTest;
- public int BurningInPrevProc;
- public int TableCleanTest;
- public DateTime DTBlockProcessing;
- public int NProbe1170;
- public double NResult1170;
- public int NProbe1200;
- public double NResult1200;
- public DateTime DTMontagAC;
- public DateTime DTDemontagAC;
- //загружаем данные о блоке
- public void Prepare(int block)
- {
- if (con.State == ConnectionState.Closed)
- con.Open();
- try
- {
- //осн.
- String sql = "Select * FROM Block Where BlockNumber=" + block;
- using (SqlCommand command1 = new SqlCommand(sql, con))
- {
- SqlDataReader dr = command1.ExecuteReader();
- dr.Read();
- Category = dr["Category"] != DBNull.Value ? Convert.ToInt32(dr["Category"]):0;
- BlockMass = dr["BlockMass"] != DBNull.Value ? Convert.ToInt32(dr["BlockMass"].ToString()):0;
- CritOtkl = dr["CritOtkl"] != DBNull.Value ? dr["CritOtkl"].ToString():"";
- OtklSKP = dr["OtklSKP"] != DBNull.Value ? dr["OtklSKP"].ToString():"";
- dr.Close();
- }
- //Аппарат востановления
- sql = "Select * FROM BlockAV Where BlockNumber=" + block;
- using (SqlCommand command1 = new SqlCommand(sql, con))
- {
- SqlDataReader dr = command1.ExecuteReader();
- dr.Read();
- VostProcNumber = dr["VostProcNumber"] != DBNull.Value ? Convert.ToInt32(dr["VostProcNumber"].ToString()) : 0;
- nCondensat = dr["nCondensat"] != DBNull.Value ? Convert.ToInt32(dr["nCondensat"].ToString()) : 0;
- nVostRetorta = dr["nVostRetorta"] != DBNull.Value ? Convert.ToInt32(dr["nVostRetorta"].ToString()) : 0;
- nVostCover = dr["nVostCover"] != DBNull.Value ? Convert.ToInt32(dr["nVostCover"].ToString()) : 0;
- nChvost = dr["nChvost"] != DBNull.Value ? Convert.ToInt32(dr["nChvost"].ToString()) : 0;
- nSlivPipe = dr["nSlivPipe"] != DBNull.Value ? Convert.ToInt32(dr["nSlivPipe"].ToString()) : 0;
- nVostStove = dr["nVostStove"] != DBNull.Value ? Convert.ToInt32(dr["nVostStove"].ToString()) : 0;
- nVostStove2 = dr["nVostStove2"] != DBNull.Value ? Convert.ToInt32(dr["nVostStove2"].ToString()) : 0;
- nVostVentDU32 = dr["nVostVentDU32"] != DBNull.Value ? Convert.ToInt32(dr["nVostVentDU32"].ToString()) : 0;
- nVostVentDU50 =dr["nVostVentDU50"] != DBNull.Value ? Convert.ToInt32(dr["nVostVentDU50"].ToString()) : 0;
- nTask80 = dr["nTask80"] != DBNull.Value ? Convert.ToInt32(dr["nTask80"].ToString()) : 0;
- CleanCover = dr["CleanCover"] != DBNull.Value ? Convert.ToInt32(dr["CleanCover"].ToString()) : 0;
- TestCleanAndParts = dr["TestCleanAndParts"] != DBNull.Value ? Convert.ToInt32(dr["TestCleanAndParts"].ToString()) : 0;
- ControlCondFire = dr["ControlCondFire"] != DBNull.Value ? Convert.ToInt32(dr["ControlCondFire"].ToString()) : 0;
- ControlCondOnAir = dr["ControlCondOnAir"] != DBNull.Value ? Convert.ToInt32(dr["ControlCondOnAir"].ToString()) : 0;
- WeldControlCover = dr["WeldControlCover"] != DBNull.Value ? Convert.ToInt32(dr["WeldControlCover"].ToString()) : 0;
- GrillSet = dr["GrillSet"] != DBNull.Value ? Convert.ToInt32(dr["GrillSet"].ToString()) : 0;
- POstatApp = dr["POstatApp"] != DBNull.Value ? Convert.ToDouble(dr["POstatApp"].ToString()) : 0;
- POstatChange = dr["POstatChange"] != DBNull.Value ? Convert.ToDouble(dr["POstatChange"].ToString()) : 0;
- AVControl = dr["AVControl"] != DBNull.Value ? Convert.ToInt32(dr["AVControl"].ToString()) : 0;
- TiCl4Doze1 = dr["TiCl4Doze1"] != DBNull.Value ? Convert.ToInt32(dr["TiCl4Doze1"].ToString()) : 0;
- VdAfterDoze1 = dr["VdAfterDoze1"] != DBNull.Value ? Convert.ToInt32(dr["VdAfterDoze1"].ToString()) : 0;
- ExP = dr["nTask80"] != DBNull.Value ? Convert.ToDouble(dr["nTask80"].ToString()) : 0; ;
- AVDecision220 = dr["AVDecision220"] != DBNull.Value ? Convert.ToInt32(dr["AVDecision220"].ToString()) : 0;
- SlivMgCl2 = dr["SlivMgCl2"] != DBNull.Value ? Convert.ToInt32(dr["SlivMgCl2"].ToString()) : 0;
- TestGrillSet = dr["TestGrillSet"] != DBNull.Value ? Convert.ToInt32(dr["TestGrillSet"].ToString()) : 0;
- MgCond = dr["MgCond"] != DBNull.Value ? Convert.ToInt32(dr["MgCond"].ToString()) : 0;
- CleanMg = dr["CleanMg"] != DBNull.Value ? Convert.ToInt32(dr["CleanMg"].ToString()) : 0;
- ZalitoMg = dr["ZalitoMg"] != DBNull.Value ? Convert.ToInt32(dr["ZalitoMg"].ToString()) : 0;
- CalcMg = dr["CalcMg"] != DBNull.Value ? Convert.ToInt32(dr["CalcMg"].ToString()) : 0;
- VostProtokAr = dr["VostProtokAr"] != DBNull.Value ? Convert.ToInt32(dr["VostProtokAr"].ToString()) : 0;
- TiCl4Stop = dr["TiCl4Stop"] != DBNull.Value ? Convert.ToInt32(dr["TiCl4Stop"].ToString()) : 0;
- KIM = dr["KIM"] != DBNull.Value ? Convert.ToDouble(dr["KIM"].ToString()) : 0;
- SlivMgCl2AfterR = dr["SlivMgCl2AfterR"] != DBNull.Value ? Convert.ToDouble(dr["SlivMgCl2AfterR"].ToString()) : 0;
- LastSlivControl = dr["LastSlivControl"] != DBNull.Value ? Convert.ToInt32(dr["LastSlivControl"].ToString()) : 0;
- PodslivMgCl2 = dr["PodslivMgCl2"] != DBNull.Value ? Convert.ToInt32(dr["PodslivMgCl2"].ToString()) : 0;
- AVProgar = dr["AVProgar"] != DBNull.Value ? Convert.ToInt32(dr["AVProgar"].ToString()) : 0;
- AVProgarSeam = dr["AVProgarSeam"] != DBNull.Value ? Convert.ToInt32(dr["AVProgarSeam"].ToString()) : 0;
- AVComment460 = dr["AVComment460"] != DBNull.Value ? Convert.ToInt32(dr["AVComment460"].ToString()) : 0;
- AVComment460Other = dr["AVComment460Other"] != DBNull.Value ? dr["AVComment460Other"].ToString(): "";
- //if (dr["DOtgruz"] != DBNull.Value) dOtgruz.DateTime = Convert.ToDateTime(dr["DOtgruz"]);
- if (dr["DTMontagAV"] != DBNull.Value) DTMontagAV = Convert.ToDateTime(dr["DTMontagAV"]);// ? Convert.ToDateTime(dr["DTMontagAV"].ToString()) : 0;
- if (dr["DTDemontagAV"]!= DBNull.Value) DTDemontagAV = Convert.ToDateTime(dr["DTDemontagAV"]);//.ToString()):0;
- dr.Close();
- }
- //Аппарат сепарации
- sql = "Select * FROM BlockAS Where BlockNumber=" + block;
- using (SqlCommand command1 = new SqlCommand(sql, con))
- {
- SqlDataReader dr = command1.ExecuteReader();
- dr.Read();
- DistProcNumber = dr["DistProcNumber"] != DBNull.Value ? Convert.ToInt32(dr["DistProcNumber"].ToString()) : 0;
- OutView1220 = dr["OutView1220"] != DBNull.Value ? Convert.ToInt32(dr["OutView1220"].ToString()) : 0;
- Comment1220 = dr["Comment1220"] != DBNull.Value ? dr["Comment1220"].ToString() : "";
- ProcessDecision = dr["ProcessDecision"] != DBNull.Value ? Convert.ToInt32(dr["ProcessDecision"].ToString()) : 0;
- nDistStove = dr["nDistStove"] != DBNull.Value ? Convert.ToInt32(dr["nDistStove"].ToString()) : 0;
- nDistStove2 = dr["nDistStove2"] != DBNull.Value ? Convert.ToInt32(dr["nDistStove2"].ToString()) : 0;
- nKesson = dr["nKesson"] != DBNull.Value ? Convert.ToInt32(dr["nKesson"].ToString()) : 0;
- nDistCover = dr["nDistCover"] != DBNull.Value ? Convert.ToInt32(dr["nDistCover"].ToString()) : 0;
- nDistRetorta = dr["nDistRetorta"] != DBNull.Value ? Convert.ToInt32(dr["nDistRetorta"].ToString()) : 0;
- nDistRetortaCond = dr["nDistRetortaCond"] != DBNull.Value ? Convert.ToInt32(dr["nDistRetortaCond"].ToString()) : 0;
- nDistVentDU50 = dr["nDistVentDU50"] != DBNull.Value ? Convert.ToInt32(dr["nDistVentDU50"].ToString()) : 0;
- PracticWork690 = dr["PracticWork690"] != DBNull.Value ? Convert.ToInt32(dr["PracticWork690"].ToString()) : 0;
- TestCleanRetorta = dr["TestCleanRetorta"] != DBNull.Value ? Convert.ToInt32(dr["TestCleanRetorta"].ToString()) : 0;
- WeldControlRetorta = dr["WeldControlRetorta"] != DBNull.Value ? Convert.ToInt32(dr["WeldControlRetorta"].ToString()) : 0;
- POstatRet = dr["POstatRet"] != DBNull.Value ? Convert.ToDouble(dr["POstatRet"].ToString()) : 0;
- TestVacuumRet = dr["TestVacuumRet"] != DBNull.Value ? Convert.ToDouble(dr["TestVacuumRet"].ToString()) : 0;
- ChangePulseTube = dr["ChangePulseTube"] != DBNull.Value ? Convert.ToInt32(dr["ChangePulseTube"].ToString()) : 0;
- CleanMaterialPipe = dr["CleanMaterialPipe"] != DBNull.Value ? Convert.ToInt32(dr["CleanMaterialPipe"].ToString()) : 0;
- TestCleanCoverDemont = dr["TestCleanCoverDemont"] != DBNull.Value ? Convert.ToInt32(dr["TestCleanCoverDemont"].ToString()) : 0;
- TestCleanHeatScreen = dr["TestCleanHeatScreen"] != DBNull.Value ? Convert.ToInt32(dr["TestCleanHeatScreen"].ToString()) : 0;
- ArToDistApp = dr["ArToDistApp"] != DBNull.Value ? Convert.ToInt32(dr["ArToDistApp"].ToString()) : 0;
- ArValueDist = dr["ArValueDist"] != DBNull.Value ? Convert.ToDouble(dr["ArValueDist"].ToString()) : 0;
- ASAssembly = dr["ASAssembly"] != DBNull.Value ? Convert.ToInt32(dr["ASAssembly"].ToString()) : 0;
- ASDecision830 = dr["ASDecision830"] != DBNull.Value ? Convert.ToInt32(dr["ASDecision830"].ToString()) : 0;
- VacuumPumpParam = dr["VacuumPumpParam"] != DBNull.Value ? Convert.ToDouble(dr["VacuumPumpParam"].ToString()) : 0;
- TestHermeticApp = dr["TestHermeticApp"] != DBNull.Value ? Convert.ToDouble(dr["TestHermeticApp"].ToString()) : 0;
- ExPControlBeforeVac = dr["ExPControlBeforeVac"] != DBNull.Value ? Convert.ToInt32(dr["ExPControlBeforeVac"].ToString()) : 0;
- CritParamVost = dr["CritParamVost"] != DBNull.Value ? Convert.ToInt32(dr["CritParamVost"].ToString()) : 0;
- CritParamDist = dr["CritParamDist"] != DBNull.Value ? Convert.ToInt32(dr["CritParamDist"].ToString()) : 0;
- CritParamCool = dr["CritParamCool"] != DBNull.Value ? Convert.ToInt32(dr["CritParamCool"].ToString()) : 0;
- CritParamRegistration = dr["CritParamRegistration"] != DBNull.Value ? Convert.ToInt32(dr["CritParamRegistration"].ToString()) : 0;
- ASVdTime = dr["ASVdTime"] != DBNull.Value ? Convert.ToInt32(dr["ASVdTime"].ToString()) : 0;
- ExPControlAfterExtract = dr["ExPControlAfterExtract"] != DBNull.Value ? Convert.ToInt32(dr["ExPControlAfterExtract"].ToString()) : 0;
- RetTGControl = dr["RetTGControl"] != DBNull.Value ? Convert.ToInt32(dr["RetTGControl"].ToString()) : 0;
- RetTGControlSeam = dr["RetTGControlSeam"] != DBNull.Value ? Convert.ToInt32(dr["RetTGControlSeam"].ToString()) : 0;
- CoolTime1060 = dr["CoolTime1060"] != DBNull.Value ? Convert.ToInt32(dr["CoolTime1060"].ToString()) : 0;
- passivation1061 = dr["passivation1061"] != DBNull.Value ? Convert.ToInt32(dr["passivation1061"].ToString()) : 0;
- passivation1062 = dr["passivation1062"] != DBNull.Value ? Convert.ToInt32(dr["passivation1062"].ToString()) : 0;
- RetDemount = dr["RetDemount"] != DBNull.Value ? Convert.ToInt32(dr["RetDemount"].ToString()) : 0;
- RetDemountNLift = dr["RetDemountNLift"] != DBNull.Value ? Convert.ToInt32(dr["RetDemountNLift"].ToString()) : 0;
- LiftRetInAppDemount = dr["LiftRetInAppDemount"] != DBNull.Value ? Convert.ToInt32(dr["LiftRetInAppDemount"].ToString()) : 0;
- DeleteMgFromRet = dr["DeleteMgFromRet"] != DBNull.Value ? Convert.ToInt32(dr["DeleteMgFromRet"].ToString()) : 0;
- BreakApp = dr["BreakApp"] != DBNull.Value ? Convert.ToInt32(dr["BreakApp"].ToString()) : 0;
- BreakAppSeam = dr["BreakAppSeam"] != DBNull.Value ? Convert.ToInt32(dr["BreakAppSeam"].ToString()) : 0;
- RetPipeTest = dr["RetPipeTest"] != DBNull.Value ? Convert.ToInt32(dr["RetPipeTest"].ToString()) : 0;
- RetCleanTest = dr["RetCleanTest"] != DBNull.Value ? Convert.ToInt32(dr["RetCleanTest"].ToString()) : 0;
- ASComment1150 = dr["ASComment1150"] != DBNull.Value ? Convert.ToInt32(dr["ASComment1150"].ToString()) : 0;
- if (dr["DTBlockDelivery"] != DBNull.Value) DTBlockDelivery = Convert.ToDateTime(dr["DTBlockDelivery"].ToString());
- FlanzCleanTest = dr["FlanzCleanTest"] != DBNull.Value ? Convert.ToInt32(dr["FlanzCleanTest"].ToString()) : 0;
- BurningInPrevProc = dr["BurningInPrevProc"] != DBNull.Value ? Convert.ToInt32(dr["BurningInPrevProc"].ToString()) : 0;
- TableCleanTest = dr["TableCleanTest"] != DBNull.Value ? Convert.ToInt32(dr["TableCleanTest"].ToString()) : 0;
- if (dr["DTBlockProcessing"] != DBNull.Value) DTBlockProcessing = Convert.ToDateTime(dr["DTBlockProcessing"].ToString());
- NProbe1170 = dr["NProbe1170"] != DBNull.Value ? Convert.ToInt32(dr["NProbe1170"].ToString()) : 0;
- NResult1170 = dr["NResult1170"] != DBNull.Value ? Convert.ToDouble(dr["NResult1170"].ToString()) : 0;
- NProbe1200 = dr["NProbe1200"] != DBNull.Value ? Convert.ToInt32(dr["NProbe1200"].ToString()) : 0;
- NResult1200 = dr["NResult1200"] != DBNull.Value ? Convert.ToDouble(dr["NResult1200"].ToString()) : 0;
- if (dr["DTMontagAC"] != DBNull.Value) DTMontagAC = Convert.ToDateTime(dr["DTMontagAC"].ToString());
- if (dr["DTDemontagAC"] != DBNull.Value) DTDemontagAC = Convert.ToDateTime(dr["DTDemontagAC"].ToString());
- dr.Close();
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- con.Close();
- }
- //ну тут пока что пусто
- public void saveBlock()
- {
- try
- {
- if (con.State == ConnectionState.Closed)
- con.Open();
- con.Close();
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement