Esempio n. 1
0
        protected override async Task<Results> ThreadFrameCmdAsync(string command, ResultClass expectedResultClass, int threadId, uint frameLevel)
        {
            // first aquire an exclusive lock. This is used as we don't want to fight with other commands that also require the current
            // thread to be set to a particular value
            ExclusiveLockToken lockToken = await _debugger.CommandLock.AquireExclusive();

            try
            {
                await ThreadSelect(threadId, lockToken);
                await StackSelectFrame(frameLevel, lockToken);

                // Before we execute the provided command, we need to switch to a shared lock. This is because the provided
                // command may be an expression evaluation command which could be long running, and we don't want to hold the
                // exclusive lock during this.
                lockToken.ConvertToSharedLock();
                lockToken = null;

                return await _debugger.CmdAsync(command, expectedResultClass);
            }
            finally
            {
                if (lockToken != null)
                {
                    // finally is executing before we called 'ConvertToSharedLock'
                    lockToken.Close();
                }
                else
                {
                    // finally is called after we called ConvertToSharedLock, we need to decerement the shared lock count
                    _debugger.CommandLock.ReleaseShared();
                }
            }
        }
Esempio n. 2
0
        public override async Task<Results> VarCreate(string expression, int threadId, uint frameLevel, enum_EVALFLAGS dwFlags, ResultClass resultClass = ResultClass.done)
        {
            string command = string.Format("-var-create - - \"{0}\"", expression);  // use '-' to indicate that "--frame" should be used to determine the frame number
            Results results = await ThreadFrameCmdAsync(command, resultClass, threadId, frameLevel);

            return results;
        }
Esempio n. 3
0
        public override async Task<Results> VarListChildren(string variableReference, enum_DEBUGPROP_INFO_FLAGS dwFlags, ResultClass resultClass = ResultClass.done)
        {
            // This override is necessary because lldb treats any object with children as not a simple object.
            // This prevents char* and char** from returning a value when queried by -var-list-children
            // Limit the number of children expanded to 1000 in case memory is uninitialized
            string command = string.Format("-var-list-children --all-values \"{0}\" 0 1000", variableReference);
            Results results = await _debugger.CmdAsync(command, resultClass);

            return results;
        }
Esempio n. 4
0
 public Results ParseResultList(string listStr, ResultClass resultClass = ResultClass.None)
 {
     _resultString = listStr.Trim();
     return(ParseResultList(new Span(_resultString), resultClass));
 }
Esempio n. 5
0
        public override ResultClass MZ_Register(InputClass inputClass)//int registerId, string serialNO)
        {
            ResultClass resultClass = new ResultClass();

            resultDic.Clear();
            decimal personcount = inputClass.SInput.ContainsKey(InputType.Money) ? Tools.ToDecimal(inputClass.SInput[InputType.Money].ToString(), 0) : 0;
            int     registerId  = inputClass.SInput.ContainsKey(InputType.RegisterId) ? Tools.ToInt32(inputClass.SInput[InputType.RegisterId].ToString(), 0) : 0;
            string  serialNO    = inputClass.SInput.ContainsKey(InputType.SerialNO) ? inputClass.SInput[InputType.SerialNO].ToString() : "";

            try
            {
                //解析返回结果到类,保存信息
                MI_Register register = hisDao.Mz_Getregister(registerId, "");
                register.ValidFlag = 1;
                register.SerialNO  = serialNO;
                ResultClass regResultClass = hisDao.Mz_SaveRegister(register);
                //更新交易信息
                if (regResultClass.bSucess)
                {
                    MI_MedicalInsurancePayRecord medicalInsurancePayRecord = hisDao.Mz_GetPayRecord(1, register.ID.ToString(), 1, 0);
                    if (medicalInsurancePayRecord != null)
                    {
                        medicalInsurancePayRecord.PersonCount = personcount;
                        medicalInsurancePayRecord.state       = 1;
                        ResultClass recordResultClass = hisDao.Mz_SavePayRecord(medicalInsurancePayRecord);

                        if (recordResultClass.bSucess)
                        {   //返回数据到前台界面,只需金额
                            resultClass.bSucess = true;
                            //返回数据到前台界面,只需金额
                            resultDic.Add("personcount", personcount.ToString());
                            resultDic.Add("serialNO", serialNO);
                            resultDic.Add("tradeNo", medicalInsurancePayRecord.TradeNO);
                            resultDic.Add("invoiceNo", medicalInsurancePayRecord.FeeNO);
                        }
                        else
                        {
                            resultClass.bSucess  = false;
                            resultClass.sRemarks = "更新交易信息失败!";
                        }
                    }
                    else
                    {
                        resultClass.bSucess  = false;
                        resultClass.sRemarks = "未获取到交易数据!";
                    }
                }
                else
                {
                    resultClass.bSucess  = false;
                    resultClass.sRemarks = "更新登记信息失败!";
                }
                resultClass.oResult = resultDic;
            }
            catch (Exception e)
            {
                resultClass.bSucess  = false;
                resultClass.sRemarks = "更新中间表数据报错:" + e.Message;
            }
            return(resultClass);
        }
        public async Task<Results> VarEvaluateExpression(string variableName, ResultClass resultClass = ResultClass.done)
        {
            string command = string.Format(@"-var-evaluate-expression {0}", variableName);
            Results results = await _debugger.CmdAsync(command, resultClass);

            return results;
        }
        protected override async Task<Results> ThreadFrameCmdAsync(string command, ResultClass exepctedResultClass, int threadId, uint frameLevel)
        {
            string threadFrameCommand = string.Format(@"{0} --thread {1} --frame {2}", command, threadId, frameLevel);

            return await _debugger.CmdAsync(threadFrameCommand, exepctedResultClass);
        }
