コード例 #1
0
ファイル: EventSignService.cs プロジェクト: huxuanchenxy/nsda
        //赛事管理员 批量签到
        public bool BatchSign(List <int> memberId, int eventId, EventSignTypeEm eventSignType, out string msg)
        {
            bool flag = false;

            msg = string.Empty;
            try
            {
                var sql = "update t_event_sign set eventSignStatus=@EventSignStatus,signtime=@SignTime where eventSignType=@EventSignType and memberId in @MemberId and eventId=@EventId and signDate=@SignDate ";
                var dy  = new DynamicParameters();
                dy.Add("MemberId", memberId.ToArray());
                dy.Add("EventId", eventId);
                dy.Add("EventSignType", eventSignType);
                dy.Add("EventSignStatus", EventSignStatusEm.已签到);
                dy.Add("SignTime", DateTime.Now);
                dy.Add("SignDate", DateTime.Now.ToString("yyyy-MM-dd"));
                _dbContext.Execute(sql, dy);
                flag = true;
            }
            catch (Exception ex)
            {
                flag = false;
                msg  = "服务异常";
                LogUtils.LogError("EventSignService.BatchSign", ex);
            }
            return(flag);
        }
コード例 #2
0
        public ActionResult GetPartID(string BDNO, string MSG_NO)//besok
        {
            string            flag    = "";
            IDBContext        db      = DatabaseManager.Instance.GetContext();
            var               result  = db.Fetch <SIMPLEGRID>("CENTRAL010301W/CENTRAL010301WLooingFormatVal", new { BDNO = @BDNO });
            List <SIMPLEGRID> listSTR = new List <SIMPLEGRID>();

            listSTR = result.ToList();

            List <string> newstrVal = new List <string>();

            newstrVal = listSTR.Select(p => p.FORMAT_VAL).ToList();

            List <string> newstrVal2 = new List <string>();

            newstrVal2 = listSTR.Select(p => p.VAL).ToList();



            for (int i = 0; i < newstrVal.Count(); i++)
            {
                if (newstrVal[i].Length == newstrVal2[i].Length)
                {
                    List <string> format = getFormatList(newstrVal[i]);
                    if (validationFormat(newstrVal2[i], format))
                    {
                        db.Execute("CENTRAL010301W/CENTRAL010301WUpdateSFNCntralOK", new { BDNO = BDNO, MSG_NO = MSG_NO });
                        db.Close();
                        flag = newstrVal2[i].ToString();

                        //Insert to log monitoring (TB_R_LOG_H and TB_R_LOG_D)
                    }
                    if (!validationFormat(newstrVal2[i], format))
                    {
                        db.Execute("CENTRAL010301W/CENTRAL010301WUpdateNG", new { BDNO = BDNO, MSG_NO = MSG_NO });
                        db.Close();

                        //Insert to log monitoring (TB_R_LOG_H and TB_R_LOG_D)
                    }
                    else
                    {
                        flag = newstrVal2[i].ToString();
                    }
                }
                else
                {
                    db.Execute("CENTRAL010301W/CENTRAL010301WUpdateNG", new { BDNO = BDNO, MSG_NO = MSG_NO });
                    db.Close();

                    //Insert to log monitoring (TB_R_LOG_H and TB_R_LOG_D)
                }
            }

            db.Close();
            return(Json(flag, JsonRequestBehavior.AllowGet));
        }
コード例 #3
0
ファイル: RefereeSignRepo.cs プロジェクト: huxuanchenxy/nsda
        /// <summary>
        /// 裁判签到管理设置状态
        /// </summary>
        /// <param name="eventId"></param>
        /// <param name="memberId"></param>
        /// <param name="manMemberId"></param>
        public void RefereeSignSetting(int memberId, int manMemberId, int refereeStatus, int eventGroupId, int eventid)
        {
            var sql = $@" UPDATE t_event_sign set refereeStatus = {refereeStatus},eventGroupId = {eventGroupId} where  memberId = {memberId} and eventId = {eventid})
                           ";

            _dbContext.Execute(sql);
        }
