Example #1
0
        private void btnLJSC_Click(object sender, EventArgs e)
        {
            #region ����֤��Ϣ�����ԡ�

            for (int i = 0; i < this.dgv.Rows.Count; i++)
            {
                for (int j = 0; j < 8; j++)
                {
                    if (this.dgv.Rows[i].Cells[j].Value.ToString() == "")
                    {
                        MessageBox.Show("���Ϊ" + this.dgv.Rows[i].Cells[1].Value + "����Աȱ��" + this.dgv.Columns[j].Name.ToString() + "��Ϣ������д���������������ļ���", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
                    if (this.dgv.Rows[i].Cells[j].Value.ToString().IndexOf(";") >= 0 | this.dgv.Rows[i].Cells[j].Value.ToString().IndexOf(" ") >= 0 | this.dgv.Rows[i].Cells[j].Value.ToString().IndexOf("    ") >= 0)
                    {
                        MessageBox.Show("���Ϊ" + this.dgv.Rows[i].Cells[1].Value + "����Ա" + this.dgv.Columns[j].Name.ToString() + "��Ϣ������пո񡢷ֺš��Ʊ���Ȳ��Ϸ��ַ�����������д!", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
                }
            }

            bool IsBlank = false;
            DataGridViewRowCollection dgvrc = dgv.Rows;
            foreach (DataGridViewRow dgvr in dgvrc)
            {
                foreach (DataGridViewCell dgvc in dgvr.Cells)
                {
                    if (dgvc.Value == null)
                    {
                        IsBlank = true;
                        break;
                    }
                }
            }

            if (IsBlank)
            {
                MessageBox.Show("��Ա��Ϣ�б����пհ׵ı������Կհ׵ı�������б༭��", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            #endregion

            #region ��������Ա��Ϣ�ļ���
            MyDataTable MDT = new MyDataTable(DO.ReturnDataSet_ExcuteSQL("select  distinct MineNO,(MineNO+PersonCardNO) PersonCardNO,PersonName,IDCard,WorkType,DeptName,WorkPlace,substring(convert(varchar(20),birthday,120),1,10) birthday,sex,bloodtype,schoolrecord,marrystate,CellPhoneNO,HomeAddress,WorkTypeNO,case when WorkTypeValidityDate IS NULL THEN '' else substring(convert(varchar(20),WorkTypeValidityDate,120),1,10) end as WorkTypeValidityDate from parameter_Person").Tables[0], DateTime.Now.ToString("yyyyMMddHHmmss"), "RYXX", "D:\\Location");
            SetFormMainListBoxMsg(MDT.returnStr);

            try
            {
                //ɾ����ʷ�켣��Ϣ����������һ��
                //DO.ReturnDataSet_ExcuteSQL(" delete from Parameter_TrackPoints");
            }
            catch
            { }

            MessageBox.Show("��Ա��Ϣ�ļ����ɳɹ�", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            isUseClose = true;

            #endregion
        }
Example #2
0
        private void btnLJSC_Click(object sender, EventArgs e)
        {
            #region [��֤��Ϣ]
            bool IsBlank = false;
            DataGridViewRowCollection dgvrc = dgvAreaInfo.Rows;
            foreach (DataGridViewRow dgvr in dgvrc)
            {
                foreach (DataGridViewCell dgvc in dgvr.Cells)
                {
                    if (dgvc.Value == null)
                    {
                        IsBlank = true;
                        break;
                    }
                }
            }
            for (int i = 0; i < this.dgvAreaInfo.Rows.Count; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    if (this.dgvAreaInfo.Rows[i].Cells[j].Value.ToString() == "")
                    {
                        MessageBox.Show(this.dgvAreaInfo.Rows[i].Cells[0].Value + " ����Ϣ������������д���������������ļ���", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
                    if (this.dgvAreaInfo.Rows[i].Cells["������"].Value.ToString().Length != 13)
                    {
                        MessageBox.Show(this.dgvAreaInfo.Rows[i].Cells[0].Value + " �ķ�վ���벻��ȷ������д���������������ļ���", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
                }
            }
            if (IsBlank)
            {
                MessageBox.Show("������Ϣ�б����пհ׵ı������Կհ׵ı�������б༭��", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            #endregion

            #region [�޸���Ϣ]

            DataTable dt = DS.Tables[0].GetChanges();//strTerName.GetHashCode()
            int iTempCount = DS.Tables[0].Rows.Count;
            if (dt != null || IAreacount != iTempCount)
            {
                DataTable dt1 = DS.Tables[0];
                DO.ReturnInt_ExcuteSQL("delete from parameter_Area");
                DO.ReturnInt_ExcuteSQL("delete from Territorial_Info ");
                DO.ReturnInt_ExcuteSQL("delete from Territorial_Set ");
                DO.ReturnInt_ExcuteSQL("delete from Territorial_Config ");
                foreach (DataRow dr1 in dt1.Rows)
                {
                    if (DO.ReturnInt_ExcuteSQL("insert into Parameter_Area(MineNO,AreaNO,AreaName,AreaType,AreaCheckPersonCount) values('" + dr1["������"].ToString().Substring(0, 11) + "','" + dr1["������"].ToString().Substring(11) + "','" + dr1["��������"] + "','" + dr1["��������"] + "'," + dr1["����˶�����"] + ")") <= 0)
                    {
                        MessageBox.Show("�Ѿ�������ͬ����������!", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
                }

                foreach (DataRow dr1 in dt1.Rows)
                {
                    int areaTypeID = SetAreaTypeID(dr1["��������"].ToString().Trim());

                    DO.ReturnInt_ExcuteSQL("insert into Territorial_Info (TerritorialID,TerritorialName,TerritorialTypeID, IsEnable, Instruction,Remark,TerritorialNO) "
                                        + " values(" + dr1["��������"].ToString().GetHashCode() + ",'" + dr1["��������"].ToString() + "'," + areaTypeID + ",1,'','','" + dr1["������"].ToString().Substring(11) + "')");

                    //ͬ����������

                    DO.ReturnInt_ExcuteSQL("insert into Territorial_Config (TerConfigID ,TerritorialID,TerWorkTime,TerEmpCount) values(" + dr1["��������"].ToString().GetHashCode()
                        + "," + dr1["��������"].ToString().GetHashCode() + ",-1," + dr1["����˶�����"] + ")");

                }

                foreach (DataRow dr1 in DT_Before.Rows)
                {
                    if (dr1["�޸ĺ���������"].ToString().Trim() != "")
                    {
                        DO.ReturnInt_ExcuteSQL(" update Parameter_Area_Station set AreaNO= '" + dr1["�޸ĺ�������"].ToString() + "',AreaName='" + dr1["�޸ĺ���������"].ToString() + "'  where AreaName ='" + dr1["��������"].ToString() + "'");
                    }

                }

                //ɾ�������վ���ñ����Ѿ�ɾ��������
                DO.ReturnDataSet_ExcuteSQL(" delete from Parameter_Area_Station where AreaName not in ( select AreaName from Parameter_Area)");
            }
            #endregion

            #region [������Ϣ]

            DataSet ds = DO.ReturnDataSet_ExcuteSQL("select MineNO,AreaType,(MineNO+AreaNO) AreaNO,AreaCheckPersonCount,AreaName from parameter_Area");
            if (ds.Tables[0].Rows.Count == 0)
            {
                MessageBox.Show("��������ϢҪ���ɣ�", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            MyDataTable MDT = new MyDataTable(ds.Tables[0], DateTime.Now.ToString("yyyyMMddHHmmss"), "RYQY", "D:\\Location");
            SetFormMainListBoxMsg(MDT.returnStr);

            try
            {
                //ɾ����ʷ�켣��Ϣ����������һ��
                // DO.ReturnDataSet_ExcuteSQL(" delete from Parameter_TrackPoints");
            }
            catch
            { }

            MessageBox.Show("������Ϣ���ɳɹ�", " ", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);

            isUseClose = true;
            #endregion
        }
Example #3
0
        public void GetProcessFile()
        {
            DataTable DT = null;
            DataBase DB = new DataBase();
            DT = DB.ExcuteProcedure("DataProduct_KJ128N_Shanxi_Process");

            MyDataTable MYDT = new MyDataTable(DT, DateTime.Now.ToString("yyyyMMddHHmmss"), "process", FilePath);
            if (txtShow.Lines.Length > 27)
            {
                txtShow.Text = "";
                txtShow.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "  ������������ ʵʱ���������ļ�" + Environment.NewLine;
            }
            else
            {
                txtShow.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "  ������������ ʵʱ���������ļ�" + Environment.NewLine;
            }
        }
Example #4
0
        private void btnLJSC_Click(object sender, EventArgs e)
        {
            if (DO.ReturnDataSet_ExcuteSQL("select distinct PSWTL.MineNO,(PS.MineNO+PS.PersonCardNO) PersonCard,PSWTL.PersonName,PSWTL.WorkType,AllPointNOTime from parameter_SpecialWork_TrackLine PSWTL left join parameter_Person PS on convert(int,ps.PersonCardNO)=PSWTL.PersonCardNO").Tables[0].Rows.Count == 0)
            {
                MessageBox.Show("û������������ҵ��ԱԤ��·����Ϣ,��˲���Ҫ�����ļ�!", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                isUseClose = true;
                return;
            }

            MyDataTable MDT = new MyDataTable(DO.ReturnDataSet_ExcuteSQL("select distinct PSWTL.MineNO,(PS.MineNO+PS.PersonCardNO) PersonCard,PSWTL.PersonName,PSWTL.WorkType,AllPointNOTime from parameter_SpecialWork_TrackLine PSWTL left join parameter_Person PS on convert(int,ps.PersonCardNO)=PSWTL.PersonCardNO").Tables[0], DateTime.Now.ToString("yyyyMMddHHmmss"), "RYLXYS", "D:\\Location");
            SetFormMainListBoxMsg(MDT.returnStr);

            MessageBox.Show("������ҵ��ԱԤ��·���ļ����ɳɹ�", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            isUseClose = true;
        }
Example #5
0
        private void btnLJSC_Click(object sender, EventArgs e)
        {
            #region���ж��Ƿ��з�վ��Ϣû��������ȫ��

            for (int i = 0; i < this.dgv.Rows.Count; i++)
            {
                for (int j = 0; j < 8; j++)
                {
                    if (this.dgv.Rows[i].Cells[j].Value.ToString() == "")
                    {
                        MessageBox.Show("˳��Ϊ" + this.dgv.Rows[i].Cells[0].Value + "�ķ�վ��Ϣ������������д���������������ļ���", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
                    if (this.dgv.Rows[i].Cells["��վ����"].Value.ToString().Length != 16)
                    {
                        MessageBox.Show("˳��Ϊ" + this.dgv.Rows[i].Cells[0].Value + "�ķ�վ�������ò���ȷ������д���������������ļ���", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }

                }
            }

            #endregion

            #region ���޸���Ϣ�����ݿ⡿

            //foreach (DataRow dr1 in DT_Before.Rows)
            //{
            //    DO.ReturnInt_ExcuteSQL("update Station_Head_Info set StationHeadNO= '" + dr1["��վ���"].ToString() + "', StationHeadPlace='" + dr1["��վλ��"].ToString() + "'  where SelfNO= " + dr1["˳��"].ToString());
            //}

            //DO.ReturnInt_ExcuteSQL(" TRUNCATE TABLE Parameter_Station ");
            //Thread.Sleep(500);
            //DO.ReturnInt_ExcuteSQL(" TRUNCATE TABLE  Parameter_Area_Station ");
            //Thread.Sleep(500);

            //foreach (DataRow dr1 in DS_Show.Tables[0].Rows)
            //{
            //    DO.ReturnInt_ExcuteSQL("insert into  Parameter_Station( MineNO, SerialNumber, Type, StationNO, StationName, X, Y, CoordinateRemark) values ('"
            //        + str_MineNO + "'," + dr1["˳��"].ToString() + ",'" + dr1["����"].ToString() + "','"
            //        + dr1["StationNO"].ToString() + "','" + dr1["��ϵͳ��վ"].ToString() + "','" + dr1["X����"].ToString() + "','"
            //        + dr1["Y����"].ToString() + "','" + dr1["�����"].ToString() + "')");

            //    DO.ReturnInt_ExcuteSQL(" insert into  Parameter_Area_Station ( MineNO, AreaNO, AreaName, StationNO, StationName ) values ('" + str_MineNO + "','"
            //        + dr1["AreaNO"].ToString() + "','" + dr1["��������"].ToString() + "','" + dr1["StationNO"].ToString() + "','" + dr1["��ϵͳ��վ"].ToString() + "')");
            //}
            //Thread.Sleep(1000);
            #endregion

            try
            {
                #region ���޸����������⹤�ֵķ�վ��Ϣ��

                //DO.ReturnInt_ExcuteSQL("update Parameter_SpecialWork_RTStnHead set RTStationNO=SHI.StationHeadNO,RTStationName=SHI.StationHeadAddress from Station_Head_Info SHI where StnHeadID=SHI.StationHeadID");

                //DO.ReturnInt_ExcuteSQL("update Parameter_SpecialWT_Exception set CheckReachStationNO=SHI.StationHeadNO,CheckReachStationName=SHI.StationHeadAddress from Station_Head_Info SHI where CheckReachStnHeadID=SHI.StationHeadID ");

                //DataTable dt_Point = DO.ReturnDataSet_ExcuteSQL("select distinct EmpID,AllPointNameTime from Parameter_SpecialWork_TrackLine").Tables[0];

                //DataTable dt_StnName = DO.ReturnDataSet_ExcuteSQL("select distinct StnHeadID, StationName, '���' as NewStnName  from Parameter_SpecialWork_TrackLine").Tables[0];

                //DataTable dt_Stn = DO.ReturnDataSet_ExcuteSQL("select StationHeadID, StationHeadPlace from Station_Head_Info where StationHeadID in (select distinct StnHeadID from Parameter_SpecialWork_TrackLine)").Tables[0];

                //if (dt_Point.Rows.Count > 0)
                //{
                //    //��÷�վ�µ�λ��
                //    for (int i = 0; i < dt_StnName.Rows.Count; i++)
                //    {
                //        foreach (DataRow dr_s in dt_Stn.Rows)
                //        {
                //            if (dt_StnName.Rows[i]["StnHeadID"].ToString() == dr_s["StationHeadID"].ToString())
                //            {
                //                dt_StnName.Rows[i]["NewStnName"] = dr_s["StationHeadPlace"].ToString();
                //            }

                //        }
                //    }
                //    //����·�߷�վλ��
                //    for (int i = 0; i < dt_Point.Rows.Count; i++)
                //    {
                //        foreach (DataRow dr_n in dt_StnName.Rows)
                //        {
                //            dt_Point.Rows[i]["AllPointNameTime"] = dt_Point.Rows[i]["AllPointNameTime"].ToString().Replace(dr_n["StationName"].ToString(), dr_n["NewStnName"].ToString());
                //        }
                //    }

                //    DO.ReturnInt_ExcuteSQL(" update Parameter_SpecialWork_TrackLine set StationNO=SHI.StationHeadNO,StationName=SHI.StationHeadPlace  from Station_Head_Info SHI where StnHeadID=SHI.StationHeadID");

                //    foreach (DataRow dr_p in dt_Point.Rows)
                //    {
                //        DO.ReturnInt_ExcuteSQL(" update Parameter_SpecialWork_TrackLine set AllPointNameTime= '" + dr_p["AllPointNameTime"].ToString()
                //            + "' where EmpID= " + dr_p["EmpID"].ToString());
                //    }

                //}
                #endregion
            }
            catch
            { }

            string sql =
                      "SELECT  PS.MineNO ,																		  "
                    + "        ( PAS.MineNO + PAS.AreaNO + PAS.StationNO ) StationNO ,							  "
                    + "        PAS.StationName ,																	  "
                    + "        PS.CoordinateRemark																  "
                    + "FROM    Parameter_Station PS																  "
                    + "        LEFT JOIN Parameter_Area_Station PAS ON PS.StationName = PAS.StationName			  ";

            MyDataTable MDT = new MyDataTable(DO.ReturnDataSet_ExcuteSQL(sql).Tables[0], DateTime.Now.ToString("yyyMMddHHmmss"), "RYFZ", "D:\\Location");
            //MyDataTable MDT = new MyDataTable(DO.ReturnDataSet_ExcuteSQL("select PS.MineNO,PS.SerialNumber,PS.Type,(PAS.MineNO+PAS.AreaNO+PAS.StationNO) StationNO,PAS.StationName,PS.X,PS.Y,PS.CoordinateRemark from Parameter_Station PS left join Parameter_Area_Station PAS on PS.StationName=PAS.StationName").Tables[0], DateTime.Now.ToString("yyyMMddHHmmss"), "RYFZ", "D:\\Location");
            SetFormMainListBoxMsg(MDT.returnStr);

            try
            {
                //ɾ����ʷ�켣��Ϣ����������һ��
                FormMain.IsCzltCreate = false;
                //DO.ReturnDataSet_ExcuteSQL(" TRUNCATE TABLE   Parameter_TrackPoints");
                //Thread.Sleep(100);

                //Czlt-2011-07-10 ���վ�켣���в���켣����
                //DO.ReturnDataSet_ExcuteSQL(" declare @myCodeSenderAddress int declare @InStationHeadTime datetime  declare @StationHeadPlace varchar(50)  declare @stationHeadID int   declare @StationNO varchar(20)  declare @TempStationNO VARCHAR(50)  declare @AreaCheckPersonCount int  declare @RealCount int declare @AreaNo varchar(30) DECLARE @MineNO VARCHAR(30)  declare MyCursor_SSGC cursor  for    select CodeSenderAddress,StationHeadTime,shi.StationHeadPlace,PAS.AreaNO,PAS.MineNO from rt_InStationHeadInfo rtishi  left join Station_Head_Info shi on rtishi.StationHeadID = shi.StationHeadID  left join Parameter_Person PP on rtishi.CodeSenderAddress = convert(int,PP.PersonCardNO)  left join Parameter_Area_Station PAS on shi.StationHeadPlace=PAS.StationName  where  rtishi.cstypeid=0  open MyCursor_SSGC fetch next from MyCursor_SSGC into @MyCodeSenderAddress,@InStationHeadTime,@StationHeadPlace,@AreaNO,@MineNO  while @@fetch_status = 0  begin select @StationNO = StationNO from Parameter_Area_Station where StationName= @StationHeadPlace if not exists(select 1 from Parameter_TrackPoints where CodeSenderAddress = @myCodeSenderAddress)  begin insert into Parameter_TrackPoints(CodeSenderAddress,TrackPoints,LastStationNO)  values(@myCodeSenderAddress,(@MineNO+@AreaNO+@StationNO)+'&'+replace(convert(varchar(20),@InStationHeadTime,120),' ','/'),@StationHeadPlace)  end  else  begin  select @TempStationNO = LastStationNO from Parameter_TrackPoints where CodeSenderAddress = @myCodeSenderAddress if(@TempStationNO<>@StationHeadPlace)   BEGIN  update Parameter_TrackPoints set TrackPoints = TrackPoints+','+(@MineNO+@AreaNO+@StationNO)+'&'+replace(convert(varchar(20),@InStationHeadTime,120),' ','/'),LastStationNO = @StationHeadPlace  where CodeSenderAddress = @myCodeSenderAddress  END end fetch next from MyCursor_SSGC into @MyCodeSenderAddress,@InStationHeadTime,@StationHeadPlace,@AreaNO,@MineNO   end CLOSE MyCursor_SSGC  DEALLOCATE MyCursor_SSGC");
                DO.ReturnDataSet_ExcuteSQL(" if exists (select * from sysobjects where [name]='Czlt_RT_InSHInfo') 	drop table Czlt_RT_InSHInfo ");
                DO.ReturnDataSet_ExcuteSQL(" declare @myCodeSenderAddress int declare @InStationHeadTime datetime  declare @StationHeadPlace varchar(50)  declare @StationNO varchar(20)  declare @TempStationNO VARCHAR(50)  declare @index int    declare @RealCount int    declare @AreaNO varchar(30)    DECLARE @MineNO VARCHAR(30) select ID=IDEntity(int,1,1),* into Czlt_RT_InSHInfo from ( select CodeSenderAddress,StationHeadTime,shi.StationHeadPlace,PAS.AreaNO,PAS.MineNO from rt_InStationHeadInfo rtishi  left join Station_Head_Info shi on rtishi.StationHeadID = shi.StationHeadID  left join Parameter_Person PP on rtishi.CodeSenderAddress = convert(int,PP.PersonCardNO)  left join Parameter_Area_Station PAS on shi.StationHeadPlace=PAS.StationName  where  rtishi.cstypeid=0  ) dd select @RealCount=count(ID) from Czlt_RT_InSHInfo set @index = 1 while @index <=@RealCount begin  	 select @MyCodeSenderAddress=CodeSenderAddress,@InStationHeadTime=StationHeadTime, 	@StationHeadPlace=StationHeadPlace,@AreaNO=AreaNO,@MineNO=mineno from Czlt_RT_InSHInfo where ID=@index 	set @index = @index+1 	select @StationNO = StationNO from Parameter_Area_Station  	where StationName= @StationHeadPlace  	if not exists(select 1 from Parameter_TrackPoints where CodeSenderAddress = @myCodeSenderAddress)   	begin  		insert into Parameter_TrackPoints(CodeSenderAddress,TrackPoints,LastStationNO)  		values(@myCodeSenderAddress,(@MineNO+@AreaNO+@StationNO)+'&'+replace(convert(varchar(20),@InStationHeadTime,120),' ','/'),@StationHeadPlace)  	end  	else  	begin  	select @TempStationNO = LastStationNO from Parameter_TrackPoints 	where CodeSenderAddress = @myCodeSenderAddress 	if(@TempStationNO<>@StationHeadPlace)   		BEGIN  		update Parameter_TrackPoints set TrackPoints = TrackPoints+','+(@MineNO+@AreaNO+@StationNO)+'&'+replace(convert(varchar(20),@InStationHeadTime,120),' ','/'),LastStationNO = @StationHeadPlace  		where CodeSenderAddress = @myCodeSenderAddress  		END 	end end ");
                //Czlt-2011-07-29 �ϲ��޸� -ע��
                // DO.ReturnDataSet_ExcuteSQL(" select ID=IDEntity(int,1,1),* into Czlt_RT_InSHInfo from ( select CodeSenderAddress,StationHeadTime,shi.StationHeadPlace,PAS.AreaNO,PAS.MineNO from rt_InStationHeadInfo rtishi  left join Station_Head_Info shi on rtishi.StationHeadID = shi.StationHeadID  left join Parameter_Person PP on rtishi.CodeSenderAddress = convert(int,PP.PersonCardNO)  left join Parameter_Area_Station PAS on shi.StationHeadPlace=PAS.StationName  where  rtishi.cstypeid=0  ) dd   insert into Parameter_TrackPoints(CodeSenderAddress,TrackPoints,LastStationNO)  select * from (select cz.CodeSenderAddress,(cz.MineNO+cz.AreaNO+pas.StationNO)+'&'+		replace(convert(varchar(20),cz.StationHeadTime,120),' ','/') as TrackPoints,	cz.StationHeadPlace from Czlt_RT_InSHInfo cz join Parameter_Area_Station pas on cz.StationHeadPlace=pas.StationName) a");

                Thread.Sleep(6000);
                FormMain.IsCzltCreate = true;
            }
            catch
            { }

            MessageBox.Show("���ɷ�վ�ļ��ɹ���", " ", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);

            isUseClose = true;
        }
Example #6
0
        private void btnLJSC_Click(object sender, EventArgs e)
        {
            #region [��֤���ݸ�ʽ�Ƿ���ȷ]
            if (lblMineNO.Text == "")
            {
                MessageBox.Show("ú����벻��Ϊ�գ����ȱ༭ú����룡", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            Control.ControlCollection cc = this.groupBox1.Controls;
            foreach (Control C in cc)
            {

                C.Text = SBCcaseAndDBCcase.ConvertSBCcaseToDBCcase(C.Text);

                if (C.Name != null & C.Name != "txtRemark" & C.Name != "txtSafeProductLicence_NOC")
                {
                    #region

                    if (C.Name.IndexOf("txt") >= 0)
                    {
                        //�˴���֤�Ƿ��ַ������룬��Unicode��������֤��������޸�
                        byte[] b = Encoding.Unicode.GetBytes(C.Text);
                        for (int i = 0; i < b.Length; i = i + 2)
                        {
                            if (Int32.Parse(b[i + 1].ToString()) * 256 + int.Parse(b[i].ToString()) >= 9472 && Int32.Parse(b[i + 1].ToString()) * 256 + int.Parse(b[i].ToString()) <= 9587)
                            {
                                MessageBox.Show(C.Tag + "������пո񡢷ֺš��Ʊ���Ȳ��Ϸ��ַ�����������д!", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                C.Focus();
                                return;
                            }
                            if (Int32.Parse(b[i + 1].ToString()) * 256 + int.Parse(b[i].ToString()) == 47 ||
                                (Int32.Parse(b[i + 1].ToString()) * 256 + int.Parse(b[i].ToString()) >= 58 && Int32.Parse(b[i + 1].ToString()) * 256 + int.Parse(b[i].ToString()) <= 64) ||
                                (Int32.Parse(b[i + 1].ToString()) * 256 + int.Parse(b[i].ToString()) >= 32 && Int32.Parse(b[i + 1].ToString()) * 256 + int.Parse(b[i].ToString()) <= 34) ||
                                (Int32.Parse(b[i + 1].ToString()) * 256 + int.Parse(b[i].ToString()) >= 36 && Int32.Parse(b[i + 1].ToString()) * 256 + int.Parse(b[i].ToString()) <= 44) ||
                                (Int32.Parse(b[i + 1].ToString()) * 256 + int.Parse(b[i].ToString()) >= 91 && Int32.Parse(b[i + 1].ToString()) * 256 + int.Parse(b[i].ToString()) <= 96) ||
                                (Int32.Parse(b[i + 1].ToString()) * 256 + int.Parse(b[i].ToString()) >= 123 && Int32.Parse(b[i + 1].ToString()) * 256 + int.Parse(b[i].ToString()) <= 255))
                            {
                                MessageBox.Show(C.Tag + "������Ƿ��ַ�!", "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                C.Focus();
                                return;
                            }
                        }

                        if (C.Text.ToString().IndexOf(" ") >= 0 | C.Text.ToString().IndexOf(";") >= 0 | C.Text.ToString().IndexOf(" ") >= 0)
                        {
                            MessageBox.Show(C.Tag + "��д����Ϣ�а����пո񡢷ֺš��Ʊ�Ȳ��Ϸ��ַ�!", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                            C.Focus();
                            return;
                        }
                        else if (C.Text == "")
                        {
                            MessageBox.Show(C.Tag.ToString() + "����Ϊ�գ�", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                            C.Focus();
                            return;
                        }
                        else
                        {
                            if (C.Name.IndexOf("_int") >= 0)
                            {
                                if (!DO.IsNumber(C.Text))
                                {
                                    MessageBox.Show(C.Tag.ToString() + "ֻ��Ϊ���֣�", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                    C.Focus();
                                    return;
                                }
                                if (!IsNumeric(C.Text))
                                {
                                    MessageBox.Show(C.Tag.ToString() + "��������ֲ���Ϊ����", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                    C.Focus();
                                    return;
                                }
                                if (C.Text.IndexOf(".") == 0)
                                {
                                    MessageBox.Show(C.Tag + "�ַ���.������������ڵ�һλ��", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                    C.Focus();
                                    return;
                                }
                                if (C.Tag.ToString().IndexOf("ʱ��") >= 0 & float.Parse(C.Text) > 24)
                                {
                                    MessageBox.Show(C.Tag + "���ܳ���24Сʱ", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                    C.Focus();
                                    return;
                                }
                                if (C.Tag.ToString().IndexOf("IP") >= 0 & float.Parse(C.Text) > 255)
                                {
                                    MessageBox.Show(C.Tag.ToString() + "�е����ֲ��ܳ���255", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                    C.Focus();
                                    return;
                                }
                            }
                            else if (C.Name == "txtDealerLicence_NOC")
                            {
                                if (!CheckNoAndChinese(C.Text))
                                {
                                    MessageBox.Show(C.Tag.ToString() + "�зǷ��ַ���ո����������룡", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                    C.Focus();
                                    return;
                                }
                            }
                        }

                    }

                    #endregion
                }

                else if (C.Name == "txtSafeProductLicence_NOC")
                {
                    #region

                    if (C.Name.IndexOf("txt") >= 0)
                    {
                        //�˴���֤�Ƿ��ַ������룬��Unicode��������֤��������޸�
                        byte[] b = Encoding.Unicode.GetBytes(C.Text);
                        for (int i = 0; i < b.Length; i = i + 2)
                        {
                            if (Int32.Parse(b[i + 1].ToString()) * 256 + int.Parse(b[i].ToString()) >= 9472 && Int32.Parse(b[i + 1].ToString()) * 256 + int.Parse(b[i].ToString()) <= 9587)
                            {
                                MessageBox.Show(C.Tag + "������пո񡢷ֺš��Ʊ���Ȳ��Ϸ��ַ�����������д!", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                C.Focus();
                                return;
                            }
                            if (Int32.Parse(b[i + 1].ToString()) * 256 + int.Parse(b[i].ToString()) == 47 ||
                                (Int32.Parse(b[i + 1].ToString()) * 256 + int.Parse(b[i].ToString()) >= 58 && Int32.Parse(b[i + 1].ToString()) * 256 + int.Parse(b[i].ToString()) <= 64) ||
                                (Int32.Parse(b[i + 1].ToString()) * 256 + int.Parse(b[i].ToString()) >= 32 && Int32.Parse(b[i + 1].ToString()) * 256 + int.Parse(b[i].ToString()) <= 34) ||
                                (Int32.Parse(b[i + 1].ToString()) * 256 + int.Parse(b[i].ToString()) >= 36 && Int32.Parse(b[i + 1].ToString()) * 256 + int.Parse(b[i].ToString()) <= 39) ||
                                (Int32.Parse(b[i + 1].ToString()) * 256 + int.Parse(b[i].ToString()) >= 42 && Int32.Parse(b[i + 1].ToString()) * 256 + int.Parse(b[i].ToString()) <= 44) ||
                                (Int32.Parse(b[i + 1].ToString()) * 256 + int.Parse(b[i].ToString()) >= 94 && Int32.Parse(b[i + 1].ToString()) * 256 + int.Parse(b[i].ToString()) <= 96) ||
                                (Int32.Parse(b[i + 1].ToString()) * 256 + int.Parse(b[i].ToString()) >= 123 && Int32.Parse(b[i + 1].ToString()) * 256 + int.Parse(b[i].ToString()) <= 255))
                            {
                                MessageBox.Show(C.Tag + "������Ƿ��ַ�!", "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                C.Focus();
                                return;
                            }
                        }

                        if (C.Text.ToString().IndexOf(" ") >= 0 | C.Text.ToString().IndexOf(";") >= 0 | C.Text.ToString().IndexOf(" ") >= 0)
                        {
                            MessageBox.Show(C.Tag + "��д����Ϣ�а����пո񡢷ֺš��Ʊ�Ȳ��Ϸ��ַ�!", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                            C.Focus();
                            return;
                        }
                        else if (C.Text == "")
                        {
                            MessageBox.Show(C.Tag.ToString() + "����Ϊ�գ�", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                            C.Focus();
                            return;
                        }
                        else
                        {
                            if (C.Name.IndexOf("_int") >= 0)
                            {
                                if (!DO.IsNumber(C.Text))
                                {
                                    MessageBox.Show(C.Tag.ToString() + "ֻ��Ϊ���֣�", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                    C.Focus();
                                    return;
                                }
                                if (!IsNumeric(C.Text))
                                {
                                    MessageBox.Show(C.Tag.ToString() + "��������ֲ���Ϊ����", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                    C.Focus();
                                    return;
                                }
                                if (C.Text.IndexOf(".") == 0)
                                {
                                    MessageBox.Show(C.Tag + "�ַ���.������������ڵ�һλ��", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                    C.Focus();
                                    return;
                                }
                                if (C.Tag.ToString().IndexOf("ʱ��") >= 0 & float.Parse(C.Text) > 24)
                                {
                                    MessageBox.Show(C.Tag + "���ܳ���24Сʱ", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                    C.Focus();
                                    return;
                                }
                                if (C.Tag.ToString().IndexOf("IP") >= 0 & float.Parse(C.Text) > 255)
                                {
                                    MessageBox.Show(C.Tag.ToString() + "�е����ֲ��ܳ���255", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                    C.Focus();
                                    return;
                                }
                            }
                            else if (C.Name == "txtDealerLicence_NOC")
                            {
                                if (!CheckNoAndChinese(C.Text))
                                {
                                    MessageBox.Show(C.Tag.ToString() + "�зǷ��ַ���ո����������룡", " ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                    C.Focus();
                                    return;
                                }
                            }
                        }

                    }

                    #endregion
                }
            }
            #endregion

            UpdateMineInfo();//UpDate EnumTable Set EnumValue='" + strEmpCount + "' Where FunID=8 and EnumID=1

            //���Ŀ���Ա����
            int iEmpCount = Convert.ToInt32(txtCheckDownWellPersonCount_int.Text.ToString());
            DO.ReturnDataSet_ExcuteSQL("UpDate EnumTable Set EnumValue='" + iEmpCount.ToString() + "' Where FunID=8 and EnumID=1");

            //����������������������͸��󾮺˶�������ͬ
            DO.ReturnDataSet_ExcuteSQL("update Parameter_Area set AreaCheckPersonCount=" + iEmpCount.ToString() + " where AreaType='��������' or AreaType ='��������'");

            string sql =
                     "SELECT  MineNO ,							"
                    + "        CityName ,						"
                    + "        MineFullName ,					"
                    + "        MineSimpleName ,					"
                    + "        EconomicClass ,					"
                    + "        UndermanagerName ,				"
                    + "        BetterAddress ,					"
                    + "        CheckDownWellPersonCount ,		"
                    + "        Tel ,								"
                    + "        Remark							"
                    + "FROM    dbo.Parameter_Mine				";

            MyDataTable MDT = new MyDataTable(DO.ReturnDataSet_ExcuteSQL(sql).Tables[0], DateTime.Now.ToString("yyyyMMddHHmmss"), "RYMK", "D:\\Location");
            SetFormMainListBoxMsg(MDT.returnStr);
            isUseClose = true;

            try
            {
                //ɾ����ʷ�켣��Ϣ����������һ��
                // DO.ReturnDataSet_ExcuteSQL(" delete from Parameter_TrackPoints");
            }
            catch
            { }

            MessageBox.Show("����ú����Ϣ�ļ��ɹ�", " ", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
        }
Example #7
0
        private void Time5Second_Tick(object sender, EventArgs e)
        {
            try
            {
                //iCount20S++;
                iCount2M++;

                #region��2���Ӷ�ʱ����ʵʱ�����ļ���

                if (iCount2M >= 24)
                {

                    //DO.ReturnDataSet_ExcuteSQL("update Station_Head_Info set StationHeadNO=selfno");
                    if (DO.ReturnDataSet_ExcuteSQL("exec proc_SXLW_SSGC_Select").Tables[0].Rows.Count > 0)
                    {

                        //ʵʱ�����ļ�----ʱ���+RYSS
                        MyDataTable MDT = new MyDataTable(DO.ReturnDataSet_ExcuteSQL("exec proc_SXLW_SSGC").Tables[0], DateTime.Now.ToString("yyyyMMddHHmmss"), "RYSS", "D:\\Location");
                        SetFormMainListBoxMsg(MDT.returnStr);
                        intProcdutCount++;
                        //lblResult.Text = "��ǰ������Ѿ�����ʵʱ�ļ� [ " + intProcdutCount.ToString() + " ] ��";
                    }
                    else
                    {
                        MyDataTable MDT = new MyDataTable(new DataTable(), DateTime.Now.ToString("yyyyMMddHHmmss"), "RYSS", "D:\\Location");
                        intProcdutCount++;
                        SetFormMainListBoxMsg(MDT.returnStr);
                    }
                    iCount2M = 0;
                }
                #endregion

                #region���жϻ�����Ϣ�Ƿ��Ѿ�������ȫ��

                try
                {
                    DO.ReturnDataSet_ExcuteSQL(" declare @MineNOss varchar(30) set @MineNOss=(select distinct( MineNO) from Parameter_Mine) update  Parameter_OverEmployee set MineNO =@MineNOss "
                                                + " update  Parameter_RT_OverTime set MineNO=@MineNOss update  Parameter_SpecialWT_Exception set MineNO=@MineNOss  "
                                                + " update  Parameter_Station_Break set MineNO=@MineNOss update Parameter_TrackLine set MineNO=@MineNOss ");
                    //if (FindFormByName())
                    //{
                    //    return;       //�������ÿ���Ϣ���ݲ�����ʵʱ�ļ�
                    //}

                    dsTemp = DO.ReturnDataSet_ExcuteSQL(" SELECT MineFullName FROM  Parameter_Mine "
                                                    + " SELECT AreaNO from Parameter_Area where AreaNO IS NOT NULL "
                                                    + " SELECT StationName AS ��ϵͳ��վ FROM  Parameter_Station  WHERE  StationNO=NULL OR  StationName NOT IN(SELECT StationName FROM  Parameter_Area_Station ) "
                                                    + " UNION  ALL SELECT StationHeadPlace  AS ��ϵͳ��վ FROM  Station_Head_Info WHERE SelfNO NOT IN (SELECT SerialNumber FROM  Parameter_Station  ) "
                                                    + " SELECT  PersonName FROM dbo.Parameter_Person WHERE  MineNO='' OR  IDCard ='' OR WorkPlace='' OR WorkType=''  OR birthDay IS NULL ");

                    if (dsTemp.Tables[0].Rows.Count < 1 || dsTemp.Tables[0].Rows[0][0].ToString() == "")
                    {
                        if (isMine == false)
                        {
                            Err myErr = new Err(" δ¼�����Ϣ������¼�����Ϣ��--��ʼʱ��" + DateTime.Now.ToString("yyyy-MM-dd HH:ss:mm"));
                            isMine = true;
                            MessageBox.Show("δ¼�����Ϣ������¼�����Ϣ��", "��ʾ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                        // return;
                    }
                    else
                    {
                        isMine = false;
                    }

                    if (dsTemp.Tables[1].Rows.Count < 1)
                    {
                        if (isArea == false)
                        {
                            Err myErr = new Err(" δ����������Ϣ��������������Ϣ��--��ʼʱ��" + DateTime.Now.ToString("yyyy-MM-dd HH:ss:mm"));
                            isArea = true;
                            MessageBox.Show("δ����������Ϣ��������������Ϣ��", "��ʾ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                        // return;
                    }
                    else
                    {
                        isArea = false;
                    }

                    if (dsTemp.Tables[2].Rows.Count > 0)
                    {
                        if (isStat == false)
                        {
                            Err myErr = new Err(" ��վ��Ϣ���ò�ȫ�������÷�վ��Ϣ��--��ʼʱ��" + DateTime.Now.ToString("yyyy-MM-dd HH:ss:mm"));
                            isStat = true;
                            MessageBox.Show(" ��վ��Ϣ���ò�ȫ�������÷�վ��Ϣ��", "��ʾ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                        //return;
                    }
                    else
                    {
                        isStat = false;
                    }

                    if (dsTemp.Tables[3].Rows.Count > 0)
                    {

                        if (isPeople == false)
                        {
                            Err myErr = new Err(" ��Ա��Ϣ���ò�ȫ����������Ա��Ϣ��--��ʼʱ��" + DateTime.Now.ToString("yyyy-MM-dd HH:ss:mm"));/////
                            isPeople = true;
                            MessageBox.Show("��Ա��Ϣ���ò�ȫ����������Ա��Ϣ��", "��ʾ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                        // return;
                    }
                    else
                    {
                        isPeople = false;
                    }

                }
                catch
                {
                    Err myErr = new Err("����ʵʱ����ǰ�жϴ���");
                }
                #endregion

                DO.ReturnDataSet_ExcuteSQL(" Proc_SXLW_GZYC_ADD ");

                DO.ReturnDataSet_ExcuteSQL(" IF EXISTS( SELECT 1 FROM Parameter_SpecialWT_Exception WHERE  DATEDIFF(ss, CheckReachStationTime,GETDATE()) >0 and DATEDIFF(ss, CheckReachStationTime,GETDATE()) <6 ) "
            + " BEGIN update  Parameter_SpecialWT_Exception SET  IsRead=0 WHERE state='�ٵ�' OR (DATEDIFF(ss, CheckReachStationTime,GETDATE()) >=0 OR state='δ��') END ");

                //5������ϵͳ�����쳣�ļ�

                #region��5������ϵͳ�����쳣�ļ���

                //*******Czlt-2011-07-10**������վ���ϱ���*XTYC-ϵͳ�쳣****************************

                int tempCount = DO.ReturnDataSet_ExcuteSQL("Proc_SXLW_XTYC_Select").Tables[0].Rows.Count;
                if (tempCount > 0)
                {
                    //DataSet dsStnNO = DO.ReturnDataSet_ExcuteSQL(" select StationNO from Parameter_Station_Break PSB where PSB.IsRead = 0  order by StationNO ");
                    if (_stnLastCount == tempCount)
                    {
                        //ϵͳ�����쳣�ļ�-----ʱ���+RYYC
                        MyDataTable mt = new MyDataTable(DO.ReturnDataSet_ExcuteSQL("Proc_SXLW_XTYC").Tables[0], DateTime.Now.ToString("yyyyMMddHHmmss"), "RYYC", "D:\\Location");
                        intProcdutCount++;
                        SetFormMainListBoxMsg(mt.returnStr);
                        //lblResult.Text = "��ǰ������Ѿ�����ʵʱ�ļ� [ " + intProcdutCount.ToString() + " ] ��";
                    }
                }
                _stnLastCount = tempCount;

                #endregion

                //20������ʵʱ�ļ�

                #region��5������ʵʱ�ļ���

                //***************Czlt-2011-07-10 ��ʱ��������****************Start****************

                int rtOver = Convert.ToInt32(DO.ReturnDataSet_ExcuteSQL("Select count(1) from Parameter_RT_OverTime where OverTimeEndTime is null").Tables[0].Rows[0][0].ToString());
                if (rtOverTime != rtOver)
                {
                    if (DO.ReturnDataSet_ExcuteSQL("exec Proc_SXLW_SSCS_Select") != null && DO.ReturnDataSet_ExcuteSQL("exec Proc_SXLW_SSCS_Select").Tables.Count > 0)
                    {
                        if (DO.ReturnDataSet_ExcuteSQL("exec Proc_SXLW_SSCS_Select").Tables[0].Rows.Count > 0)
                        {
                            //��ʱ�����ļ�-----ʱ���+RYSC

                            MyDataTable MYT = new MyDataTable(DO.ReturnDataSet_ExcuteSQL("exec Proc_SXLW_SSCS").Tables[0], DateTime.Now.ToString("yyyyMMddHHmmss"), "RYCS", "D:\\Location");
                            intProcdutCount++;
                            SetFormMainListBoxMsg(MYT.returnStr);
                            //lblResult.Text = "��ǰ������Ѿ�����ʵʱ�ļ� [ " + intProcdutCount.ToString() + " ] ��";
                        }

                    }
                    rtOverTime = rtOver;
                }

                //***************Czlt-2011-07-10 ��ʱ��������****************End******************

                int InOut = Convert.ToInt32(DO.ReturnDataSet_ExcuteSQL("Select count(1) from parameter_OverEmployee where AlarmEndTime is null").Tables[0].Rows[0][0].ToString());
                if (InOut != dtInOutMine)
                {
                    if (DO.ReturnDataSet_ExcuteSQL("exec Proc_SXLW_SSCY_Select").Tables[0].Rows.Count > 0)
                    {

                        //��Ա/�����������򱨾��ļ�-----ʱ���+RYCY

                        MyDataTable mdt = new MyDataTable(DO.ReturnDataSet_ExcuteSQL("exec Proc_SXLW_SSCY").Tables[0], DateTime.Now.ToString("yyyyMMddHHmmss"), "RYCYXZ", "D:\\Location");
                        intProcdutCount++;
                        SetFormMainListBoxMsg(mdt.returnStr);
                        //lblResult.Text = "��ǰ������Ѿ�����ʵʱ�ļ� [ " + intProcdutCount.ToString() + " ] ��";
                    }
                    dtInOutMine = InOut;
                }
                if (DO.ReturnDataSet_ExcuteSQL("exec Proc_SXLW_GZYC_Select").Tables[0].Rows.Count > 0)
                {
                    //������ҵ��Ա�����쳣-----ʱ���+RYTZ
                    MyDataTable md = new MyDataTable(DO.ReturnDataSet_ExcuteSQL("exec Proc_SXLW_GZYC").Tables[0], DateTime.Now.ToString("yyyyMMddHHmmss"), "RYTZYC", "D:\\Location");
                    intProcdutCount++;
                    SetFormMainListBoxMsg(md.returnStr);
                    //lblResult.Text = "��ǰ������Ѿ�����ʵʱ�ļ� [ " + intProcdutCount.ToString() + " ] ��";
                }

                #endregion
            }
            catch
            {
                //*********************Czlt-2011-05-19 ���ݿ����Ӳ���*Start****************************************
                try
                {
                    strMessage = DO.CheckConIsOpen();
                    lblMessage.Text = strMessage;
                }
                catch
                {
                    lblMessage.Text = "���ݿ������쳣������������Ϣ��";
                    //*******Czlt-2011-05-05 ȡ����¼����********

                    this.MainPanel.Visible = true;

                    IsLogin = true;

                    return;
                }
                //*******************Czlt-2011-05-19 ���ݿ����Ӳ���*End*****************************************
            }
        }