Exemplo n.º 1
0
        public bool DeleteRecord(Model.IModel.IModelObject KeyObject)
        {
            Sys_FunctionMaster_fum_Info info = null;
            try
            {
                info = KeyObject as Sys_FunctionMaster_fum_Info;
                using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                {
                    Sys_FunctionMaster_fum fum = db.Sys_FunctionMaster_fum.Single<Sys_FunctionMaster_fum>(i => i.fum_iRecordID == info.fum_iRecordID);

                    //for (int i = 0; i < fum.Sys_FormPurview_frps.Count; i++)
                    //{
                    //    Sys_FormPurview_frp sta = fum.Sys_FormPurview_frps[i];
                    //    db.Sys_FormPurview_frps.DeleteOnSubmit(sta);
                    //}

                    db.Sys_FunctionMaster_fum.DeleteOnSubmit(fum);
                    db.SubmitChanges();
                    return true;
                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
        }
Exemplo n.º 2
0
        public Model.SysMaster.Sys_UserMaster_usm_Info DisplayRecord(Model.IModel.IModelObject KeyObject)
        {
            Sys_UserMaster_usm_Info usm = new Sys_UserMaster_usm_Info();
            Sys_UserMaster_usm_Info info = new Sys_UserMaster_usm_Info();
            usm = KeyObject as Sys_UserMaster_usm_Info;
            try
            {

                using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                {
                    IQueryable<Sys_UserMaster_usm> taQuery =
                        (from ta in db.Sys_UserMaster_usm
                         where ta.usm_iRecordID == usm.usm_iRecordID
                         select ta).Take(1);

                    if (taQuery != null)
                    {
                        foreach (Sys_UserMaster_usm t in taQuery)
                        {
                            info = Common.General.CopyObjectValue<Sys_UserMaster_usm, Sys_UserMaster_usm_Info>(t);
                            FindUserRole(info);
                        }
                    }
                    return info;
                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
        }
Exemplo n.º 3
0
        public List<UserCardPair_ucp_Info> AllRecords()
        {
            List<UserCardPair_ucp_Info> listPairInfo = null;
            try
            {
                StringBuilder sbSQL = new StringBuilder();
                sbSQL.AppendLine("SELECT ");
                sbSQL.AppendLine("* FROM UserCardPair_ucp WHERE 1 = 1");
                sbSQL.AppendLine("AND ucp_lIsActive = 1");

                using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                {
                    IEnumerable<UserCardPair_ucp_Info> query = db.ExecuteQuery<UserCardPair_ucp_Info>(sbSQL.ToString(), new object[] { });
                    if (query != null)
                    {
                        listPairInfo = query.ToList<UserCardPair_ucp_Info>();
                    }
                }
            }
            catch (Exception ex)
            {

                throw ex;
            }
            return listPairInfo;
        }
Exemplo n.º 4
0
        public List<MealBookingHistory_mbh_Info> AllRecords()
        {
            List<MealBookingHistory_mbh_Info> listPairInfo = null;
            try
            {
                StringBuilder sbSQL = new StringBuilder();
                sbSQL.AppendLine("SELECT ");
                sbSQL.AppendLine("* FROM MealBookingHistory_mbh WHERE 1 = 1");

                using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                {
                    IEnumerable<MealBookingHistory_mbh_Info> query = db.ExecuteQuery<MealBookingHistory_mbh_Info>(sbSQL.ToString(), new object[] { });
                    if (query != null)
                    {
                        listPairInfo = query.ToList<MealBookingHistory_mbh_Info>();
                    }
                }
            }
            catch (Exception ex)
            {

                throw ex;
            }
            return listPairInfo;
        }
Exemplo n.º 5
0
        public bool DeleteRecord(Model.IModel.IModelObject KeyObject)
        {
            Sys_RoleMaster_rlm_Info info = null;
            try
            {
                info = KeyObject as Sys_RoleMaster_rlm_Info;
                using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                {
                    Sys_RoleMaster_rlm rlm = db.Sys_RoleMaster_rlm.Single<Sys_RoleMaster_rlm>(i => i.rlm_iRecordID == info.rlm_iRecordID);

                    for (int i = 0; i < rlm.Sys_UserRoles_usr.Count; i++)
                    {
                        Sys_UserRoles_usr sta = rlm.Sys_UserRoles_usr[i];
                        db.Sys_UserRoles_usr.DeleteOnSubmit(sta);
                    }

                    db.Sys_RoleMaster_rlm.DeleteOnSubmit(rlm);
                    db.SubmitChanges();
                    return true;
                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
        }
Exemplo n.º 6
0
        public Sys_FormMaster_fom_Info DisplayRecord(Model.IModel.IModelObject KeyObject)
        {
            Sys_FormMaster_fom_Info frm = new Sys_FormMaster_fom_Info();
            Sys_FormMaster_fom_Info info = null;
            frm = KeyObject as Sys_FormMaster_fom_Info;
            try
            {

                using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                {
                    IQueryable<Sys_FormMaster_fom> taQuery =
                        (from ta in db.Sys_FormMaster_fom
                         where ta.fom_iRecordID == frm.fom_iRecordID
                         select ta).Take(1);

                    if (taQuery != null)
                    {
                        foreach (Sys_FormMaster_fom t in taQuery)
                        {
                            info = Common.General.CopyObjectValue<Sys_FormMaster_fom, Sys_FormMaster_fom_Info>(t);
                            FindFormPurview(info);
                        }
                    }
                    return info;
                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
        }
Exemplo n.º 7
0
        public PaymentUDMealState_pms_Info DisplayRecord(IModelObject KeyObject)
        {
            PaymentUDMealState_pms_Info displayInfo = KeyObject as PaymentUDMealState_pms_Info;

            if (displayInfo != null)
            {
                try
                {
                    using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                    {
                        PaymentUDMealState_pms displayData = db.PaymentUDMealState_pms.FirstOrDefault(t => t.pms_cRecordID == displayInfo.pms_cRecordID);

                        if (displayData != null)
                        {
                            displayInfo = Common.General.CopyObjectValue<PaymentUDMealState_pms, PaymentUDMealState_pms_Info>(displayData);
                        }
                    }
                }
                catch (Exception Ex)
                {

                    throw Ex;
                }
            }

            return displayInfo;
        }
Exemplo n.º 8
0
        public ReturnValueInfo DeleteRecord(IModelObject KeyObject)
        {
            ReturnValueInfo returnInfo = new ReturnValueInfo(false);

            PaymentUDMealState_pms_Info deleteInfo = KeyObject as PaymentUDMealState_pms_Info;

            if (deleteInfo != null)
            {
                try
                {
                    using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                    {
                        PaymentUDMealState_pms deleteData = db.PaymentUDMealState_pms.FirstOrDefault(t => t.pms_cRecordID == deleteInfo.pms_cRecordID);

                        if (deleteData != null)
                        {
                            db.PaymentUDMealState_pms.DeleteOnSubmit(deleteData);

                            db.SubmitChanges();

                            returnInfo.boolValue = true;
                        }
                    }
                }
                catch (Exception Ex)
                {

                    returnInfo.messageText = Ex.Message;
                }
            }

            return returnInfo;
        }
Exemplo n.º 9
0
        public List<Sys_UserMaster_usm_Info> SearchRecords(Sys_UserMaster_usm_Info infoObj)
        {
            List<Sys_UserMaster_usm_Info> listReturn = null;

            try
            {
                string strSql = "select * from dbo.Sys_UserMaster_usm where 1=1 ";

                if(infoObj != null)
                {
                    if (!String.IsNullOrEmpty(infoObj.usm_cUserLoginID))
                    {
                        strSql += " and usm_cUserLoginID like %'" + infoObj.usm_cUserLoginID + "'% ";
                    }
                }

                IEnumerable<Sys_UserMaster_usm_Info> infos = null;

                using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                {
                    infos = db.ExecuteQuery<Sys_UserMaster_usm_Info>(strSql, new object[] { });
                    if (infos != null)
                    {
                        listReturn = infos.ToList();
                    }
                }
            }
            catch
            {
                throw;
            }

            return listReturn;
        }
Exemplo n.º 10
0
        public List<BlacklistChangeRecord_blc_Info> AllRecords()
        {
            List<BlacklistChangeRecord_blc_Info> listRecord = null;
            try
            {
                StringBuilder sbSQL = new StringBuilder();
                sbSQL.AppendLine(" SELECT blc_cRecordID,blc_iCardNo,blc_cOperation,blc_cOptReason,blc_lIsFinished,blc_cAdd ");
                sbSQL.AppendLine(" ,blc_dAddDate,blc_dFinishDate,cus_cIdentityNum as IdentityNum ");
                sbSQL.AppendLine(" FROM BlacklistChangeRecord_blc WITH(NOLOCK) ");
                sbSQL.AppendLine(" JOIN UserCardPair_ucp WITH(NOLOCK) ON ucp_iCardNo=blc_iCardNo ");
                sbSQL.AppendLine(" JOIN CardUserMaster_cus WITH(NOLOCK) ON cus_cRecordID=ucp_cCUSID ");
                sbSQL.AppendLine(" WHERE blc_lIsFinished=0 ");

                using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                {
                    IEnumerable<BlacklistChangeRecord_blc_Info> query = db.ExecuteQuery<BlacklistChangeRecord_blc_Info>(sbSQL.ToString(), new object[] { });
                    if (query != null)
                    {
                        listRecord = query.ToList<BlacklistChangeRecord_blc_Info>();
                    }
                }
            }
            catch (Exception ex)
            {

                throw ex;
            }
            return listRecord;
        }
Exemplo n.º 11
0
        public List<CardUserAccountDetail_cuad_Info> AllRecords()
        {
            List<CardUserAccountDetail_cuad_Info> listRecord = null;
            try
            {
                StringBuilder sbSQL = new StringBuilder();
                sbSQL.AppendLine("SELECT ");
                sbSQL.AppendLine("* FROM CardUserAccountDetail_cuad WHERE 1 = 1");

                using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                {
                    IEnumerable<CardUserAccountDetail_cuad_Info> query = db.ExecuteQuery<CardUserAccountDetail_cuad_Info>(sbSQL.ToString(), new object[] { });
                    if (query != null)
                    {
                        listRecord = query.ToList<CardUserAccountDetail_cuad_Info>();
                    }
                }
            }
            catch (Exception ex)
            {

                throw ex;
            }
            return listRecord;
        }
Exemplo n.º 12
0
        public Sys_RoleMaster_rlm_Info DisplayRecord(Model.IModel.IModelObject KeyObject)
        {
            Sys_RoleMaster_rlm_Info rlm = new Sys_RoleMaster_rlm_Info();
            Sys_RoleMaster_rlm_Info info = new Sys_RoleMaster_rlm_Info();
            rlm = KeyObject as Sys_RoleMaster_rlm_Info;
            try
            {

                using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                {
                    IQueryable<Sys_RoleMaster_rlm> taQuery =
                        (from ta in db.Sys_RoleMaster_rlm
                         where ta.rlm_iRecordID == rlm.rlm_iRecordID
                         //orderby dpms.dpm_iRecordID ascending
                         select ta).Take(1);

                    if (taQuery != null)
                    {
                        //foreach (var t in taQuery)
                        foreach (Sys_RoleMaster_rlm t in taQuery)
                        {
                            info = Common.General.CopyObjectValue<Sys_RoleMaster_rlm, Sys_RoleMaster_rlm_Info>(t);
                            FindUserRole(info);
                        }
                    }
                    return info;
                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
        }
Exemplo n.º 13
0
        public List<Model.HHZX.ConsumerDevice.ConsumeMachineMaster_cmm_Info> AllRecords()
        {
            List<ConsumeMachineMaster_cmm_Info> listRecordInfo = null;
            try
            {
                StringBuilder sbSQL = new StringBuilder();
                sbSQL.AppendLine("SELECT TOP");
                sbSQL.AppendLine(Common.DefineConstantValue.ListRecordMaxCount.ToString());
                sbSQL.AppendLine("* FROM ConsumeMachineMaster_cmm WHERE 1 = 1");

                using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                {
                    IEnumerable<ConsumeMachineMaster_cmm_Info> query = db.ExecuteQuery<ConsumeMachineMaster_cmm_Info>(sbSQL.ToString(), new object[] { });
                    if (query != null)
                    {
                        listRecordInfo = query.ToList<ConsumeMachineMaster_cmm_Info>();
                    }
                }
            }
            catch (Exception ex)
            {

                throw ex;
            }
            return listRecordInfo;
        }
Exemplo n.º 14
0
        public Model.HHZX.ConsumerDevice.ConsumeMachineMaster_cmm_Info DisplayRecord(Model.IModel.IModelObject KeyObject)
        {
            ConsumeMachineMaster_cmm_Info resInfo = null;
            try
            {
                ConsumeMachineMaster_cmm_Info infoObject = KeyObject as ConsumeMachineMaster_cmm_Info;
                if (infoObject != null)
                {
                    using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                    {
                        ConsumeMachineMaster_cmm record = db.ConsumeMachineMaster_cmm.Where(x => x.cmm_cRecordID == infoObject.cmm_cRecordID).FirstOrDefault();

                        if (record != null)
                        {
                            resInfo = Common.General.CopyObjectValue<ConsumeMachineMaster_cmm, ConsumeMachineMaster_cmm_Info>(record);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return resInfo;
        }
Exemplo n.º 15
0
 public Model.General.ReturnValueInfo InsertRecord(Model.HHZX.ConsumerDevice.ConsumeMachineMaster_cmm_Info infoObject)
 {
     ReturnValueInfo rvInfo = new ReturnValueInfo();
     try
     {
         if (infoObject != null)
         {
             using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
             {
                 ConsumeMachineMaster_cmm record = Common.General.CopyObjectValue<ConsumeMachineMaster_cmm_Info, ConsumeMachineMaster_cmm>(infoObject);
                 if (record != null)
                 {
                     db.ConsumeMachineMaster_cmm.InsertOnSubmit(record);
                     db.SubmitChanges();
                     rvInfo.boolValue = true;
                     rvInfo.ValueObject = infoObject;
                 }
                 else
                 {
                     rvInfo.messageText = "TransEntity is null";
                 }
             }
         }
         else
         {
             rvInfo.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_E_ObjectNull;
         }
     }
     catch (Exception ex)
     {
         rvInfo.isError = true;
         rvInfo.messageText = ex.Message;
     }
     return rvInfo;
 }
Exemplo n.º 16
0
        public PayRecord_prd_Info DisplayRecord(Model.IModel.IModelObject KeyObject)
        {
            PayRecord_prd_Info showInfo = KeyObject as PayRecord_prd_Info;

            if (showInfo != null)
            {
                try
                {
                    using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                    {
                        PayRecord_prd displayData = db.PayRecord_prd.FirstOrDefault(t => t.prd_cRecordID == showInfo.prd_cRecordID);

                        if (displayData != null)
                        {
                            showInfo = Common.General.CopyObjectValue<PayRecord_prd, PayRecord_prd_Info>(displayData);
                        }
                        else
                        {
                            showInfo = null;
                        }
                    }
                }
                catch (Exception Ex)
                {

                    throw Ex;
                }
            }

            return showInfo;
        }
Exemplo n.º 17
0
        public ReturnValueInfo DeleteRecord(IModelObject KeyObject)
        {
            ReturnValueInfo rvInfo = new ReturnValueInfo();
            DepartmentMaster_dpm_Info searchInfo = KeyObject as DepartmentMaster_dpm_Info;
            if (searchInfo == null)
            {
                rvInfo.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_E_ObjectNull;
                rvInfo.isError = true;
                return rvInfo;
            }
            try
            {
                using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                {
                    List<DepartmentMaster_dpm> listDept = db.DepartmentMaster_dpm.Where(x => x.dpm_RecordID == searchInfo.dpm_RecordID).ToList();

                    if (listDept != null)
                    {
                        db.DepartmentMaster_dpm.DeleteAllOnSubmit(listDept);
                        db.SubmitChanges();
                        rvInfo.boolValue = true;
                    }
                }
            }
            catch (Exception ex)
            {
                rvInfo.messageText = ex.Message;
                rvInfo.isError = true;
            }
            return rvInfo;
        }
Exemplo n.º 18
0
        public List<DeductionBalance_Info> SearchRecords(Model.IModel.IModelObject searchCondition)
        {
            List<DeductionBalance_Info> returnList = new List<DeductionBalance_Info>();

            try
            {
                DeductionBalance_Info searchInfo = searchCondition as DeductionBalance_Info;

                StringBuilder sbSQL = new StringBuilder();
                sbSQL.AppendLine("select *,cua_fCurrentBalance as Balance ");
                sbSQL.AppendLine("from dbo.PreConsumeRecord_pcs");
                sbSQL.AppendLine("join dbo.CardUserAccount_cua on cua_cRecordID = pcs_cAccountID");
                sbSQL.AppendLine("join dbo.CardUserMaster_cus on cus_cRecordID = cua_cCUSID");
                sbSQL.AppendLine("join dbo.ClassMaster_csm on csm_cRecordID = cus_cClassID");
                sbSQL.AppendLine("join dbo.UserCardPair_ucp on ucp_cCUSID = cus_cRecordID and ucp_dReturnTime is null");
                sbSQL.AppendLine(" where pcs_cConsumeType = 'SetMealCost' and pcs_lIsSettled = 1");

                if (searchInfo != null)
                {
                    if (searchInfo.ClassID != Guid.Empty)
                    {
                        sbSQL.AppendLine("AND csm_cRecordID ='" + searchInfo.ClassID.ToString() + "'");
                    }
                    if (searchInfo.CardNo > 0)
                    {
                        sbSQL.AppendLine("AND ucp_iCardNo ='" + searchInfo.CardNo.ToString() + "'");
                    }
                    if (!String.IsNullOrEmpty(searchInfo.ChaName))
                    {
                        sbSQL.AppendLine("AND cus_cChaName like N'%" + searchInfo.ChaName.ToString() + "%'");
                    }
                    if (!String.IsNullOrEmpty(searchInfo.StudentID))
                    {
                        sbSQL.AppendLine("AND cus_cStudentID ='" + searchInfo.StudentID.ToString() + "'");
                    }

                    sbSQL.AppendLine("AND pcs_dConsumeDate between '" + searchInfo.FromTime.ToString("yyyy/MM/dd") + "' and '" + searchInfo.ToTime.ToString("yyyy/MM/dd") + "'");
                    sbSQL.AppendLine("order by pcs_dConsumeDate desc");

                }

                using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                {
                    IEnumerable<DeductionBalance_Info> query = db.ExecuteQuery<DeductionBalance_Info>(sbSQL.ToString(), new object[] { });
                    if (query != null)
                    {
                        returnList = query.ToList<DeductionBalance_Info>();
                    }
                }

            }
            catch
            {

            }
            return returnList;
        }
Exemplo n.º 19
0
        public ReturnValueInfo DeleteRecord(IModelObject KeyObject)
        {
            ReturnValueInfo returnInfo = new ReturnValueInfo(false);

            GradeMaster_gdm_Info deleteInfo = KeyObject as GradeMaster_gdm_Info;

            if (deleteInfo != null)
            {
                try
                {
                    using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                    {
                        GradeMaster_gdm deleteData = db.GradeMaster_gdm.FirstOrDefault(t => t.gdm_cRecordID == deleteInfo.gdm_cRecordID);

                        if (deleteData != null)
                        {
                            IEnumerable<ClassMaster_csm> classe = from t in db.ClassMaster_csm
                                                                  where t.csm_cGDMID == deleteInfo.gdm_cRecordID
                                                                  select t;

                            if (classe != null && classe.Count() > 0)
                            {
                                returnInfo.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_E_DeleteObjectHaveContectData;
                            }
                            else
                            {
                                db.GradeMaster_gdm.DeleteOnSubmit(deleteData);

                                db.SubmitChanges();

                                returnInfo.boolValue = true;
                            }
                        }
                        else
                        {
                            returnInfo.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_E_DeleteDataNull;
                        }
                    }
                }
                catch (Exception Ex)
                {

                    returnInfo.messageText = Ex.Message;
                }
            }
            else
            {
                returnInfo.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_E_DeleteDataNull;
            }

            return returnInfo;
        }
Exemplo n.º 20
0
        /// <summary>
        /// 取得日志
        /// </summary>
        /// <param name="p_strIP">IP</param>
        /// <param name="p_strSystemName">系统名</param>
        /// <param name="p_strModel">模组</param>
        /// <param name="p_strType">类型</param>
        /// <param name="p_strOperator">操作人</param>
        /// <returns></returns>
        public List<LogDetail_lgd_Info> GetLogs(string p_strIP, string p_strSystemName, string p_strModel, string p_strType, string p_strOperator)
        {
            StringBuilder l_strSQL = new StringBuilder();

            l_strSQL.AppendLine("Select Top 200 lgd_iID,");
            l_strSQL.AppendLine("lgd_cIpAddr,");
            l_strSQL.AppendLine("lgd_cSysName,");
            l_strSQL.AppendLine("lgd_cClassMethodName,");
            l_strSQL.AppendLine("lgd_cLogType,");
            l_strSQL.AppendLine("lgd_cLogMessage,");
            l_strSQL.AppendLine("lgd_cRemark,");
            l_strSQL.AppendLine("lgd_cOperator,");
            l_strSQL.AppendLine("lgd_dOperateDateTime");
            l_strSQL.AppendLine("From LogDetail_lgd");

            l_strSQL.AppendLine("Where 1=1");

            if (p_strIP != "")
            {
                l_strSQL.AppendLine("And lgd_cIpAddr = '" + p_strIP + "'");
            }

            if (p_strSystemName != "")
            {
                l_strSQL.AppendLine("And lgd_cSysName = '" + p_strSystemName + "'");
            }

            if (p_strModel != "")
            {
                l_strSQL.AppendLine("And lgd_cClassMethodName = '" + p_strModel + "'");
            }

            if (p_strType != "")
            {
                l_strSQL.AppendLine("And lgd_cLogType = '" + p_strType + "'");
            }

            if (p_strOperator != "")
            {
                l_strSQL.AppendLine("And lgd_cOperator = '" + p_strOperator + "'");
            }

            l_strSQL.AppendLine("Order By lgd_dOperateDateTime Desc");

            using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
            {
                return db.ExecuteQuery<LogDetail_lgd_Info>(l_strSQL.ToString(), new object[] { }).ToList();
            }
        }
        public ReturnValueInfo BatchDeleteRecords(PaymentUDGeneralSetting_pus_Info searchInfo)
        {
            ReturnValueInfo rvInfo = new ReturnValueInfo();

            try
            {
                using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                {
                    List<PaymentUDGeneralSetting_pus> searchData = db.PaymentUDGeneralSetting_pus.Where(x => 1 == 1).ToList();
                    PaymentUDGeneralSetting_pus_Info query = searchInfo as PaymentUDGeneralSetting_pus_Info;

                    if (query != null)
                    {
                        if (query.pus_cCardUserID != null)
                        {
                            searchData = searchData.Where(t => t.pus_cCardUserID == query.pus_cCardUserID).ToList();
                        }
                        if (query.pus_cClassID != null)
                        {
                            searchData = searchData.Where(t => t.pus_cClassID == query.pus_cClassID).ToList();
                        }
                        if (query.pus_cGradeID != null)
                        {
                            searchData = searchData.Where(t => t.pus_cGradeID == query.pus_cGradeID).ToList();
                        }
                        if (query.pus_iWeek != null && query.pus_iWeek != -1)
                        {
                            searchData = searchData.Where(t => t.pus_iWeek == query.pus_iWeek).ToList();
                        }
                    }
                    else
                    {
                        rvInfo.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_E_ObjectNull;
                        return rvInfo;
                    }

                    db.PaymentUDGeneralSetting_pus.DeleteAllOnSubmit(searchData);
                    db.SubmitChanges();
                    rvInfo.boolValue = true;
                }
            }
            catch (Exception ex)
            {
                rvInfo.isError = true;
                rvInfo.messageText = ex.Message;
            }
            return rvInfo;
        }
Exemplo n.º 22
0
 public bool SaveRecord(Sys_UserMaster_usm_Info infoObj)
 {
     try
     {
         using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
         {
             LinqToSQLModel.Sys_UserMaster_usm newTab = Common.General.CopyObjectValue<Sys_UserMaster_usm_Info, LinqToSQLModel.Sys_UserMaster_usm>(infoObj);
             db.Sys_UserMaster_usm.InsertOnSubmit(newTab);
             db.SubmitChanges();
         }
         return true;
     }
     catch
     {
         throw;
     }
 }
Exemplo n.º 23
0
        public bool DeleteRecord(Model.IModel.IModelObject KeyObject)
        {
            Sys_FormMaster_fom_Info info = null;
            try
            {
                info = KeyObject as Sys_FormMaster_fom_Info;
                using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                {
                    Sys_FormMaster_fom frm = db.Sys_FormMaster_fom.Single<Sys_FormMaster_fom>(i => i.fom_iRecordID == info.fom_iRecordID);

                    for (int i = 0; i < frm.Sys_FormPurview_frp.Count; i++)
                    {
                        Sys_FormPurview_frp sta = frm.Sys_FormPurview_frp[i];
                        db.Sys_FormPurview_frp.DeleteOnSubmit(sta);
                    }

                    if (frm != null)
                    {
                        frm.fom_lVaild = false;

                        IEnumerable<Sys_FormMaster_fom> subMenu = from t in db.Sys_FormMaster_fom
                                                                  where t.fom_iParentID == frm.fom_iRecordID
                                                                  select t;

                        if (subMenu != null && subMenu.Count() > 0)
                        {
                            foreach (Sys_FormMaster_fom item in subMenu)
                            {
                                item.fom_lVaild = false;
                            }
                        }
                    }
                    //db.Sys_FormMaster_fom.DeleteOnSubmit(frm);
                    db.SubmitChanges();
                    return true;
                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
        }
Exemplo n.º 24
0
        public List<GradeMaster_gdm_Info> AllRecords()
        {
            List<GradeMaster_gdm_Info> allRecords = null;

            try
            {
                using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                {
                    IEnumerable<GradeMaster_gdm> allDatas = from t in db.GradeMaster_gdm
                                                            orderby t.gdm_dAddDate ascending
                                                            select t;

                    if (allDatas != null && allDatas.Count() > 0)
                    {
                        allRecords = new List<GradeMaster_gdm_Info>();

                        foreach (GradeMaster_gdm item in allDatas)
                        {
                            GradeMaster_gdm_Info addInfo = Common.General.CopyObjectValue<GradeMaster_gdm, GradeMaster_gdm_Info>(item);

                            CardUserMaster_cus staff = db.CardUserMaster_cus.FirstOrDefault(t => t.cus_cRecordID == item.gdm_cPraepostorID);

                            if (staff != null)
                            {
                                addInfo.gdm_cPraepostorName = staff.cus_cChaName;

                                addInfo.gdm_cPraepostorPhone = staff.cus_cContractPhone;
                            }

                            allRecords.Add(addInfo);
                        }
                    }
                }
            }
            catch (Exception Ex)
            {

                throw Ex;
            }

            return allRecords;
        }
Exemplo n.º 25
0
 public CodeMaster_cmt_Info DisplayRecord(Model.IModel.IModelObject KeyObject)
 {
     CodeMaster_cmt_Info info = new CodeMaster_cmt_Info();
     try
     {
         using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
         {
             CodeMaster_cmt disTab = db.CodeMaster_cmt.SingleOrDefault(t => t.cmt_iRecordID == ((KeyObject) as CodeMaster_cmt_Info).cmt_iRecordID);
             if (disTab != null)
             {
                 info = Common.General.CopyObjectValue<CodeMaster_cmt, CodeMaster_cmt_Info>(disTab);
             }
         }
     }
     catch (Exception Ex)
     {
         throw Ex;
     }
     return info;
 }
Exemplo n.º 26
0
        public List<ClassMaster_csm_Info> AllRecords()
        {
            List<ClassMaster_csm_Info> allRecords = null;

            try
            {
                using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                {
                    IEnumerable<ClassMaster_csm> allData = from t in db.ClassMaster_csm
                                                           orderby t.csm_dAddDate ascending
                                                           select t;

                    if (allData != null && allData.Count() > 0)
                    {
                        allRecords = new List<ClassMaster_csm_Info>();

                        foreach (ClassMaster_csm item in allData)
                        {
                            ClassMaster_csm_Info addInfo = Common.General.CopyObjectValue<ClassMaster_csm, ClassMaster_csm_Info>(item);

                            CardUserMaster_cus masterInfo = db.CardUserMaster_cus.FirstOrDefault(t => t.cus_cRecordID == addInfo.csm_cMasterID);

                            if (masterInfo != null)
                            {
                                addInfo.csm_cMasterName = masterInfo.cus_cChaName;
                            }

                            allRecords.Add(addInfo);
                        }
                    }

                }
            }
            catch (Exception Ex)
            {

                throw Ex;
            }

            return allRecords;
        }
Exemplo n.º 27
0
        public bool DeleteRecord(int id)
        {
            try
            {
                using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                {
                    var ret_usm = from usm in db.Sys_UserMaster_usm where usm.usm_iRecordID == id select usm;

                    if (ret_usm.Count() > 0)
                    {
                        db.Sys_UserMaster_usm.DeleteAllOnSubmit(ret_usm);
                        db.SubmitChanges();
                    }
                }
                return true;
            }
            catch
            {
                throw;
            }
        }
Exemplo n.º 28
0
        public List<DepartmentMaster_dpm_Info> AllRecords()
        {
            List<DepartmentMaster_dpm_Info> listReturn = null;

            try
            {
                StringBuilder sbSQL = new StringBuilder();
                sbSQL.AppendLine("SELECT * FROM DepartmentMaster_dpm");

                using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                {
                    listReturn = db.ExecuteQuery<DepartmentMaster_dpm_Info>(sbSQL.ToString(), new object[] { }).ToList();
                }
            }
            catch (Exception ex)
            {

                throw ex;
            }

            return listReturn;
        }
Exemplo n.º 29
0
        public ReturnValueInfo DeleteRecord(IModelObject KeyObject)
        {
            ReturnValueInfo rvInfo = new ReturnValueInfo();
            try
            {
                CardUserAccountDetail_cuad_Info infoObject = KeyObject as CardUserAccountDetail_cuad_Info;
                if (infoObject != null)
                {
                    using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                    {
                        CardUserAccountDetail_cuad record = db.CardUserAccountDetail_cuad.Where(x => x.cuad_cRecordID == infoObject.cuad_cRecordID).FirstOrDefault();

                        if (record != null)
                        {
                            db.CardUserAccountDetail_cuad.DeleteOnSubmit(record);

                            db.SubmitChanges();
                            rvInfo.boolValue = true;
                            rvInfo.ValueObject = infoObject;
                        }
                        else
                        {
                            rvInfo.messageText = "GetEntity is null";
                        }
                    }
                }
                else
                {
                    rvInfo.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_E_ObjectNull;
                }
            }
            catch (Exception ex)
            {
                rvInfo.isError = true;
                rvInfo.messageText = ex.Message;
            }
            return rvInfo;
        }
Exemplo n.º 30
0
        public ReturnValueInfo DeleteRecord(IModelObject KeyObject)
        {
            ReturnValueInfo rvInfo = new ReturnValueInfo();
            try
            {
                MealBookingHistory_mbh_Info infoObject = KeyObject as MealBookingHistory_mbh_Info;
                if (infoObject != null)
                {
                    using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                    {
                        MealBookingHistory_mbh history = db.MealBookingHistory_mbh.Where(x => x.mbh_cRecordID == infoObject.mbh_cRecordID).FirstOrDefault();

                        if (history != null)
                        {
                            db.MealBookingHistory_mbh.DeleteOnSubmit(history);

                            db.SubmitChanges();
                            rvInfo.boolValue = true;
                            rvInfo.ValueObject = infoObject;
                        }
                        else
                        {
                            rvInfo.messageText = "GetEntity is null";
                        }
                    }
                }
                else
                {
                    rvInfo.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_E_ObjectNull;
                }
            }
            catch (Exception ex)
            {
                rvInfo.isError = true;
                rvInfo.messageText = ex.Message;
            }
            return rvInfo;
        }