Esempio n. 8
0
 public virtual async Task<Results> BreakInsert(string functionName, string condition, ResultClass resultClass = ResultClass.done)
 {
     StringBuilder cmd = BuildBreakInsert(condition);
     // TODO: Add support of break function type filename:function locations
     cmd.Append(functionName);
     return await _debugger.CmdAsync(cmd.ToString(), resultClass);
 }
 public async Task ExecFinish(int threadId, ResultClass resultClass = ResultClass.running)
 {
     string command = "-exec-finish";
     await ThreadCmdAsync(command, resultClass, threadId);
 }
Esempio n. 10
0
        public override async Task <Results> VarCreate(string expression, int threadId, uint frameLevel, enum_EVALFLAGS dwFlags, ResultClass resultClass = ResultClass.done)
        {
            string  quoteEscapedExpression = EscapeQuotes(expression);
            string  command = string.Format("-var-create - - \"{0}\"", quoteEscapedExpression); // use '-' to indicate that "--frame" should be used to determine the frame number
            Results results = await ThreadFrameCmdAsync(command, resultClass, threadId, frameLevel);

            return(results);
        }
Esempio n. 11
0
 public override async Task Catch(string name, bool onlyOnce = false, ResultClass resultClass = ResultClass.done)
 {
     string command = onlyOnce ? "tcatch " : "catch ";
     await _debugger.ConsoleCmdAsync(command + name);
 }
Esempio n. 12
0
        protected override async Task <Results> ThreadCmdAsync(string command, ResultClass expectedResultClass, int threadId)
        {
            string threadCommand = string.Format(@"{0} --thread {1}", command, threadId);

            return(await _debugger.CmdAsync(threadCommand, expectedResultClass));
        }
Esempio n. 13
0
 public override Task Catch(string name, bool onlyOnce = false, ResultClass resultClass = ResultClass.done)
 {
     throw new NotImplementedException("lldb catch command");
 }
Esempio n. 14
0
        public override ResultClass MZ_PreviewRegister(InputClass inputClass)//int registerId, string serialNO)
        {
            ResultClass resultClass = new ResultClass();

            try
            {
                resultDic.Clear();
                MI_Register register = JsonHelper.DeserializeJsonToObject <MI_Register>(inputClass.SInput[InputType.MI_Register].ToString());
                MI_MedicalInsurancePayRecord medicalInsurancePayRecord = JsonHelper.DeserializeJsonToObject <MI_MedicalInsurancePayRecord>(inputClass.SInput[InputType.MI_MedicalInsurancePayRecord].ToString());
                MI_MIPayRecordHead           mIPayRecordHead           = JsonHelper.DeserializeJsonToObject <MI_MIPayRecordHead>(inputClass.SInput[InputType.MI_MIPayRecordHead].ToString());
                List <MI_MIPayRecordDetail>  mIPayRecordDetailList     = JsonHelper.DeserializeJsonToList <MI_MIPayRecordDetail>(inputClass.SInput[InputType.MI_MIPayRecordDetailList].ToString());
                AddLog("解析完成,开始保存登记信息");
                register.SocialCreateNum = medicalInsurancePayRecord.TradeNO;
                //获取通过病人类型获取MIID
                MI_MedicalInsuranceType medicalInsuranceType = hisDao.Mz_GetMITypeInfo(register.MedicalClass);
                if (medicalInsuranceType != null && medicalInsuranceType.ID > 0)
                {
                    register.MIID        = medicalInsuranceType.ID;
                    register.PatientType = medicalInsuranceType.ID;
                    ResultClass regResultClass = hisDao.Mz_SaveRegister(register);
                    if (regResultClass.bSucess)
                    {
                        MI_Register registerResult = regResultClass.oResult as MI_Register;
                        AddLog("保存登记完成,开始保存交易信息");
                        medicalInsurancePayRecord.RegId = registerResult.ID;

                        MI_MedicalInsurancePayRecord medicalInsurancePayRecordResult = hisDao.SaveTradeInfo(medicalInsurancePayRecord, mIPayRecordHead, mIPayRecordDetailList);
                        AddLog("保存交易信息完成,开始返回");
                        if (medicalInsurancePayRecordResult.ID > 0)
                        {
                            //返回数据到前台界面,只需金额
                            resultDic.Add("Id", registerResult.ID.ToString());
                            resultDic.Add("tradeno", medicalInsurancePayRecord.TradeNO);
                            resultDic.Add("FeeAll", medicalInsurancePayRecord.FeeAll.ToString());
                            resultDic.Add("fund", medicalInsurancePayRecord.FeeFund.ToString());
                            resultDic.Add("cash", medicalInsurancePayRecord.FeeCash.ToString());
                            resultDic.Add("personcountpay", medicalInsurancePayRecord.PersonCountPay.ToString());
                            resultClass.bSucess = true;
                            resultClass.oResult = resultDic;
                        }
                        else
                        {
                            resultClass.bSucess  = false;
                            resultClass.sRemarks = "保存交易数据失败,返回ID为零";
                            resultClass.oResult  = null;;
                        }
                    }
                    else
                    {
                        AddLog("开始保存登记失败");
                        resultClass.bSucess  = false;
                        resultClass.sRemarks = regResultClass.sRemarks;
                        resultClass.oResult  = null;;
                    }
                }
                else
                {
                    resultClass.bSucess  = false;
                    resultClass.sRemarks = "找不到病人类型的医保类型表数据!";
                    resultClass.oResult  = null;;
                }
            }
            catch (Exception e)
            {
                resultClass.bSucess  = false;
                resultClass.sRemarks = e.Message;
            }
            return(resultClass);
        }