コード例 #4
0
        public Common Operation(Int64 p_id)
        {
            SqlParameter outputRetVal  = CreateSqlParameterOutputReturnValue("RetVal");
            SqlParameter outputErrMesg = CreateSqlParameterOutputErrMesg("ErrMesg");

            IDBContext db = dbManager.GetContext();

            dynamic args = new
            {
                PROCESS_ID = p_id,
                RetVal     = outputRetVal,
                ErrMesg    = outputErrMesg
            };

            int    result  = db.Execute("Execute_SP", args);
            Common Rresult = new Common();

            Rresult.Result = Common.VALUE_ERROR;
            string errMesg = string.Empty;

            if (outputErrMesg != null && outputErrMesg.Value != null)
            {
                errMesg = outputErrMesg.Value.ToString();
            }
            Rresult.ErrMesgs    = new string[1];
            Rresult.ErrMesgs[0] = errMesg;
            return(Rresult);
        }
コード例 #5
0
        public string deleteStaging()
        {
            IDBContext db = dbManager.GetContext();

            db.Execute("DELETE FROM TB_T_DRAFT_MATERIAL_PRICE");
            return("SUCCESS");
        }
コード例 #6
0
ファイル: PoRepository.cs プロジェクト: denapurnama/Incubator
        public RepoResult DeleteMultiple(IDBContext db, IList <string> listKey)
        {
            SqlParameter outputRetVal        = CreateSqlParameterOutputReturnValue("RetVal");
            SqlParameter outputErrMesg       = CreateSqlParameterOutputErrMesg("ErrMesg");
            SqlParameter outputTblApprovalId = CreateSqlParameterTblOfVarchar("TableOfVarchar", listKey, "dbo.TableOfVarchar");

            dynamic args = new
            {
                RetVal         = outputRetVal,
                ErrMesg        = outputErrMesg,
                TableOfVarchar = outputTblApprovalId
            };

            int result = db.Execute("Po/Po_DeleteMultiple", args);

            RepoResult repoResult = new RepoResult();

            repoResult.Result = RepoResult.VALUE_SUCCESS;

            if ((int)outputRetVal.Value != 0)
            {
                repoResult.Result = RepoResult.VALUE_ERROR;
                string errMesg = string.Empty;
                if (outputErrMesg != null && outputErrMesg.Value != null)
                {
                    errMesg = outputErrMesg.Value.ToString();
                }
                repoResult.ErrMesgs    = new string[1];
                repoResult.ErrMesgs[0] = errMesg;
            }

            return(repoResult);
        }
コード例 #7
0
        //替换对垒位置
        public bool ReplaceMatch(int cyclingMatchId, int memberId, out string msg)
        {
            bool flag = false;

            msg = string.Empty;
            try
            {
                t_event_cycling_match tmatch = _dbContext.Get <t_event_cycling_match>(cyclingMatchId);
                if (tmatch != null)
                {
                    _dbContext.Execute($"update t_event_cycling_match set congroupNum='{tmatch.progroupNum}',progroupNum='{tmatch.congroupNum}',updatetime='{DateTime.Now}' where id={cyclingMatchId}");
                    flag = true;
                }
                else
                {
                    msg = "对垒信息有误";
                }
            }
            catch (Exception ex)
            {
                flag = false;
                msg  = "服务异常";
                LogUtils.LogError("EventCyclingMatchService.ReplaceMatch", ex);
            }
            return(flag);
        }
コード例 #8
0
        public bool InsertCentralLog(string ASD_VINNO, string MSG_NO, string BDNO, string IDNO, string VAL, string FORMAT_VAL, string FORMAT_START, string FORMAT_LENGHT, string USER)
        {
            bool result = false;

            try
            {
                IDBContext db = DatabaseManager.Instance.GetContext();
                result = db.Execute("CENTRAL010101W/CENTRAL010101WInsertCentralLog",
                                    new
                {
                    ASD_VINNO     = ASD_VINNO,
                    MSG_NO        = MSG_NO,
                    BDNO          = BDNO,
                    IDNO          = IDNO,
                    VAL           = VAL,
                    FORMAT_VAL    = FORMAT_VAL,
                    FORMAT_START  = FORMAT_START,
                    FORMAT_LENGHT = FORMAT_LENGHT,
                    USER          = USER
                }) > 0;
                db.Close();
            }
            catch
            {
            }
            return(result);
        }
