Ejemplo n.º 1
0
        private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (e.RowIndex < 0)
            {
                return;
            }
            exInfo = DAL.ExInfoDataFactory.Construct(exDT.Rows[e.RowIndex]);
            List <DAL.NIChannelSettingData> aiList = new List <DAL.NIChannelSettingData>();

            aiNameList = exInfo.NI9188Mod.Split('|');
            string strSQL = "select * from  NIChannelSetting where ( ";

            foreach (string ai in aiNameList)
            {
                strSQL += "ID=" + ai + " OR ";
            }
            strSQL  = strSQL.Substring(0, strSQL.Length - 4);
            strSQL += ")";
            aidt    = WFNetLib.ADO.SQLServerOP.DataTableSQL(strSQL);
            for (int i = 0; i < aidt.Rows.Count; i++)
            {
                DAL.NIChannelSettingData ai = DAL.NIChannelSettingDataFactory.Construct(aidt.Rows[i]);
                aiList.Add(ai);
            }
            strSQL  = "select * from  ExData where ExID=" + exInfo.ID.ToString();
            exData  = WFNetLib.ADO.SQLServerOP.DataTableSQL(strSQL);
            ExcelEx = new ExcelExport(exData.Rows.Count);
            ExcelEx.ExcelWorkbookCallbackProc = new ExcelExport.ExcelWorkbookCallback(ExcelWorkbookCallbackProc);
            ExcelEx.ExcelExportProc();
        }
Ejemplo n.º 2
0
        public static ExInfoData Construct(DataRow dr)
        {
            ExInfoData data = new ExInfoData();

            try { data.ID = Convert.ToInt32(dr["ID"]); }
            catch { }

            try { data.Title = Convert.ToString(dr["Title"]); }
            catch { }

            try { data.SampleRete = Convert.ToInt32(dr["SampleRete"]); }
            catch { }

            try { data.Samples2Read = Convert.ToInt32(dr["Samples2Read"]); }
            catch { }

            try { data.SaveNS = Convert.ToInt32(dr["SaveNS"]); }
            catch { }

            try { data.ETime = Convert.ToDateTime(dr["ETime"]); }
            catch { }

            try { data.Worker = Convert.ToString(dr["Worker"]); }
            catch { }

            try { data.NI9188Mod = Convert.ToString(dr["NI9188Mod"]); }
            catch { }

            return(data);
        }
Ejemplo n.º 3
0
        public static SqlDataReader ReaderSelect(ExInfoData d)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("select * from ExInfo ");
            return(WFNetLib.ADO.SQLServerOP.ReaderExecuteSQL(sql.ToString()));
        }
Ejemplo n.º 4
0
        public static DataTable DataTableSelect(ExInfoData d)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("select * from ExInfo where ID=");
            sql.Append("");
            sql.Append(d.ID.ToString());
            sql.Append("");
            return(WFNetLib.ADO.SQLServerOP.DataTableSQL(sql.ToString()));
        }
Ejemplo n.º 5
0
        public static int Delete(ExInfoData d)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("delete from ExInfo ");
            sql.Append(" where ID=");
            sql.Append("");
            sql.Append(d.ID.ToString());
            sql.Append("");
            return(WFNetLib.ADO.SQLServerOP.NonQuerySQL(sql.ToString()));
        }
Ejemplo n.º 6
0
        public static int Update(ExInfoData d)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("update ExInfo set ");
            sql.Append("Title=");
            sql.Append("'");
            sql.Append(d.Title.ToString());
            sql.Append("'");
            sql.Append(", ");
            sql.Append("SampleRete=");
            sql.Append("");
            sql.Append(d.SampleRete.ToString());
            sql.Append("");
            sql.Append(", ");
            sql.Append("Samples2Read=");
            sql.Append("");
            sql.Append(d.Samples2Read.ToString());
            sql.Append("");
            sql.Append(", ");
            sql.Append("SaveNS=");
            sql.Append("");
            sql.Append(d.SaveNS.ToString());
            sql.Append("");
            sql.Append(", ");
            sql.Append("ETime=");
            sql.Append("'");
            sql.Append(d.ETime.ToString("yyyy-MM-dd HH:mm:ss"));
            sql.Append("'");
            sql.Append(", ");
            sql.Append("Worker=");
            sql.Append("'");
            sql.Append(d.Worker.ToString());
            sql.Append("'");
            sql.Append(", ");
            sql.Append("NI9188Mod=");
            sql.Append("'");
            sql.Append(d.NI9188Mod.ToString());
            sql.Append("'");
            sql.Append(" where ID=");
            sql.Append("");
            sql.Append(d.ID.ToString()); sql.Append("");

            return(WFNetLib.ADO.SQLServerOP.NonQuerySQL(sql.ToString()));
        }
Ejemplo n.º 7
0
        public static int Insert(ExInfoData d)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("insert into ExInfo (");
            sql.Append("Title, ");
            sql.Append("SampleRete, ");
            sql.Append("Samples2Read, ");
            sql.Append("SaveNS, ");
            sql.Append("ETime, ");
            sql.Append("Worker, ");
            sql.Append("NI9188Mod");
            sql.Append(") values (");
            sql.Append("'");
            sql.Append(d.Title.ToString());
            sql.Append("'");
            sql.Append(", ");
            sql.Append("");
            sql.Append(d.SampleRete.ToString());
            sql.Append("");
            sql.Append(", ");
            sql.Append("");
            sql.Append(d.Samples2Read.ToString());
            sql.Append("");
            sql.Append(", ");
            sql.Append("");
            sql.Append(d.SaveNS.ToString());
            sql.Append("");
            sql.Append(", ");
            sql.Append("'");
            sql.Append(d.ETime.ToString("yyyy-MM-dd HH:mm:ss"));
            sql.Append("'");
            sql.Append(", ");
            sql.Append("'");
            sql.Append(d.Worker.ToString());
            sql.Append("'");
            sql.Append(", ");
            sql.Append("'");
            sql.Append(d.NI9188Mod.ToString());
            sql.Append("'");
            sql.Append(")");
            return(WFNetLib.ADO.SQLServerOP.NonQuerySQL(sql.ToString()));
        }
Ejemplo n.º 8
0
        public static ExInfoData Construct(DataGridView dgv, int rowIndex)
        {
            ExInfoData data = new ExInfoData();

            if (dgv.Rows.Count < rowIndex + 1)
            {
                return(null);
            }

            DataGridViewCellCollection dr = dgv.Rows[rowIndex].Cells;

            if (dr == null)
            {
                return(null);
            }

            try { data.ID = Convert.ToInt32(dr["ID"]); }
            catch { }

            try { data.Title = Convert.ToString(dr["Title"]); }
            catch { }

            try { data.SampleRete = Convert.ToInt32(dr["SampleRete"]); }
            catch { }

            try { data.Samples2Read = Convert.ToInt32(dr["Samples2Read"]); }
            catch { }

            try { data.SaveNS = Convert.ToInt32(dr["SaveNS"]); }
            catch { }

            try { data.ETime = Convert.ToDateTime(dr["ETime"]); }
            catch { }

            try { data.Worker = Convert.ToString(dr["Worker"]); }
            catch { }

            try { data.NI9188Mod = Convert.ToString(dr["NI9188Mod"]); }
            catch { }

            return(data);
        }