Esempio n. 15
0
        /// <summary>
        /// 确认取消收费
        /// </summary>
        /// <param name="inputClass"></param>
        /// <returns></returns>
        public override ResultClass MZ_CancelChargeCommit(InputClass inputClass)//)
        {
            ResultClass resultClass = new ResultClass();

            try
            {
                resultDic.Clear();
                decimal personcount = inputClass.SInput.ContainsKey(InputType.Money) ? Tools.ToDecimal(inputClass.SInput[InputType.Money].ToString(), 0) : 0;
                string  fph         = inputClass.SInput.ContainsKey(InputType.InvoiceNo) ? inputClass.SInput[InputType.InvoiceNo].ToString() : "";

                MI_MedicalInsurancePayRecord medicalInsurancePayRecordOld = hisDao.Mz_GetPayRecord(2, fph, 2, 1);
                if (medicalInsurancePayRecordOld != null)
                {
                    //更新原交易表
                    medicalInsurancePayRecordOld.state = 3;
                    hisDao.Mz_SavePayRecord(medicalInsurancePayRecordOld);
                    //更新新交易表
                    MI_MedicalInsurancePayRecord medicalInsurancePayRecordNew = hisDao.Mz_GetPayRecord(2, fph, 2, 5);
                    if (medicalInsurancePayRecordNew != null)
                    {
                        medicalInsurancePayRecordNew.state          = 2;
                        medicalInsurancePayRecordNew.FeeNO          = "";
                        medicalInsurancePayRecordNew.PersonCount    = personcount;
                        medicalInsurancePayRecordNew.PersonCountPay = medicalInsurancePayRecordOld.PersonCountPay * -1;
                        hisDao.Mz_SavePayRecord(medicalInsurancePayRecordNew);
                    }

                    #region 返回结果用于打印
                    MI_MIPayRecordHead mIPayRecordHeadResult = hisDao.Mz_GetPayRecordHead(medicalInsurancePayRecordNew.ID);
                    DataTable          dtPayrecordDetail     = hisDao.Mz_GetPayRecordDetailForPrint(medicalInsurancePayRecordNew.ID);

                    List <MI_MedicalInsurancePayRecord> result1 = new List <MI_MedicalInsurancePayRecord>();
                    result1.Add(medicalInsurancePayRecordNew);
                    DataTable dtPayrecord = ConvertExtend.ToDataTable(result1);

                    List <MI_MIPayRecordHead> result2 = new List <MI_MIPayRecordHead>();
                    result2.Add(mIPayRecordHeadResult);
                    DataTable dtPayrecordHead = ConvertExtend.ToDataTable(result2);

                    List <DataTable> objects = new List <DataTable>();
                    objects.Add(dtPayrecord);
                    objects.Add(dtPayrecordHead);
                    objects.Add(dtPayrecordDetail);
                    //返回数据到前台界面,只需金额
                    resultClass.oResult = objects;
                    #endregion

                    resultClass.bSucess = true;
                }
                else
                {
                    resultClass.bSucess  = false;
                    resultClass.sRemarks = "更新登记信息失败!";
                }
            }
            catch (Exception e)
            {
                resultClass.bSucess  = false;
                resultClass.sRemarks = e.Message;
            }
            return(resultClass);
        }
Esempio n. 16
0
        /// <summary>
        /// 确认取消挂号
        /// </summary>
        /// <param name="inputClass"></param>
        /// <returns></returns>
        public override ResultClass MZ_CancelRegisterCommit(InputClass inputClass)//)
        {
            ResultClass resultClass = new ResultClass();

            try
            {
                resultDic.Clear();
                decimal personcount    = inputClass.SInput.ContainsKey(InputType.Money) ? Tools.ToDecimal(inputClass.SInput[InputType.Money].ToString(), 0) : 0;
                int     registerId     = inputClass.SInput.ContainsKey(InputType.RegisterId) ? Tools.ToInt32(inputClass.SInput[InputType.RegisterId].ToString(), 0) : 0;
                string  serialNO       = inputClass.SInput.ContainsKey(InputType.SerialNO) ? inputClass.SInput[InputType.SerialNO].ToString() : "";
                int     iTradeRecordId = inputClass.SInput.ContainsKey(InputType.TradeRecordId) ? Tools.ToInt32(inputClass.SInput[InputType.TradeRecordId].ToString(), 0) : 0;

                MI_Register register = hisDao.Mz_Getregister(registerId, serialNO);
                register.ValidFlag = 2;
                //更新登记表
                ResultClass regResultClass = hisDao.Mz_SaveRegister(register);
                //更新原交易表
                MI_MedicalInsurancePayRecord medicalInsurancePayRecordOld = hisDao.Mz_GetPayRecord(1, register.ID.ToString(), 1, 1);
                if (medicalInsurancePayRecordOld != null)
                {
                    medicalInsurancePayRecordOld.state = 3;
                    hisDao.Mz_SavePayRecord(medicalInsurancePayRecordOld);

                    MI_MedicalInsurancePayRecord medicalInsurancePayRecordNew = hisDao.Mz_GetPayRecord(0, iTradeRecordId.ToString(), 1, 0);
                    if (medicalInsurancePayRecordNew != null)
                    {
                        //medicalInsurancePayRecordNew.FeeNO = medicalInsurancePayRecordOld.FeeNO;
                        medicalInsurancePayRecordNew.state          = 2;
                        medicalInsurancePayRecordNew.PersonCount    = personcount;
                        medicalInsurancePayRecordNew.PersonCountPay = Convert.ToDecimal(medicalInsurancePayRecordOld.PersonCountPay) * -1;
                        hisDao.Mz_SavePayRecord(medicalInsurancePayRecordNew);
                    }

                    MI_MIPayRecordHead mIPayRecordHead   = hisDao.Mz_GetPayRecordHead(medicalInsurancePayRecordNew.ID);
                    DataTable          dtPayrecordDetail = hisDao.Mz_GetPayRecordDetailForPrint(medicalInsurancePayRecordNew.ID);

                    List <MI_MedicalInsurancePayRecord> result1 = new List <MI_MedicalInsurancePayRecord>();
                    result1.Add(medicalInsurancePayRecordNew);
                    DataTable dtPayrecord = ConvertExtend.ToDataTable(result1);

                    List <MI_MIPayRecordHead> result2 = new List <MI_MIPayRecordHead>();
                    result2.Add(mIPayRecordHead);
                    DataTable dtPayrecordHead = ConvertExtend.ToDataTable(result2);

                    List <DataTable> objects = new List <DataTable>();
                    objects.Add(dtPayrecord);
                    objects.Add(dtPayrecordHead);
                    objects.Add(dtPayrecordDetail);

                    resultClass.bSucess = true;
                    resultClass.oResult = objects;
                }
                else
                {
                    resultClass.bSucess  = false;
                    resultClass.sRemarks = "更新登记信息失败!";
                }
            }
            catch (Exception e)
            {
                resultClass.bSucess  = false;
                resultClass.sRemarks = e.Message;
            }
            return(resultClass);
        }