コード例 #9
0
        public bool InsertCentralHeader(string BDNO, string IDNO, int COUNTING_PARTID, string TM_CD, string SUMM_STS, string STS, string USER)
        {
            bool result = false;

            try
            {
                IDBContext db = DatabaseManager.Instance.GetContext();
                result = db.Execute("CENTRAL010101W/CENTRAL010101WInsertCentralHeader",
                                    new
                {
                    BDNO            = BDNO,
                    IDNO            = IDNO,
                    COUNTING_PARTID = COUNTING_PARTID,
                    TM_CD           = TM_CD,
                    SUMM_STS        = SUMM_STS,
                    STS             = STS,
                    USER            = USER
                }) > 0;
                db.Close();
            }
            catch
            {
            }
            return(result);
        }
コード例 #10
0
        public string SaveEditGridRepo(string ID, string PlanCD_val, string termCD_val, string partCD_val, string PartDesc_val, string ColV1_val, string ConsVal1_val, string ColVI2_val, string ConsVal2_val, string ColVI3_val, string ConsVal3_val, string format_No_val, string format_val_val, string format_start_val, string format_length_val, string valid_fr_val, string valid_to_val, string changeBy_val, string changeDt_val, string UpdateBy_val, string UpdateDt_val)
        {
            IDBContext db = DatabaseManager.Instance.GetContext();

            if (!String.IsNullOrEmpty(valid_fr_val) || !String.IsNullOrEmpty(valid_to_val) || !String.IsNullOrEmpty(changeDt_val) || !String.IsNullOrEmpty(UpdateDt_val))
            {
                DateTime val_from = DateTime.ParseExact(valid_fr_val, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture);
                valid_fr_val = val_from.ToString("yyyy-MM-dd");
                DateTime val_to = DateTime.ParseExact(valid_to_val, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture);
                valid_to_val = val_to.ToString("yyyy-MM-dd");
                DateTime cr_DT = DateTime.ParseExact(changeDt_val, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture);
                changeDt_val = cr_DT.ToString("yyyy-MM-dd");

                DateTime Up_DT = DateTime.ParseExact(UpdateDt_val, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture);
                UpdateDt_val = Up_DT.ToString("yyyy-MM-dd");
            }
            dynamic args = new
            {
                PLANT_CDID    = ID,
                PLANT_CD      = PlanCD_val,
                TERM_CD       = termCD_val,
                PART_CD       = partCD_val,
                PART_DESC     = PartDesc_val,
                COL_VI1       = ColV1_val,
                CONS_VAL1     = ConsVal1_val,
                COL_VI2       = ColVI2_val,
                CONS_VAL2     = ConsVal2_val,
                COL_VI3       = ColVI3_val,
                CONS_VAL3     = ConsVal3_val,
                FORMAT_SEQ    = format_No_val,
                FORMAT_VAL    = format_val_val,
                FORMAT_START  = format_start_val,
                FORMAT_LENGTH = format_length_val,
                VALID_FR      = valid_fr_val,
                VALID_TO      = valid_to_val,
                CREATED_BY    = changeBy_val,
                CREATED_DT    = changeDt_val,
                UPDATED_BY    = UpdateBy_val,
                UPDATED_DT    = UpdateDt_val
            };

            try
            {
                int result = db.Execute("CENTRAL020105W/CENTRAL020105SaveEditGrid", args);
                db.Close();
                if (result > 0)
                {
                    return("Edit Finished Successfully.");
                }
                else
                {
                    return("Edit Failed.");
                }
            }
            catch (Exception e)
            {
                return(e.Message.ToString());
            }
        }
