Exemplo n.º 1
0
        public bool UpdateRecord(Model.Management.Master.BuildingMaster_bdm_Info infoObject)
        {
            BuildingMaster_bdm tab = new BuildingMaster_bdm();
            bool isSuccess         = false;

            try
            {
                using (VPMSDBDataContext db = new VPMSDBDataContext())
                {
                    tab = db.BuildingMaster_bdms.SingleOrDefault(t => t.bdm_cNumber == infoObject.bdm_cNumber);
                    if (tab != null)
                    {
                        tab.bdm_cName     = infoObject.bdm_cName;
                        tab.bdm_cRemark   = infoObject.bdm_cRemark;
                        tab.bdm_cLast     = infoObject.bdm_cLast;
                        tab.bdm_dLastDate = (infoObject.bdm_dLastDate != null?infoObject.bdm_dLastDate.Value:DateTime.Now);
                    }
                    db.SubmitChanges();
                    isSuccess = true;
                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
            return(isSuccess);
        }
Exemplo n.º 2
0
        public bool IsExistRecord(object KeyObject)
        {
            BuildingMaster_bdm info = null;

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

            tab = Common.General.CopyObjectValue <BuildingMaster_bdm_Info, BuildingMaster_bdm>(infoObject);
            try
            {
                using (VPMSDBDataContext db = new VPMSDBDataContext())
                {
                    db.BuildingMaster_bdms.InsertOnSubmit(tab);
                    db.SubmitChanges();
                    isSuccess = true;
                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
            return(isSuccess);
        }
Exemplo n.º 4
0
        public Model.Management.Master.BuildingMaster_bdm_Info DisplayRecord(Model.IModel.IModelObject KeyObject)
        {
            model.BuildingMaster_bdm_Info info = null;
            BuildingMaster_bdm            tab  = null;

            try
            {
                using (VPMSDBDataContext db = new VPMSDBDataContext())
                {
                    info = new model.BuildingMaster_bdm_Info();
                    tab  = db.BuildingMaster_bdms.SingleOrDefault(t => t.bdm_iRecordID == (KeyObject as BuildingMaster_bdm_Info).bdm_iRecordID);
                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }

            if (tab != null)
            {
                info = Common.General.CopyObjectValue <BuildingMaster_bdm, BuildingMaster_bdm_Info>(tab);
            }
            return(info);
        }
Exemplo n.º 5
0
        public bool DeleteRecord(Model.IModel.IModelObject KeyObject)
        {
            bool Btab = false;
            BuildingMaster_bdm tab = null;

            try
            {
                using (VPMSDBDataContext db = new VPMSDBDataContext())
                {
                    tab = db.BuildingMaster_bdms.SingleOrDefault(t => t.bdm_iRecordID == KeyObject.RecordID);
                    if (tab != null)
                    {
                        db.BuildingMaster_bdms.DeleteOnSubmit(tab);
                        db.SubmitChanges();
                        Btab = true;
                    }
                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
            return(Btab);
        }