Esempio n. 17
0
 public virtual async Task<Results> BreakInsert(ulong codeAddress, string condition, ResultClass resultClass = ResultClass.done)
 {
     StringBuilder cmd = BuildBreakInsert(condition);
     cmd.Append('*');
     cmd.Append(codeAddress);
     return await _debugger.CmdAsync(cmd.ToString(), resultClass);
 }
Esempio n. 18
0
        public override async Task <Results> VarListChildren(string variableReference, enum_DEBUGPROP_INFO_FLAGS dwFlags, ResultClass resultClass = ResultClass.done)
        {
            // This override is necessary because lldb treats any object with children as not a simple object.
            // This prevents char* and char** from returning a value when queried by -var-list-children
            // Limit the number of children expanded to 1000 in case memory is uninitialized
            string  command = string.Format("-var-list-children --all-values \"{0}\" 0 1000", variableReference);
            Results results = await _debugger.CmdAsync(command, resultClass);

            return(results);
        }
Esempio n. 19
0
 public abstract Task Catch(string name, bool onlyOnce = false, ResultClass resultClass = ResultClass.done);
Esempio n. 20
0
        protected override async Task <Results> ThreadFrameCmdAsync(string command, ResultClass exepctedResultClass, int threadId, uint frameLevel)
        {
            string threadFrameCommand = string.Format(@"{0} --thread {1} --frame {2}", command, threadId, frameLevel);

            return(await _debugger.CmdAsync(threadFrameCommand, exepctedResultClass));
        }
Esempio n. 21
0
 public void Set(ResultClass target, float value, bool isBuff)
 {
     this.target = target;
     this.value  = value;
     this.isBuff = isBuff;
 }
    IEnumerator GetWifi()
    {
        connecting.gameObject.SetActive(false);
        fetchingData.gameObject.SetActive(true);
        UnityWebRequest www = UnityWebRequest.Get("http://192.168.240.1/wifi/scan");

        //yield return new WaitForSeconds(3);
        yield return(www.SendWebRequest());

        www.Abort();
        www = UnityWebRequest.Get("http://192.168.240.1/wifi/scan");
        yield return(www.SendWebRequest());


        if (www.isNetworkError || www.isHttpError)
        {
            Debug.Log(www.error);
        }
        else
        {
            ResultClass result = JsonConvert.DeserializeObject <ResultClass>(www.downloadHandler.text);
            // Show results as text
            Debug.Log(www.downloadHandler.text);
            Array.Sort(result.result.Aps);

            for (int x = 0; x < 4 && x < result.result.Aps.Length; x++)
            {
                float size = 0;
                if (Single.TryParse(result.result.Aps[x].rssi, out size))
                {
                    if (size > -20)
                    {
                        continue;
                    }
                    size          = (size + 100f) * 1.2f;
                    size         /= 100f;
                    texts[x].text = result.result.Aps[x].essid;
                    aps[x].SetActive(true);
                    texts[x].gameObject.SetActive(true);

                    switch (result.result.Aps[x].enc)
                    {
                    case "WEP":
                        aps[x].transform.GetChild(0).GetComponent <Renderer>().material = WepMaterial;
                        break;

                    case "WPA":
                        aps[x].transform.GetChild(0).GetComponent <Renderer>().material = WpaMaterial;
                        break;

                    case "WPA2":
                        aps[x].transform.GetChild(0).GetComponent <Renderer>().material = Wpa2Material;
                        break;

                    case "None":
                        aps[x].transform.GetChild(0).GetComponent <Renderer>().material = NoneMaterial;
                        break;

                    case "Auto":
                        aps[x].transform.GetChild(0).GetComponent <Renderer>().material = AutoMaterial;
                        break;
                    }
                }
                aps[x].transform.localScale = new Vector3(size, 1f, 1f);
            }
        }
        fetchingData.gameObject.SetActive(false);
    }
Esempio n. 23
0
        public override async Task<Results> VarListChildren(string variableReference, enum_DEBUGPROP_INFO_FLAGS dwFlags, ResultClass resultClass = ResultClass.done)
        {
            string command = string.Format("-var-list-children --simple-values \"{0}\" --propertyInfoFlags {1}", variableReference, (uint)dwFlags);
            Results results = await _debugger.CmdAsync(command, resultClass);

            return results;
        }
Esempio n. 24
0
 public Results(ResultClass resultsClass, List <NamedResultValue> list = null)
     : base(list ?? new List <NamedResultValue>())
 {
     ResultClass = resultsClass;
 }
