Exemplo n.º 1
0
 /// <summary>
 /// Returns whether the session needs to be checked
 /// remotely from maestrano or not
 /// </summary>
 /// <returns></returns>
 public Boolean isRemoteCheckRequired()
 {
     if (Uid != null && SessionToken != null && Recheck != null)
     {
         return(Recheck.CompareTo(DateTime.UtcNow) <= 0);
     }
     return(true);
 }
        /// <summary>
        /// 向报表插入信息
        /// </summary>
        /// <param name="SellCash">售卡金额</param>
        /// <param name="CanCash">退卡金额</param>
        /// <param name="RecCAsh">充值金额</param>
        /// <param name="NowCash">本期金额</param>
        /// <param name="Opertion">操作员</param>
        /// <param name="Date">结账日期</param>
        /// <returns></returns>
        public string InsertRecheck(string SellCash, string CanCash, string RecCAsh, string NowCash, string Opertion, string Date, Form form, string admin)
        {
            string Strms         = "";
            string isnull        = IsNull.isNull(form);//判断文本框是否为空
            string isGroupNumber = IsNull.GroupIsNumber(form);

            //判断文本框是否为空
            if (isnull == "") //没有返回值说明不为空
            {
                //判断文本内容是否是数字
                if (isGroupNumber == "")//没有返回值,说明都是数字
                {
                    SettleAccountsIDAL settAccoutIDAL = (SettleAccountsIDAL)fact.CreateUser("SettleAccountsDAL");
                    //转成售卡实体
                    RegistrationCardno regist = new RegistrationCardno();
                    regist.OpertionID    = int.Parse(Opertion);
                    regist.AccountsState = "已结账";
                    settAccoutIDAL.UpdateRegistrationCardno(regist);//更新售卡结账状态

                    //转成充值实体
                    Recharge recharge = new Recharge();
                    recharge.OpertionID = int.Parse(Opertion);
                    recharge.State      = "已结账";
                    settAccoutIDAL.UpdateRecharge(recharge);//更新充值结账状态

                    //转成退卡实体
                    CanceCard cancardno = new CanceCard();
                    cancardno.OperationID = int.Parse(Opertion);
                    cancardno.State       = "已结账";
                    settAccoutIDAL.UpdateCancelCard(cancardno);//更新退卡结账状态

                    //向报表插入信息
                    //转成报表实体
                    Recheck recheck = new Recheck();
                    recheck.SallCash      = double.Parse(SellCash);
                    recheck.RechargeCash  = double.Parse(RecCAsh);
                    recheck.CanCash       = double.Parse(CanCash);
                    recheck.Currentincome = double.Parse(NowCash);
                    recheck.Opertion      = int.Parse(admin);
                    recheck.CheckDate     = DateTime.Parse(Date);
                    settAccoutIDAL.InsertRecheck(recheck);
                    Strms = "结账成功!";
                }
                else
                {
                    Strms = isGroupNumber;
                }
            }
            else
            {
                Strms = isnull;
            }
            return(Strms);
        }
Exemplo n.º 3
0
        public string ToEncodedString()
        {
            var     enc           = System.Text.Encoding.UTF8;
            JObject sessionObject = new JObject(
                new JProperty("uid", Uid),
                new JProperty("session", SessionToken),
                new JProperty("session_recheck", Recheck.ToString("s")),
                new JProperty("group_uid", GroupUid));

            return(Convert.ToBase64String(enc.GetBytes(sessionObject.ToString())));
        }
Exemplo n.º 4
0
        /// <summary>
        /// Save the Maestrano session in
        /// HTTP Session
        /// </summary>
        public void Save()
        {
            var     enc           = System.Text.Encoding.UTF8;
            JObject sessionObject = new JObject(
                new JProperty("uid", Uid),
                new JProperty("session", SessionToken),
                new JProperty("session_recheck", Recheck.ToString("s")),
                new JProperty("group_uid", GroupUid));

            // Finally store the maestrano session
            HttpSession[presetName] = Convert.ToBase64String(enc.GetBytes(sessionObject.ToString()));
        }
Exemplo n.º 5
0
        /// <summary>
        /// 向报表插入内容
        /// </summary>
        /// <param name="rechck">报表实体</param>
        /// <returns>受影响行数</returns>
        public int InsertRecheck(Recheck rechck)
        {
            //定义参数
            SqlParameter[] sqlpams = { new SqlParameter("@SallCash",      rechck.SallCash),
                                       new SqlParameter("@RechargeCash",  rechck.RechargeCash),
                                       new SqlParameter("@CanCash",       rechck.CanCash),
                                       new SqlParameter("@currentincome", rechck.Currentincome),
                                       new SqlParameter("@Opertion",      rechck.Opertion),
                                       new SqlParameter("@CheckDate",     rechck.CheckDate) };
            //定义SQL语句
            string sql    = @"insert into Recheck values(@SallCash,@RechargeCash,@CanCash,@currentincome,@Opertion,@CheckDate)";
            int    Relust = sqlHelper.ExecuteNonQuery(sql, sqlpams, CommandType.Text);

            return(Relust);
        }