コード例 #11
0
        public int GetDeleteGrid(string PlantID)
        {
            IDBContext db     = DatabaseManager.Instance.GetContext();
            var        result = db.Execute("CENTRAL020105W/CENTRAL020105WGetDeleteGrid", new { PLANT_CD = PlantID });

            db.Close();
            return(result);
        }
コード例 #12
0
        //public List<HeaderNotification> GetHeaderNotification(string noreg)
        //{

        //    IDBContext db = DatabaseManager.Instance.GetContext();
        //    return db.Query<HeaderNotification>("Standards/GetNotificationHeader", new { NOREG = noreg }).ToList();

        //}

        //public IEnumerable<HeaderNotification> GetHeaderNotification(string noreg)
        //{
        //    IDBContext db = DatabaseManager.Instance.GetContext();
        //    return db.Fetch<HeaderNotification>("Standards/GetNotificationHeader", new { NOREG = noreg }).ToList();
        //}

        public string doUpdateNotif(string data, string noreg)
        {
            IDBContext db     = DatabaseManager.Instance.GetContext();
            string     result = "1";

            db.Execute("Standards/UpdateNotification", new { NOTIF_ID = data, NOREG = noreg });
            db.Close();

            return(result);
        }
コード例 #13
0
        //编辑循环赛规则
        public bool CyclingRaceRule(CyclingRaceRuleRequest request, out string msg)
        {
            bool flag = false;

            msg = string.Empty;
            try
            {
                _dbContext.BeginTransaction();
                foreach (var item in request.Teamscoringrule)
                {
                    var sql = $"update t_event_teamscoringrule set teamScoringRules={(int)item.TeamScoringRules},updatetime='{DateTime.Now}' where id={item.Id}";
                    _dbContext.Execute(sql);
                }

                foreach (var item in request.Scoringrule)
                {
                    var sql = $"update t_event_playerscoringrule set scoringRules={(int)item.ScoringRules},updatetime='{DateTime.Now}' where id={item.Id}";
                    _dbContext.Execute(sql);
                }

                foreach (var item in request.Avoidrule)
                {
                    var sql = $"update t_event_cycling_avoidrule set avoidRules={(int)item.AvoidRules},updatetime='{DateTime.Now}' where id={item.Id}";
                    _dbContext.Execute(sql);
                }

                foreach (var item in request.RefereeAvoidrule)
                {
                    var sql = $"update t_event_refereeavoidrule set refereeAvoidRules={(int)item.RefereeAvoidRules},updatetime='{DateTime.Now}' where id={item.Id}";
                    _dbContext.Execute(sql);
                }
                _dbContext.CommitChanges();
                flag = true;
            }
            catch (Exception ex)
            {
                _dbContext.Rollback();
                flag = false;
                msg  = "服务异常";
                LogUtils.LogError("EventRuleService.CyclingRaceRule", ex);
            }
            return(flag);
        }