Esempio n. 25
0
        public virtual async Task<Results> VarCreate(string expression, int threadId, uint frameLevel, ResultClass resultClass = ResultClass.done)
        {
            string command = string.Format("-var-create - * \"{0}\"", expression);
            Results results = await ThreadFrameCmdAsync(command, resultClass, threadId, frameLevel);

            return results;
        }
Esempio n. 26
0
 public WaitingOperationDescriptor(string command, ResultClass expectedResultClass)
 {
     this.Command         = command;
     _expectedResultClass = expectedResultClass;
     StartTime            = DateTime.Now;
 }
Esempio n. 27
0
 abstract protected Task<Results> ThreadFrameCmdAsync(string command, ResultClass exepctedResultClass, int threadId, uint frameLevel);
Esempio n. 28
0
        private Task<Results> CmdBreakUnix(int debugeePid, ResultClass expectedResultClass)
        {
            // Send sigint to the debuggee process. This is the equivalent of hitting ctrl-c on the console.
            // This will cause gdb to async-break. This is necessary because gdb does not support async break
            // when attached.
            const int sigint = 2;
            UnixNativeMethods.Kill(debugeePid, sigint);

            return Task.FromResult<Results>(new Results(ResultClass.done));
        }
Esempio n. 29
0
        public async Task<Results> StackInfoDepth(int threadId, int maxDepth = 1000, ResultClass resultClass = ResultClass.done)
        {
            string command = string.Format(@"-stack-info-depth {0}", maxDepth);
            Results results = await ThreadCmdAsync(command, resultClass, threadId);

            return results;
        }
Esempio n. 30
0
        public virtual async Task<Results> VarListChildren(string variableReference, enum_DEBUGPROP_INFO_FLAGS dwFlags, ResultClass resultClass = ResultClass.done)
        {
            // Limit the number of children expanded to 1000 in case memory is uninitialized
            string command = string.Format("-var-list-children --simple-values \"{0}\" 0 1000", variableReference);
            Results results = await _debugger.CmdAsync(command, resultClass);

            return results;
        }
Esempio n. 31
0
        public async Task ExecFinish(int threadId, ResultClass resultClass = ResultClass.running)
        {
            string command = "-exec-finish";

            await ThreadFrameCmdAsync(command, resultClass, threadId, 0);
        }
Esempio n. 32
0
        // POST api/validatestaff
        public ResultClass Post([FromBody] LoginUser value)
        {
            ResultClass Result = new ResultClass();

            Result.Message = "User is not valid";
            Result.Status  = false;
            Result.Result  = 0;

            if (value != null)
            {
                if ((!string.IsNullOrWhiteSpace(value.Email) || !string.IsNullOrWhiteSpace(value.Phone)) && !string.IsNullOrWhiteSpace(value.Password))
                {
                    DataSet ds = InstallUserBLL.Instance.CheckRegistration(value.Email.Trim(), value.Phone.Trim());
                    if (ds != null && ds.Tables[0].Rows.Count > 0)
                    {
                        value.FirstName = ds.Tables[0].Rows[0]["FristName"].ToString().Trim();
                        value.LastName  = ds.Tables[0].Rows[0]["LastName"].ToString().Trim();
                        value.ID        = Convert.ToInt32(ds.Tables[0].Rows[0]["Id"].ToString().Trim());

                        if (string.IsNullOrWhiteSpace(value.Email))
                        {
                            value.Email = ds.Tables[0].Rows[0]["Email"].ToString().Trim();
                        }

                        int IsValidInstallerUser = InstallUserBLL.Instance.IsValidInstallerUser(value.Email.Trim(), value.Password);
                        if (IsValidInstallerUser > 0)
                        {
                            var OTP = JGCommon.GenerateOTP(6);

                            int res = InstallUserBLL.Instance.InsertUserOTP(value.ID, 1, OTP);

                            if (res > 0)
                            {
                                string str_Body = "<table><tr><td>Hello,<span style=\"background-color: orange;\">User</span></td></tr><tr><td>your OTP for access api : " + OTP;
                                str_Body = str_Body + "</td></tr>";
                                str_Body = str_Body + "<tr><td></td></tr>";
                                str_Body = str_Body + "<tr><td>Thanks & Regards.</td></tr>";
                                str_Body = str_Body + "<tr><td><span style=\"background-color: orange;\">JM Grove Constructions</span></td></tr></table>";

                                CommonFunction.SendEmail("", value.Email, "JM Grove Construction:API OTP", str_Body, new List <Attachment>());

                                Result.Message = "User is valid and OTP is generated";
                                Result.Status  = true;
                                Result.Result  = 1;
                            }
                            else
                            {
                                Result.Message = "User is valid but OTP is not generated";
                            }
                        }
                        else
                        {
                            Result.Message = "Password is incorrect";
                        }
                    }
                    else
                    {
                        Result.Message = "Please check your user details";
                    }
                }
            }

            return(Result);
        }
Esempio n. 33
0
 public WaitingOperationDescriptor(string command, ResultClass expectedResultClass)
 {
     this.Command = command;
     _expectedResultClass = expectedResultClass;
     StartTime = DateTime.Now;
 }
Esempio n. 34
0
        public async Task ExecNextInstruction(int threadId, ResultClass resultClass = ResultClass.running)
        {
            string command = "-exec-next-instruction";

            await ThreadFrameCmdAsync(command, resultClass, threadId, 0);
        }
