Ejemplo n.º 1
0
        public bool UpdateRecord(Model.Management.Master.SchoolMaster_scm_Info infoObject)
        {
            SchoolMaster_scm tab       = new SchoolMaster_scm();
            bool             isSuccess = false;

            try
            {
                using (VPMSDBDataContext db = new VPMSDBDataContext())
                {
                    tab = db.SchoolMaster_scm.SingleOrDefault(t => t.scm_cNumber == infoObject.scm_cNumber);
                    if (tab != null)
                    {
                        tab.scm_cName     = infoObject.scm_cName;
                        tab.scm_cRemark   = infoObject.scm_cRemark;
                        tab.scm_cLast     = infoObject.scm_cLast;
                        tab.scm_dLastDate = infoObject.scm_dLastDate;
                        //tab=Common.General.SetDataToLingQEntity(tab, infoObject);
                    }
                    db.SubmitChanges();
                    isSuccess = true;
                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
            return(isSuccess);
        }
Ejemplo n.º 2
0
        public bool IsExistRecord(object KeyObject)
        {
            SchoolMaster_scm info = null;

            using (VPMSDBDataContext db = new VPMSDBDataContext())
            {
                info = db.SchoolMaster_scm.SingleOrDefault(t => t.scm_cNumber == KeyObject.ToString().Trim());
                if (info != null)
                {
                    return(true);
                }
            }
            return(false);
        }
Ejemplo n.º 3
0
        public bool InsertRecord(Model.Management.Master.SchoolMaster_scm_Info infoObject)
        {
            SchoolMaster_scm tab       = null;
            bool             isSuccess = false;

            tab = Common.General.CopyObjectValue <SchoolMaster_scm_Info, SchoolMaster_scm>(infoObject);
            try
            {
                using (VPMSDBDataContext db = new VPMSDBDataContext())
                {
                    db.SchoolMaster_scm.InsertOnSubmit(tab);
                    db.SubmitChanges();
                    isSuccess = true;
                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
            return(isSuccess);
        }
Ejemplo n.º 4
0
        public bool DeleteRecord(Model.IModel.IModelObject KeyObject)
        {
            bool             isSuccess = false;
            SchoolMaster_scm tab       = null;

            try {
                using (VPMSDBDataContext db = new VPMSDBDataContext())
                {
                    tab = db.SchoolMaster_scm.SingleOrDefault(t => t.scm_iRecordID == KeyObject.RecordID);
                    if (tab != null)
                    {
                        db.SchoolMaster_scm.DeleteOnSubmit(tab);
                        db.SubmitChanges();
                        isSuccess = true;
                    }
                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
            return(isSuccess);
        }
Ejemplo n.º 5
0
        public Model.Management.Master.SchoolMaster_scm_Info DisplayRecord(Model.IModel.IModelObject KeyObject)
        {
            model.SchoolMaster_scm_Info info = null;
            SchoolMaster_scm            tab  = null;

            try
            {
                using (VPMSDBDataContext db = new VPMSDBDataContext())
                {
                    info = new model.SchoolMaster_scm_Info();
                    tab  = db.SchoolMaster_scm.SingleOrDefault(t => t.scm_iRecordID == (KeyObject as SchoolMaster_scm_Info).RecordID);
                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }

            if (tab != null)
            {
                info = Common.General.CopyObjectValue <SchoolMaster_scm, SchoolMaster_scm_Info>(tab);
            }
            return(info);
        }