コード例 #14
0
        //临时裁判绑定
        public bool BindTempReferee(BindTempRefereeRequest request, out string msg)
        {
            bool flag = false;

            msg = string.Empty;
            try
            {
                //校验数据的真实性
                if (request.TempRefereeNum.IsEmpty())
                {
                    msg = "临时裁判编码不能为空";
                    return(flag);
                }

                if (request.ContactMobile.IsEmpty())
                {
                    msg = "手机号码不能为空";
                    return(flag);
                }

                var data = _dbContext.Select <t_member_temp>(c => c.contactmobile == request.ContactMobile && c.code == request.TempRefereeNum && c.tempType == Model.enums.TempTypeEm.临时裁判 && c.tempStatus == TempStatusEm.待绑定).FirstOrDefault();
                if (data == null)
                {
                    msg = "数据不存在或已绑定过,请核对后再操作";
                    return(flag);
                }

                t_event t_event = _dbContext.Get <t_event>(data.eventId);
                if (t_event.eventStatus != EventStatusEm.比赛完成)
                {
                    msg = "赛事未完成不能进行绑定";
                    return(flag);
                }

                try
                {
                    _dbContext.BeginTransaction();
                    t_member_points points = _dbContext.Select <t_member_points>(c => c.memberId == data.memberId).FirstOrDefault();
                    _dbContext.Execute($"update t_member_points set playerPoints=playerPoints+{points.playerPoints},coachPoints=coachPoints+{points.coachPoints},refereePoints=refereePoints+{points.refereePoints} where memberId={request.MemberId}");
                    _dbContext.Execute($"update t_member_temp set tomemberId={request.MemberId},updateTime='{DateTime.Now}',tempStatus={(int)TempStatusEm.已绑定}  where id={data.id}");
                    _dbContext.Execute($"update t_member_points_record set memberId={request.MemberId} where memberId={data.memberId} and isdelete=0");
                    _dbContext.Execute($"update t_event_referee_signup set memberId={request.MemberId} where memberId={data.memberId} and isdelete=0");
                    _dbContext.Execute($"update t_event_cycling_match set refereeId={request.MemberId} where  refereeId={data.memberId} and isdelete=0");
                    _dbContext.Execute($"update t_event_cycling_match_playerresult set refereeId={request.MemberId} where refereeId={data.memberId} and isdelete=0");
                    _dbContext.CommitChanges();
                    flag = true;
                }
                catch (Exception ex)
                {
                    _dbContext.Rollback();
                    LogUtils.LogError("MemberTempService.BindTempRefereeTran", ex);
                }
            }
            catch (Exception ex)
            {
                LogUtils.LogError("MemberTempService.BindTempReferee", ex);
            }
            return(flag);
        }
コード例 #15
0
        public int UpdateData(string record, string table, string PK)
        {
            IDBContext db      = DatabaseManager.Instance.GetContext();
            var        tambah  = record.Replace("+", " ");
            var        ubah    = tambah.Replace("%3A", ":");
            var        split   = ubah.Split('&');
            var        tampung = "";

            string[] split_tampungnya;
            var      field = "";
            var      value = "";
            int      res   = 0;

            db.BeginTransaction();
            try
            {
                for (int i = 0; i < split.Length; i++)
                {
                    tampung          = split[i];
                    split_tampungnya = tampung.Split('=');
                    if (field == "")
                    {
                        field = split_tampungnya[0].ToString();
                        value = split_tampungnya[1].ToString();
                    }
                    else
                    {
                        field = field + "," + split_tampungnya[0].ToString();
                        value = value + "," + split_tampungnya[1].ToString();
                    }
                }

                res = db.Execute("Master/SimpleMasterCustom_UpdateData",
                                 new
                {
                    P_FIELD = field,
                    P_VALUE = value,
                    P_TABLE = table,
                    PK      = PK,
                });
                db.Close();

                db.CommitTransaction();
            }
            catch (Exception E)
            {
                db.AbortTransaction();
            }
            return(res);
        }
コード例 #16
0
        public int InsertLogin(string userID)
        {
            int result = 0;

            try
            {
                IDBContext db = DatabaseManager.Instance.GetContext();
                result = db.Execute("CENTRAL010102W/CENTRAL010102WInsertLogin", new { UserID = userID });
                db.Close();
            }
            catch
            {
            }
            return(result);
        }
コード例 #17
0
        public bool DeleteCentral(string IdNo)
        {
            bool result = false;

            try
            {
                IDBContext db = DatabaseManager.Instance.GetContext();
                result = db.Execute("CENTRAL010101W/CENTRAL010101WDeleteCentral", new { IdNo = IdNo }) > 0;
                db.Close();
            }
            catch
            {
            }
            return(result);
        }