Esempio n. 35
0
        public virtual async Task<Results> BreakInsert(string filename, uint line, string condition, IEnumerable<Checksum> checksums = null, ResultClass resultClass = ResultClass.done)
        {
            StringBuilder cmd = BuildBreakInsert(condition);

            if (checksums != null && checksums.Count() != 0)
            {
                cmd.Append(Checksum.GetMIString(checksums));
                cmd.Append(" ");
            }

            cmd.Append(filename);
            cmd.Append(":");
            cmd.Append(line.ToString());

            return await _debugger.CmdAsync(cmd.ToString(), resultClass);
        }
Esempio n. 36
0
        // Calls to VarCreate will change the current debugger thread and frame selection to what is passed in. This is because it needs to be queried in the context of a thread/frame id.
        public virtual async Task <Results> VarCreate(string expression, int threadId, uint frameLevel, enum_EVALFLAGS dwFlags, ResultClass resultClass = ResultClass.done)
        {
            string  quoteEscapedExpression = EscapeQuotes(expression);
            string  command = string.Format("-var-create - * \"{0}\"", quoteEscapedExpression);
            Results results = await ThreadFrameCmdAsync(command, resultClass, threadId, frameLevel);

            return(results);
        }
Esempio n. 37
0
 public virtual Task<Results> BreakWatch(string address, uint size, ResultClass resultClass = ResultClass.done)
 {
     throw new NotImplementedException();
 }
Esempio n. 38
0
        public virtual async Task <Results> VarListChildren(string variableReference, enum_DEBUGPROP_INFO_FLAGS dwFlags, ResultClass resultClass = ResultClass.done)
        {
            // Limit the number of children expanded to 1000 in case memory is uninitialized
            string  command = string.Format("-var-list-children --simple-values \"{0}\" 0 1000", variableReference);
            Results results = await _debugger.CmdAsync(command, resultClass);

            return(results);
        }
Esempio n. 39
0
        public virtual async Task<Results> SetOption(string variable, string value, ResultClass resultClass = ResultClass.done)
        {
            string command = string.Format("-gdb-set {0} {1}", variable, value);
            Results results = await _debugger.CmdAsync(command, resultClass);

            return results;
        }
Esempio n. 40
0
        public virtual async Task <Results> BreakInsert(string filename, bool useUnixFormat, uint line, string condition, bool enabled, IEnumerable <Checksum> checksums = null, ResultClass resultClass = ResultClass.done)
        {
            StringBuilder cmd = await BuildBreakInsert(condition, enabled);

            if (checksums != null && checksums.Count() != 0)
            {
                cmd.Append(Checksum.GetMIString(checksums));
                cmd.Append(" ");
            }

            string filenameMI;
            bool   quotes = PreparePath(filename, useUnixFormat, out filenameMI);

            if (quotes)
            {
                cmd.Append("\"");
            }
            cmd.Append(filenameMI);
            cmd.Append(":");
            cmd.Append(line.ToString());
            if (quotes)
            {
                cmd.Append("\"");
            }

            return(await _debugger.CmdAsync(cmd.ToString(), resultClass));
        }
Esempio n. 41
0
 public override async Task<Results> BreakWatch(string address, uint size, ResultClass resultClass = ResultClass.done)
 {
     string cmd = string.Format(CultureInfo.InvariantCulture, "-break-watch *({0}*)({1})", TypeBySize(size), address);
     return await _debugger.CmdAsync(cmd.ToString(), resultClass);
 }
Esempio n. 42
0
        public virtual async Task <Results> BreakInsert(string functionName, string condition, bool enabled, ResultClass resultClass = ResultClass.done)
        {
            StringBuilder cmd = await BuildBreakInsert(condition, enabled);

            // TODO: Add support of break function type filename:function locations
            cmd.Append(functionName);
            return(await _debugger.CmdAsync(cmd.ToString(), resultClass));
        }
Esempio n. 43
0
 public virtual async Task<Results> BreakInsert(string filename, uint line, string condition, ResultClass resultClass = ResultClass.done)
 {
     StringBuilder cmd = BuildBreakInsert(condition);
     cmd.Append(filename);
     cmd.Append(":");
     cmd.Append(line.ToString());
     return await _debugger.CmdAsync(cmd.ToString(), resultClass);
 }
Esempio n. 44
0
        public virtual async Task <Results> BreakInsert(ulong codeAddress, string condition, bool enabled, ResultClass resultClass = ResultClass.done)
        {
            StringBuilder cmd = await BuildBreakInsert(condition, enabled);

            cmd.Append('*');
            cmd.Append(codeAddress);
            return(await _debugger.CmdAsync(cmd.ToString(), resultClass));
        }
Esempio n. 45
0
        public override async Task<Results> VarCreate(string expression, int threadId, uint frameLevel, enum_EVALFLAGS dwFlags, ResultClass resultClass = ResultClass.done)
        {
            string command = string.Format("-var-create - * \"{0}\" --evalFlags {1}", expression, (uint)dwFlags);
            Results results = await ThreadFrameCmdAsync(command, resultClass, threadId, frameLevel);

            return results;
        }
