Exemple #1
0
        private void Save2Log(Model.M_Sys_Log ety)
        {
            CRUD biz2 = new CRUD(DbVendor.Oracle, Runtime.OracleConnStrLocal, true);

            try
            {
                biz2.Create(ety);
                biz2.Commit();
            }
            catch (Exception err)
            {
                biz2.Abort();
                throw err;
            }
        }
Exemple #2
0
        public string InvokeRequest(string postStr)
        {
            Model.Rsp32 rsp = new Model.Rsp32();

            try
            {
                Helper.LogWrite("SI32 Request:" + postStr);
                this.req = Common.Helper.JsonDeserialize <Model.Req32>(postStr);

                /// 1 取指定用户基本信息
                List <Model.M_Sys_Login_Account> etyLst = this.GetLogUser();

                /// 2 生成临时密码/验证码,并写入log
                if (etyLst.Count > 0)
                {
                    string          tmpStr = System.Guid.NewGuid().ToString().Substring(0, 6);
                    Model.M_Sys_Log ety    = new Model.M_Sys_Log();
                    ety.CreateDate = DateTime.Parse(Helper.Today);
                    ety.LogId      = GetLogId();
                    ety.UserId     = req.data.userid;
                    ety.Msg        = "发送验证码" + tmpStr + "至" + etyLst[0].Email;
                    ety.Type       = 0;
                    this.Save2Log(ety);

                    rsp.data.result    = "100";
                    rsp.data.message   = "生成验证码成功";
                    rsp.data.checkcode = tmpStr;
                    rsp.data.email     = Helper.DbNull2Str(etyLst[0].Email);
                    rsp.data.oldpsw    = Helper.DbNull2Str(etyLst[0].Password);
                }
                else
                {
                    rsp.data.result  = "200";
                    rsp.data.message = "Can not find user!";
                }
            }
            catch (Exception err)
            {
                rsp.code   = "100";
                rsp.msg    = err.Message;
                rsp.status = "false";
            }
            rsp.raw = Common.Helper.JsonSerialize(rsp);
            return(Common.Helper.JsonSerialize(rsp));
        }