コード例 #18
0
        // 支付回调
        public void Callback(int orderId, string paytransaction)
        {
            try
            {
                var order = _dbContext.Get <t_order>(orderId);
                if (order != null && (order.orderStatus == OrderStatusEm.等待支付 || order.orderStatus == OrderStatusEm.支付失败))
                {
                    try
                    {
                        _dbContext.BeginTransaction();
                        //修改订单状态
                        order.orderStatus = OrderStatusEm.支付成功;
                        order.updatetime  = DateTime.Now;
                        _dbContext.Update(order);
                        //修改支付流水信息
                        _dbContext.Execute($"update t_order_paylog set paytransaction='{paytransaction}',notifyTime='{DateTime.Now}',payStatus={(int)PayStatusEm.支付成功}  where orderId={orderId} and isdelete=0");
                        _dbContext.CommitChanges();

                        Task.Factory.StartNew(() => {
                            if (order.orderType == OrderTypeEm.实名认证)
                            {
                                _memberService.CallBack(order.memberId);
                            }
                            else if (order.orderType == OrderTypeEm.临时选手绑定)
                            {
                                _memberTempService.Callback(order.memberId, order.sourceId);
                            }
                            else if (order.orderType == OrderTypeEm.赛事报名)
                            {
                                _playerSignUpService.Callback(order.memberId, order.sourceId);
                            }
                        });
                    }
                    catch (Exception ex)
                    {
                        LogUtils.LogError("PayCallBackService.CallbackTran", ex);
                        _dbContext.Rollback();
                    }
                }
            }
            catch (Exception ex)
            {
                LogUtils.LogError("PayCallBackService.Callback", ex);
            }
        }
コード例 #19
0
        public ActionResult GetLoopSfnLog(string result5, string BDNO, string MSG_NO)
        {
            string     flag    = "";
            IDBContext db      = DatabaseManager.Instance.GetContext();
            var        result7 = db.Fetch <GETDATA>("CENTRAL010301W/CENTRAL010301WGetLoopSFNLog", new{ VAL = result5, BDNO = BDNO });

            db.Close();
            if (result7.Count() > 0)
            {
                db.Execute("CENTRAL010301W/CENTRAL010301WUpdateSFNCntralOK", new { BDNO = BDNO, MSG_NO = MSG_NO });
                db.Close();
                //Insert to log monitoring (TB_R_LOG_H and TB_R_LOG_D)
                flag = "valid";
            }



            return(Json(flag, JsonRequestBehavior.AllowGet));
        }
コード例 #20
0
        public bool UpdateCentral(string UserID, string IdNo, string PartID)
        {
            bool result = false;

            try
            {
                IDBContext db = DatabaseManager.Instance.GetContext();
                result = db.Execute("CENTRAL010101W/CENTRAL010101WUpdateCentral",
                                    new
                {
                    UserID = UserID,
                    IdNo   = IdNo,
                    PartID = PartID
                }) > 0;
                db.Close();
            }
            catch
            {
            }
            return(result);
        }
コード例 #21
0
        public bool InsertPartScan(string BD_NO, string PART_ID, int COUNTING_PARTID, string USER_ID)
        {
            bool result = false;

            try
            {
                IDBContext db = DatabaseManager.Instance.GetContext();
                result = db.Execute("CENTRAL010101W/CENTRAL010101WInsertPartScan",
                                    new
                {
                    BD_NO           = BD_NO,
                    PART_ID         = PART_ID,
                    COUNTING_PARTID = COUNTING_PARTID,
                    USER_ID         = USER_ID
                }) > 0;
                db.Close();
            }
            catch
            {
            }
            return(result);
        }
コード例 #22
0
ファイル: MailService.cs プロジェクト: huxuanchenxy/nsda
        //批量处理 未读站内信
        public bool Mark(int id, int memberId, out string msg)
        {
            bool flag = false;

            msg = string.Empty;
            try
            {
                var sql = $"udpate t_sys_mail set updatetime=@UpdateTime,isread=1 where Id = @Id and memberId=@MemberId";
                var dy  = new DynamicParameters();
                dy.Add("UpdateTime", DateTime.Now);
                dy.Add("Id", id);
                dy.Add("MemberId", memberId);
                _dbContext.Execute(sql, dy);
            }
            catch (Exception ex)
            {
                flag = false;
                msg  = "服务异常";
                LogUtils.LogError("MailService.Process", ex);
            }
            return(flag);
        }
