示例#1
0
        public string ResponseStatusre(string Success, string Message, string ErrorCode, string Information, string Position, string Apiusername, string eticket, string Apicode, string Remark)
        {
            this._1context();
            try
            {
                bool           isNew            = true;
                ResponseStatus ResponseStatusMS = isNew ? new ResponseStatus()
                {
                } : _context.Set <ResponseStatus>().SingleOrDefault();
                ResponseStatusMS.ApiCode      = Apicode;
                ResponseStatusMS.ApiFrom      = "";
                ResponseStatusMS.Remark       = Remark;
                ResponseStatusMS.Success      = Convert.ToInt32(Success);
                ResponseStatusMS.CreatDate    = DateTime.Now;
                ResponseStatusMS.CreatUser    = Apiusername;
                ResponseStatusMS.ModifiedDate = ResponseStatusMS.CreatDate;
                ResponseStatusMS.ModifiedUser = Apiusername;
                ResponseStatusMS.IsDel        = 0;
                ResponseStatusMS.IsLock       = 0;
                ResponseStatusMS.Errorcode    = Convert.ToInt32(ErrorCode);
                ResponseStatusMS.Infmation    = "";
                ResponseStatusMS.Message      = Message;
                ResponseStatusMS.Position     = Position;
                ResponseStatusMS.RSId         = 0;
                if (isNew)
                {
                    _context.Add(ResponseStatusMS);
                }
                _context.SaveChanges();
            }
            catch (Exception ex)
            {
                throw ex;
                //string exst = ex.ToString();
            }
            finally
            {
            }
            string str = "";

            if (Success == "1")
            {
                if (this.userticketchkex(Apiusername) == false)
                {
                    resetetcode(Apiusername, eticket);
                }
            }
            str = "{\"Succes\":\"" + Success + "\",\"Message\":\"" + Message + "\",\"ErrorCode\":\"" + ErrorCode + "\",\"Information\":\"" + Information + "\",\"Position\":\"" + Position + "\",\"Apiusername\":\"" + Apiusername + "\",\"Apiticket\":\"" + eticket + "\",\"Remark\":\"" + Remark + "\"}";
            return(str);
        }
        public string ResponseStatusre(string Success, string Message, string ErrorCode, string Information, string Position, string Apiusername, string eticket, string Apicode, string Remark)
        {
            try
            {
                ResponseStatus ResponseStatusMS = new ResponseStatus();
                ResponseStatusMS.ApiCode = Apicode;

                ResponseStatusMS.ApiFrom      = Request.HttpContext.Connection.RemoteIpAddress.ToString();
                ResponseStatusMS.ApiFrom      = "";
                ResponseStatusMS.Remark       = Remark;
                ResponseStatusMS.Success      = Convert.ToInt32(Success);
                ResponseStatusMS.CreatDate    = DateTime.Now;
                ResponseStatusMS.CreatUser    = Apiusername;
                ResponseStatusMS.ModifiedDate = ResponseStatusMS.CreatDate;
                ResponseStatusMS.ModifiedUser = Apiusername;
                ResponseStatusMS.IsDel        = 0;
                ResponseStatusMS.IsLock       = 0;
                ResponseStatusMS.Errorcode    = Convert.ToInt32(ErrorCode);
                ResponseStatusMS.Infmation    = "";
                ResponseStatusMS.Message      = Message;
                ResponseStatusMS.Position     = Position;
                ResponseStatusMS.RSId         = 0;
                context.Add(ResponseStatusMS);
                context.SaveChanges();
            }
            catch (Exception ex)
            {
                throw ex;
                //string exst = ex.ToString();
            }
            finally
            {
            }
            string str = "{\"Succes\":\"" + Success + "\",\"Message\":\"" + Message + "\",\"ErrorCode\":\"" + ErrorCode + "\",\"Information\":\"" + Information + "\",\"Position\":\"" + Position + "\",\"Apiusername\":\"" + Apiusername + "\"}";

            if (eticket != "")
            {
                str = "{\"Succes\":\"" + Success + "\",\"Message\":\"" + Message + "\",\"ErrorCode\":\"" + ErrorCode + "\",\"Information\":\"" + Information + "\",\"Position\":\"" + Position + "\",\"Apiusername\":\"" + Apiusername + "\",\"Ticket\":\"" + eticket + "\"}";
            }
            return(str);
        }