Example #1
0
 private void LoadEntity(ScholzJobNo memberinfo, DataRow row)
 {
     memberinfo.id          = Convert.ToInt32(row["id"]);
     memberinfo.jobNo       = row["jobNo"].ToString();
     memberinfo.userName    = row["userName"].ToString();
     memberinfo.SignYear    = row["SignYear"].ToString();
     memberinfo.Dvalid      = row["Dvalid"].ToString();
     memberinfo.Lvalid      = row["Lvalid"].ToString();
     memberinfo.PressureMax = row["PressureMax"].ToString();
     memberinfo.TempMax     = row["TempMax"].ToString();
     memberinfo.DelFlag     = row["DelFlag"] == DBNull.Value?false:Convert.ToBoolean(row["DelFlag"]);
 }
Example #2
0
 private void LoadEntity(ScholzJobNo memberinfo, DataRow row, int id)
 {
     memberinfo.id          = id;
     memberinfo.userName    = row[0].ToString();
     memberinfo.jobNo       = row[1].ToString();
     memberinfo.SignYear    = row[2].ToString();
     memberinfo.Dvalid      = row[3].ToString();
     memberinfo.Lvalid      = row[4].ToString();
     memberinfo.PressureMax = row[5].ToString();
     memberinfo.TempMax     = row[6].ToString();
     memberinfo.DelFlag     = false;
 }
Example #3
0
 private void LoadData()
 {
     scholzJobno             = new ScholzJobNo();
     scholzJobno.userName    = txtUser.Text.Trim();
     scholzJobno.jobNo       = txtJobNo.Text.Trim();
     scholzJobno.SignYear    = txtSignY.Text.Trim();
     scholzJobno.Dvalid      = txtD.Text.Trim();
     scholzJobno.Lvalid      = txtL.Text.Trim();
     scholzJobno.PressureMax = txtP.Text.Trim();
     scholzJobno.TempMax     = txtT.Text.Trim();
     scholzJobno.DelFlag     = false;
     scholzJobno.id          = int.Parse(this.label_id.Text);
 }
Example #4
0
        public int InsertMemberInfo(ScholzJobNo jobno)
        {
            string sql = "INSERT INTO Scholz VALUES (@jobNo,@userName,@SignYear ,@Dvalid,@Lvalid,@PressureMax,@TempMax,@DelFlag)";

            SQLiteParameter[] pms =
            {
                new SQLiteParameter("@jobNo",       jobno.jobNo),
                new SQLiteParameter("@userName",    jobno.userName),
                new SQLiteParameter("@SignYear",    jobno.SignYear),
                new SQLiteParameter("@Dvalid",      jobno.Dvalid),
                new SQLiteParameter("@Lvalid",      jobno.Lvalid),
                new SQLiteParameter("@PressureMax", jobno.PressureMax),
                new SQLiteParameter("@TempMax",     jobno.TempMax),
                new SQLiteParameter("@DelFlag",     jobno.DelFlag)
            };
            return(SQLiteHelper.ExecuteNonQuery(sql, pms));
        }
Example #5
0
        public int ModifyMemberInfobyid(ScholzJobNo jobno, int id)
        {
            string sql = "update Scholz set userName=@userName,jobNo=@jobno,SignYear=@signy,Dvalid=@validD,Lvalid=@validL,PressureMax=@txtP,TempMax=@txtT,DelFlag=@DelFlag where id=@id";

            SQLiteParameter[] pms =
            {
                new SQLiteParameter("@userName", jobno.userName),
                new SQLiteParameter("@jobno",    jobno.jobNo),
                new SQLiteParameter("@signy",    jobno.SignYear),
                new SQLiteParameter("@validD",   jobno.Dvalid),
                new SQLiteParameter("@validL",   jobno.Lvalid),
                new SQLiteParameter("@txtP",     jobno.PressureMax),
                new SQLiteParameter("@txtT",     jobno.TempMax),
                new SQLiteParameter("@DelFlag",  jobno.DelFlag),
                new SQLiteParameter("@id",       id)
            };
            return(SQLiteHelper.ExecuteNonQuery(sql, pms));
        }
Example #6
0
        public List <ScholzJobNo> GetMemberList()
        {
            string             sql  = "select * from Scholz";
            DataTable          da   = SQLiteHelper.ExecteDataTable(sql);
            List <ScholzJobNo> list = null;

            if (da.Rows.Count > 0)
            {
                list = new List <ScholzJobNo>();
                ScholzJobNo memberinfo = null;
                foreach (DataRow row in da.Rows)
                {
                    memberinfo = new ScholzJobNo();
                    LoadEntity(memberinfo, row);
                    list.Add(memberinfo);
                }
            }
            return(list);
        }
Example #7
0
        public List <ScholzJobNo> GetMemberListByUserName(string username)
        {
            string sql = "select * from Scholz where userName=@username";

            DataTable          da   = SQLiteHelper.ExecteDataTable(sql, new SQLiteParameter("@username", username));
            List <ScholzJobNo> list = null;

            if (da.Rows.Count > 0)
            {
                list = new List <ScholzJobNo>();
                ScholzJobNo memberinfo = null;
                foreach (DataRow row in da.Rows)
                {
                    memberinfo = new ScholzJobNo();
                    LoadEntity(memberinfo, row);
                    list.Add(memberinfo);
                }
            }
            return(list);
        }
Example #8
0
        public List <ScholzJobNo> LoadExcel2Datatable(string filePath)
        {
            DataTable          dt   = CommonHelper.ToDataTable(filePath);
            List <ScholzJobNo> list = null;

            if (dt.Rows.Count > 0)
            {
                int id = 1;
                list = new List <ScholzJobNo>();
                ScholzJobNo memberinfo = null;
                foreach (DataRow row in dt.Rows)
                {
                    memberinfo = new ScholzJobNo();
                    LoadEntity(memberinfo, row, id);
                    list.Add(memberinfo);
                    id++;
                }
            }
            return(list);
        }
Example #9
0
 public bool ModifyMemberInfobyid(ScholzJobNo jobno, int id)
 {
     return(dal.ModifyMemberInfobyid(jobno, id) > 0);
 }
Example #10
0
 public bool InsertMemberInfo(ScholzJobNo jobno)
 {
     return(dal.InsertMemberInfo(jobno) > 0);
 }