Exemple #1
0
        private objfin_Departments Select_Obj(IDataReader idr)
        {
            objfin_Departments o = new objfin_Departments();
            bool rtNull          = true;

            if (idr != null)
            {
                while (idr.Read())
                {
                    rtNull = false;
                    if (idr["deptId"] != DBNull.Value)
                    {
                        o.deptId = Convert.ToInt32(idr["deptId"]);
                    }
                    if (idr["deptTitle"] != DBNull.Value)
                    {
                        o.deptTitle = Convert.ToString(idr["deptTitle"]);
                    }
                    if (idr["deptCode"] != DBNull.Value)
                    {
                        o.deptCode = Convert.ToString(idr["deptCode"]);
                    }
                    if (idr["deptDescription"] != DBNull.Value)
                    {
                        o.deptDescription = Convert.ToString(idr["deptDescription"]);
                    }
                }
            }
            if (rtNull)
            {
                o = null;
            }
            return(o);
        }
Exemple #2
0
 public void Update(objfin_Departments i)
 {
     db.Update(i.deptId, i.deptTitle, i.deptCode, i.deptDescription);
 }
Exemple #3
0
 public void Add(objfin_Departments i)
 {
     db.Add(i.deptId, i.deptTitle, i.deptCode, i.deptDescription);
 }