Esempio n. 46
0
 public virtual Task <Results> BreakWatch(string address, uint size, ResultClass resultClass = ResultClass.done)
 {
     throw new NotImplementedException();
 }
        public bool Start(string schedule_code)
        {
            if (string.IsNullOrEmpty(schedule_code))
            {
                return false;
            }
            MailModel mailModel = new MailModel();
            mailModel.MysqlConnectionString = mySqlConnectionString;

            string GroupCode = string.Empty;
            string MailTitle = string.Empty;
            string MailBody = string.Empty;
            bool IsSeparate = false;
            bool IsDisplyName = true;
            string requestUrl = string.Empty;
            try
            {               
                //獲取該排程參數
                List<ScheduleConfigQuery> store_config = new List<ScheduleConfigQuery>();
                ScheduleConfigQuery query_config = new ScheduleConfigQuery();
                query_config.schedule_code = schedule_code;
                _secheduleServiceMgr = new ScheduleServiceMgr(mySqlConnectionString);
                store_config = _secheduleServiceMgr.GetScheduleConfig(query_config);
                #region mailhelp賦值
                foreach (ScheduleConfigQuery item in store_config)
                {
                    if (item.parameterCode.Equals("MailFromAddress"))
                    {
                        mailModel.MailFromAddress = item.value;
                    }
                    else if (item.parameterCode.Equals("MailHost"))
                    {
                        mailModel.MailHost = item.value;
                    }
                    else if (item.parameterCode.Equals("MailPort"))
                    {
                        mailModel.MailPort = item.value;
                    }
                    else if (item.parameterCode.Equals("MailFromUser"))
                    {
                        mailModel.MailFromUser = item.value;
                    }
                    else if (item.parameterCode.Equals("EmailPassWord"))
                    {
                        mailModel.MailFormPwd = item.value;
                    }
                    else if (item.parameterCode.Equals("GroupCode"))
                    {
                        GroupCode = item.value;
                    }
                    else if (item.parameterCode.Equals("MailTitle"))
                    {
                        MailTitle = item.value;
                    }
                    else if (item.parameterCode.Equals("MailTitle"))
                    {
                        MailTitle = item.value;
                    }
                    else if (item.parameterCode.Equals("requestUrl"))
                    {
                        requestUrl = item.value;
                    }
                    //else if (item.parameterCode.Equals("MailBody"))
                    //{
                    //    MailBody = item.value;
                    //}
                    //else if (item.parameterCode.Equals("IsSeparate"))
                    //{
                    //    if (item.value.ToString().Trim().ToLower() == "false")
                    //    {
                    //        IsSeparate = false;
                    //    }
                    //    else if (item.value.ToString().Trim().ToLower() == "true")
                    //    {
                    //        IsSeparate = true;
                    //    }
                    //}
                    //else if (item.parameterCode.Equals("IsDisplyName"))
                    //{
                    //    if (item.value.ToString().Trim().ToLower() == "false")
                    //    {
                    //        IsDisplyName = false;
                    //    }
                    //    else if (item.value.ToString().Trim().ToLower() == "true")
                    //    {
                    //        IsDisplyName = true;
                    //    }
                    //}
                }
                #endregion

                int result = 0;
                int resultmes = 0;
                
                StringBuilder str = new StringBuilder();
                StringBuilder sqlstrall = new StringBuilder();
                InvoiceWinningNumberDao invoiceWinningNumberDao = new InvoiceWinningNumberDao(mySqlConnectionString);


                #region 獲取網頁里的數據,轉化成json字符串
                string urlone = "https://www.einvoice.nat.gov.tw/PB2CAPIVAN/invapp/InvApp?version=0.2&action=QryWinningList&invTerm=";
                string urltwo = "&appID=EINV5201502271601";
                string dateone = string.Empty;
                if (DateTime.Now.Month >= 10)
                {
                    if (DateTime.Now.Month == 11)
                    {
                        dateone = (DateTime.Now.Year - 1911).ToString() + (DateTime.Now.Month - 1);
                    }
                    else
                    {
                        dateone = (DateTime.Now.Year - 1911).ToString() + DateTime.Now.Month;
                    }
                }
                else if (DateTime.Now.Month == 1)
                {
                    dateone = (DateTime.Now.AddMonths(-1).Year - 1911).ToString() + "12";
                }
                else
                {
                    if (DateTime.Now.Month % 2 == 1)
                    {
                        dateone = (DateTime.Now.Year - 1911).ToString() + "0" + (DateTime.Now.Month - 1);
                    }
                    else
                    {
                        dateone = (DateTime.Now.Year - 1911).ToString() + "0" + DateTime.Now.Month;
                    }
                }
                string url = string.Empty;
                if (requestUrl.Trim() == string.Empty)
                {
                    url = urlone + dateone + urltwo;
                }
                else
                {
                    url = requestUrl;
                }                              

                string json = GetPage(url, "utf-8");
                ResultClass rc = new ResultClass();               
                #endregion

                MailHelper mail = new MailHelper(mailModel);
                int year = 0;
                int month = 0;
                string[,] strarray = new string[,]{};
                bool isHaveInfo = false;
                try//判斷如果出錯發郵件
                {
                    rc = JsonConvert.DeserializeObject<ResultClass>(json); 
                    year = Convert.ToInt32(rc.invoYm.Substring(0, 3));
                    month = Convert.ToInt32(rc.invoYm.Substring(3, 2));


                    strarray = new string[20,2] { { "superPrizeNo", rc.superPrizeNo }, { "spcPrizeNo", rc.spcPrizeNo }, { "spcPrizeNo2", rc.spcPrizeNo2 }, 
                                                  { "spcPrizeNo3", rc.spcPrizeNo3 }, { "firstPrizeNo1", rc.firstPrizeNo1 }, { "firstPrizeNo2", rc.firstPrizeNo2 }, 
                                                  { "firstPrizeNo3", rc.firstPrizeNo3 }, { "firstPrizeNo4", rc.firstPrizeNo4 }, { "firstPrizeNo5", rc.firstPrizeNo5 },
                                                  { "firstPrizeNo6", rc.firstPrizeNo6 }, { "firstPrizeNo7", rc.firstPrizeNo7 }, { "firstPrizeNo8", rc.firstPrizeNo8 }, 
                                                  { "firstPrizeNo9", rc.firstPrizeNo9 }, { "firstPrizeNo10", rc.firstPrizeNo10 }, { "sixthPrizeNo1", rc.sixthPrizeNo1 },
                                                  { "sixthPrizeNo2", rc.sixthPrizeNo2 }, { "sixthPrizeNo3", rc.sixthPrizeNo3 }, { "sixthPrizeNo4", rc.sixthPrizeNo4 }, 
                                                  { "sixthPrizeNo5", rc.sixthPrizeNo5 }, { "sixthPrizeNo6", rc.sixthPrizeNo6 } };
                    isHaveInfo = true;
                }
                catch (Exception ex)
                {
                    MailBody = "<p/><a href=" + url + ">" + url + "</a>" + " 該鏈接中未讀到數據!";                     
                    mail.SendToGroup(GroupCode, MailTitle, MailBody + " ", IsSeparate, IsDisplyName);
                    //throw new Exception(ex.Message);
                }
                if (isHaveInfo)//如果從鏈接中讀到數據
                {
                    for (int i = 0; i < strarray.GetLength(0); i++)
                    {
                        sqlstrall.AppendFormat(invoiceWinningNumberDao.ReturnInsertSql(year, month, strarray[i, 0].ToString(), strarray[i, 1].ToString()));
                    }
                    if (!string.IsNullOrEmpty(sqlstrall.ToString()))
                    {
                        result = invoiceWinningNumberDao.ResultOfExeInsertSql(sqlstrall.ToString());
                    }
                    else
                    {
                        resultmes = 1;//設置其大於0
                    }
                    if (result > 0)
                    {
                        MailBody = "<p/>執行成功";
                        mail.SendToGroup(GroupCode, MailTitle, MailBody + " ", IsSeparate, IsDisplyName);
                    }
                    else
                    {
                        if (resultmes > 0)
                        {
                            MailBody = "<p/>數據都已經存在";
                            mail.SendToGroup(GroupCode, MailTitle, MailBody + " ", IsSeparate, IsDisplyName);
                        }                       
                    }
                }             
            }
            catch (Exception ex)
            {
                MailHelper mail = new MailHelper(mailModel);
                MailBody = "<p/>執行失敗";
                mail.SendToGroup(GroupCode, MailTitle, MailBody + " ", IsSeparate, IsDisplyName);  
                throw new Exception("WinningInvoiceSynchronismMgr-->Start-->" + ex.Message);
            }
            return true;
        }