コード例 #23
0
        public string SaveConfirmation(string BdIDS)
        {
            IDBContext db = DatabaseManager.Instance.GetContext();

            try
            {
                var result = db.Execute("CENTRAL010301W/CENTRAL010301WSaveConfirmation", new { BDNO = BdIDS });
                db.Close();
                if (result > 0)
                {
                    return("Edit Finished Successfully.");
                }
                else
                {
                    return("Edit Failed.");
                }
            }
            catch (Exception e)
            {
                return(e.Message.ToString());
            }
        }
コード例 #24
0
        //辩题投票
        public bool Vote(int voteId, List <int> detailId, out string msg)
        {
            bool flag = false;

            msg = string.Empty;
            try
            {
                var detail = _dbContext.Get <t_sys_vote>(voteId);
                if (detail != null)
                {
                    if (detail.voteStartTime < DateTime.Now && detail.voteEndTime > DateTime.Now)
                    {
                        var sql = "update t_sys_vote_detail set numberOfVotes=numberOfVotes+1 where Id in @Id and VoteId=@VoteId";
                        _dbContext.Execute(sql, new
                        {
                            Id     = detailId.ToArray(),
                            VoteId = voteId
                        });
                        flag = true;
                    }
                    else
                    {
                        msg = "投票已结束";
                    }
                }
                else
                {
                    msg = "数据不存在";
                }
            }
            catch (Exception ex)
            {
                flag = false;
                msg  = "服务异常";
                LogUtils.LogError("VoteService.Vote", ex);
            }
            return(flag);
        }
コード例 #25
0
 //支付记录
 public void PayLog(int orderId, decimal orderMoney, PayTypeEm payType, int memberId)
 {
     try
     {
         _dbContext.BeginTransaction();
         _dbContext.Execute($"update t_order_paylog set isdelete=1 where orderId={orderId} and memberId={memberId}");
         _dbContext.Insert(new t_order_paylog
         {
             paymentAmount = orderMoney,
             memberId      = memberId,
             orderId       = orderId,
             payTime       = DateTime.Now,
             payStatus     = PayStatusEm.等待支付,
             payType       = payType
         });
         _dbContext.CommitChanges();
     }
     catch (Exception ex)
     {
         _dbContext.Rollback();
         LogUtils.LogError("OrderService.PayLog", ex);
     }
 }
コード例 #26
0
        public bool sendEmail(string processID, string subject, string to, string cc, string bcc)
        {
            bool result = false;

            try
            {
                IDBContext db = DatabaseManager.Instance.GetContext();
                result = db.Execute("CENTRALMail/CENTRALSendEmail",
                                    new
                {
                    PROCESS_ID = processID,
                    SUBJECT    = subject,
                    TO         = to,
                    CC         = cc,
                    BCC        = bcc
                }) > 0;
                db.Close();
            }
            catch
            {
            }
            return(result);
        }
コード例 #27
0
ファイル: EventRoomService.cs プロジェクト: huxuanchenxy/nsda
        //修改设置
        public bool BatchEidtSettings(List <int> id, int statusOrGroup, out string msg)
        {
            bool flag = false;

            msg = string.Empty;
            try
            {
                var dy = new DynamicParameters();
                if (statusOrGroup == -1)//停用
                {
                    dy.Add("EventgroupId", 0);
                    dy.Add("RoomStatus", (int)RoomStatusEm.停用);
                }
                else if (statusOrGroup == 1)//启用
                {
                    dy.Add("EventgroupId", 0);
                    dy.Add("RoomStatus", (int)RoomStatusEm.闲置);
                }
                else
                {
                    dy.Add("EventgroupId", statusOrGroup);
                    dy.Add("RoomStatus", (int)RoomStatusEm.闲置);
                }
                dy.Add("UpdateTime", DateTime.Now);
                dy.Add("Id", id.ToArray());
                var sql = $"update t_event_room set  eventgroupId=@EventgroupId,roomStatus=@RoomStatus,updatetime=@UpdateTime where id in @Id ";
                _dbContext.Execute(sql, dy);
                flag = true;
            }
            catch (Exception ex)
            {
                flag = false;
                msg  = "服务异常";
                LogUtils.LogError("EventRoomService.BatchEidtSettings", ex);
            }
            return(flag);
        }