Esempio n. 48
0
 public virtual async Task BreakDelete(string bkptno, ResultClass resultClass = ResultClass.done)
 {
     await _debugger.CmdAsync("-break-delete " + bkptno, resultClass);
 }
Esempio n. 49
0
 public async Task ExecStepInstruction(int threadId, ResultClass resultClass = ResultClass.running)
 {
     string command = "-exec-step-instruction";
     await ThreadCmdAsync(command, resultClass, threadId);
 }
Esempio n. 50
0
 public abstract Task Catch(string name, bool onlyOnce = false, ResultClass resultClass = ResultClass.done);
Esempio n. 51
0
        public async Task<Results> VarSetFormat(string variableName, string format, ResultClass resultClass = ResultClass.done)
        {
            string command = string.Format(@"-var-set-format {0} {1}", variableName, format);
            Results results = await _debugger.CmdAsync(command, resultClass);

            return results;
        }
Esempio n. 52
0
 abstract protected Task <Results> ThreadFrameCmdAsync(string command, ResultClass expectedResultClass, int threadId, uint frameLevel);
Esempio n. 53
0
 public virtual async Task<Results> BreakInsert(string filename, uint line, string condition, ResultClass resultClass = ResultClass.done)
 {
     StringBuilder cmd = new StringBuilder("-break-insert -f ");
     if (condition != null)
     {
         cmd.Append("-c \"");
         cmd.Append(condition);
         cmd.Append("\" ");
     }
     cmd.Append(filename);
     cmd.Append(":");
     cmd.Append(line.ToString());
     return await _debugger.CmdAsync(cmd.ToString(), resultClass);
 }
Esempio n. 54
0
 abstract protected Task <Results> ThreadCmdAsync(string command, ResultClass expectedResultClass, int threadId);
Esempio n. 55
0
 abstract protected Task<Results> ThreadCmdAsync(string command, ResultClass expectedResultClass, int threadId);
Esempio n. 56
0
        public async Task <Results> StackInfoDepth(int threadId, int maxDepth = 1000, ResultClass resultClass = ResultClass.done)
        {
            string  command = string.Format(@"-stack-info-depth {0}", maxDepth);
            Results results = await ThreadCmdAsync(command, resultClass, threadId);

            return(results);
        }
Esempio n. 57
0
        protected override async Task<Results> ThreadCmdAsync(string command, ResultClass expectedResultClass, int threadId)
        {
            string threadCommand = string.Format(@"{0} --thread {1}", command, threadId);

            return await _debugger.CmdAsync(threadCommand, expectedResultClass);
        }
Esempio n. 58
0
        public async Task ExecNext(int threadId, ResultClass resultClass = ResultClass.running)
        {
            string command = "-exec-next";

            await ThreadCmdAsync(command, resultClass, threadId);
        }
Esempio n. 59
0
 private static bool TryGet(out ResultClass result)
 {
     result = null;
     return false;
 }
Esempio n. 60
0
        public virtual async Task <Results> BreakInsert(string filename, uint line, string condition, IEnumerable <Checksum> checksums = null, ResultClass resultClass = ResultClass.done)
        {
            StringBuilder cmd = BuildBreakInsert(condition);

            if (checksums != null && checksums.Count() != 0)
            {
                cmd.Append(Checksum.GetMIString(checksums));
                cmd.Append(" ");
            }

            cmd.Append(filename);
            cmd.Append(":");
            cmd.Append(line.ToString());

            return(await _debugger.CmdAsync(cmd.ToString(), resultClass));
        }