コード例 #28
0
        public RepoResult InsertUpdate(IDBContext db, string userId,
                                       Items data, string screenMode)
        {
            SqlParameter outputRetVal  = CreateSqlParameterOutputReturnValue("RetVal");
            SqlParameter outputErrMesg = CreateSqlParameterOutputErrMesg("ErrMesg");

            dynamic args = new
            {
                RetVal     = outputRetVal,
                ErrMesg    = outputErrMesg,
                UserId     = userId,
                ItemCode   = data.ITEM_CODE,
                ItemName   = data.ITEM_NAME,
                ItemUm     = data.ITEM_UM,
                ScreenMode = screenMode
            };

            int result = db.Execute("Item/Item_InsertUpdate", args);

            RepoResult repoResult = new RepoResult();

            repoResult.Result = RepoResult.VALUE_SUCCESS;

            if ((int)outputRetVal.Value != 0)
            {
                repoResult.Result = RepoResult.VALUE_ERROR;
                string errMesg = string.Empty;
                if (outputErrMesg != null && outputErrMesg.Value != null)
                {
                    errMesg = outputErrMesg.Value.ToString();
                }
                repoResult.ErrMesgs    = new string[1];
                repoResult.ErrMesgs[0] = errMesg;
            }

            return(repoResult);
        }
コード例 #29
0
        public ActionResult CheckinSFNCentral(string BDNO, string FR_CD, string MSG_NO)
        {
            IDBContext        db3           = DatabaseManager.Instance.GetContext();
            var               result3       = db3.Fetch <SIMPLEGRID>("CENTRAL010301W/CENTRAL010301WCheckinSFNCentral", new { BDNO = BDNO, FR_CD = FR_CD, MSG_NO = MSG_NO });
            List <SIMPLEGRID> newListCheck3 = new List <SIMPLEGRID>();

            newListCheck3 = result3.ToList();
            if (newListCheck3.Count() > 0)
            {
                IDBContext db4 = DatabaseManager.Instance.GetContext();
                db4.Execute("CENTRAL010301W/CENTRAL010301WUpdateSFNCntral", new { BDNO = BDNO, MSG_NO = MSG_NO, FR_CD = FR_CD });
                db4.Close();
                //UPDATE TB_R_LOG_H AND TB_R_LOG_D
            }
            if (newListCheck3.Count() <= 0)
            {
                IDBContext db4 = DatabaseManager.Instance.GetContext();
                db4.Execute("CENTRAL010301W/CENTRAL010301WUpdateSFNCntralNG", new { BDNO = BDNO, MSG_NO = MSG_NO, FR_CD = FR_CD });
                db4.Close();
                //UPDATE TB_R_LOG_H AND TB_R_LOG_D
            }
            db3.Close();
            return(Json(result3, JsonRequestBehavior.AllowGet));
        }
コード例 #30
0
        //奖项设置
        public bool Settings(EventRegularAwardsRequest request, out string msg)
        {
            bool flag = false;

            msg = string.Empty;
            try
            {
                try
                {
                    _dbContext.BeginTransaction();
                    _dbContext.Execute($"delete from t_event_regularawards where eventId={request.EventId} and eventGroupId={request.EventGroupId}");
                    _dbContext.Insert(new t_event_regularawards {
                        eventGroupId = request.EventGroupId,
                        eventId      = request.EventId,
                        prizeGroup   = request.PrizeGroup,
                        personal     = request.Personal
                    });
                    _dbContext.CommitChanges();
                    flag = true;
                }
                catch (Exception ex)
                {
                    _dbContext.Rollback();
                    flag = false;
                    msg  = "服务异常";
                    LogUtils.LogError("EventRegularAwardsService.SettingsTran", ex);
                }
            }
            catch (Exception ex)
            {
                flag = false;
                msg  = "服务异常";
                LogUtils.LogError("EventRegularAwardsService.Settings", ex);
            }
            return(flag);
        }