Exemplo n.º 1
0
        public void update(HttpContext context)
        {
            string Hotelid   = context.Request["Hotelid"].Trim();
            string Pay       = context.Request["Pay"].Trim();
            string Hypay     = context.Request["Hypay"].Trim();
            string Jfpay     = context.Request["Jfpay"].Trim();
            string Qtpay     = context.Request["Qtpay"].Trim();
            string JFZhoumo  = context.Request["JFZhoumo"].Trim();
            string JFJieri   = context.Request["JFJieri"].Trim();
            string yhqzhoumo = context.Request["yhqzhoumo"].Trim();
            string yhqjieri  = context.Request["yhqjieri"].Trim();
            string mrzf      = context.Request["mrzf"].Trim();

            string is_dj_Coupon = context.Request["is_dj_Coupon"].Trim();
            string is_xz_Coupon = context.Request["is_xz_Coupon"].Trim();

            Hashtable ht = new Hashtable();

            ht["Pay"]       = Pay;
            ht["Hypay"]     = Hypay;
            ht["Jfpay"]     = Jfpay;
            ht["Qtpay"]     = Qtpay;
            ht["JFZhoumo"]  = JFZhoumo;
            ht["JFJieri"]   = JFJieri;
            ht["yhqzhoumo"] = yhqzhoumo;
            ht["yhqjieri"]  = yhqjieri;
            ht["mrzf"]      = mrzf;

            ht["is_dj_Coupon"] = is_dj_Coupon;
            ht["is_xz_Coupon"] = is_xz_Coupon;


            if (DataFactory.SqlDataBase().Submit_AddOrEdit("Hotel", "ID", Hotelid, ht))
            {
                try
                {
                    string bz = "";
                    bz += (Pay == "1" ? "微信支付," : "");
                    bz += (Hypay == "1" ? "会员卡支付," : "");
                    bz += (Jfpay == "1" ? "积分兑换," : "");
                    bz += (Qtpay == "1" ? "前台付款" : "");
                    bz  = bz.Trim(',');
                    CommonMethod.Base_Log("修改支付方式", "Hotel", Hotelid, "修改支付方式", bz);//操作记录
                }
                catch { }
                context.Response.Write("ok");
            }
            else
            {
                context.Response.Write("error");
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 编辑按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            Hashtable hss = new Hashtable();

            hss["TypeName"]     = txtTypeName.Value;
            hss["Instructions"] = txtInstructions.Value;
            hss["AdminHotelid"] = RequestSession.GetSessionUser().AdminHotelid.ToString();
            hss["Hotelid"]      = Request["HotelId"];
            if (Request["ID"] != null)
            {
                //处理
                int a = DataFactory.SqlDataBase().UpdateByHashtable("BookType", "id", Request["ID"], hss);
                if (a > 0)
                {
                    CommonMethod.Base_Log("修改", "BookType", Request["ID"], "类型管理", "修改[" + txtTypeName.Value + "]");//操作日志
                    ShowMsgHelper.AlertMsg("编辑成功");
                }
                else
                {
                    ShowMsgHelper.Alert_Error("编辑失败!");
                }
            }
            else
            {
                string    sql = string.Format("select sort from BookType order by Sort desc");
                DataTable ds  = DataFactory.SqlDataBase().GetDataTableBySQL(new StringBuilder(sql));
                if (ds != null && ds.Rows.Count > 0)
                {
                    sort = Convert.ToInt32(ds.Rows[0]["Sort"].ToString()) + 1;
                }
                else
                {
                    sort = 1;
                }

                hss["Sort"] = sort;
                //添加
                int a = DataFactory.SqlDataBase().InsertByHashtable("BookType", hss);
                if (a > 0)
                {
                    CommonMethod.Base_Log("添加", "BookType", "", "类型管理", "添加[" + txtTypeName.Value + "]");//操作日志
                    ShowMsgHelper.AlertMsg("添加成功");
                }
                else
                {
                    ShowMsgHelper.Alert_Error("添加失败!");
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 编辑按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSumit_Click(object sender, EventArgs e)
        {
            Hashtable hss = new Hashtable();

            hss["Name"] = txtKindName.Value;

            hss["AdminHotelid"] = RequestSession.GetSessionUser().AdminHotelid.ToString();
            if (Request["ID"] != null)
            {
                //修改
                int a = DataFactory.SqlDataBase().UpdateByHashtable("CouponType", "ID", Request["ID"], hss);
                if (a > 0)
                {
                    ShowMsgHelper.AlertReloadClose("修改成功!", "ListGrid()");
                    CommonMethod.Base_Log("卡券管理", "CouponType", "AdminHotelid:" + hss["AdminHotelid"], "修改卡券类型信息", "修改卡券类型信息");//操作记录
                }
                else
                {
                    ShowMsgHelper.AlertReloadClose("修改失败!", "ListGrid()");
                }
            }
            else
            {
                //添加
                int a = DataFactory.SqlDataBase().InsertByHashtable("CouponType", hss);
                if (a > 0)
                {
                    ShowMsgHelper.AlertReloadClose("添加成功!", "ListGrid()");
                    CommonMethod.Base_Log("卡券管理", "CouponType", "AdminHotelid:" + hss["AdminHotelid"], "添加卡券类型信息", "添加卡券类型信息");//操作记录
                }
                else
                {
                    ShowMsgHelper.AlertReloadClose("添加失败!", "ListGrid()");
                }
            }
        }
Exemplo n.º 4
0
        protected void btnSumit_Click(object sender, EventArgs e)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append(@"
           select * from Finance where id= @ID
            ");
            SqlParam[] param = new SqlParam[] {
                new SqlParam("@ID", hdId.Value)
            };
            DataTable dt = DataFactory.SqlDataBase().GetDataTableBySQL(sb, param);

            if (dt != null && dt.Rows.Count > 0)
            {
                string adminHotelid = dt.Rows[0]["AdminHotelid"].ToString();
                int    hotelid      = CommonHelper.GetInt(dt.Rows[0]["HotelId"].ToString());

                string orderNum = dt.Rows[0]["Number"].ToString();
                string name     = dt.Rows[0]["Name"].ToString();
                string phone    = dt.Rows[0]["Phone"].ToString();
                string memberId = dt.Rows[0]["MemberId"].ToString();
                string openid   = dt.Rows[0]["openid"].ToString();


                int money = CommonHelper.GetInt(dt.Rows[0]["Monery"].ToString());//订单金额


                double cancel_money = CommonHelper.GetDouble(txtMoney.Text);//取消金额


                if (cancel_money > money)
                {
                    ShowMsgHelper.Alert_Error("操作失败,退回金额不能大于订单支付金额!");
                    return;
                }
                if (cancel_money > 0)//退回金额
                {
                    switch (hdPayType.Value)
                    {
                    case "1":    //到店支付

                        break;

                    case "2":    //积分兑换

                        break;

                    case "3":    //会员卡支付

                        break;

                    case "4":    //微信支付
                        #region ******** 微信原路退回 ********
                        try
                        {
                            string transaction_id = dt.Rows[0]["wxddh"].ToString();
                            if (transaction_id == "")
                            {
                                ShowMsgHelper.Alert_Error("操作失败,未找到微信支付单号!");
                                return;
                            }
                            string ssl_path = WxPayConfig.SSLCERT_PATH(adminHotelid, hotelid);
                            if (ssl_path == "")
                            {
                                ShowMsgHelper.Alert_Error("操作失败,请联系开发人员配置API证书!");
                                return;
                            }
                            //判断文件的存在
                            if (System.IO.File.Exists(HttpContext.Current.Server.MapPath("~" + ssl_path)))
                            {
                                //存在文件
                            }
                            else
                            {
                                ShowMsgHelper.Alert_Error("操作失败,API证书不存在!");
                                return;
                            }
                            string total_fee  = (money * 100).ToString();
                            string refund_fee = (cancel_money * 100).ToString();

                            string    result = Refund.Run(transaction_id, orderNum, total_fee, refund_fee, adminHotelid, hotelid);
                            WxPayData data   = new WxPayData();
                            data.FromXml(result);    //把XML转换成对象
                            string GetReturnCode = data.GetValue("return_code").ToString();
                            if (GetReturnCode == "SUCCESS")
                            {
                                string GetResultCode = data.GetValue("result_code").ToString();
                                if (GetResultCode == "SUCCESS")
                                {
                                    string refund_id = data.GetValue("refund_id").ToString();
                                    Dictionary <string, object> datas = new Dictionary <string, object>();
                                    datas.Add("transaction_id", data.GetValue("transaction_id")); //微信订单号
                                    datas.Add("out_trade_no", data.GetValue("out_trade_no"));     //商户订单号
                                    datas.Add("out_refund_no", data.GetValue("out_refund_no"));   //商户退款单号
                                    datas.Add("refund_id", data.GetValue("refund_id"));           //微信退款单号

                                    //财务记录
                                    int iVal = CommonClass.InsertFinance(orderNum, name, phone, cancel_money, 41, "充值退款", memberId, transaction_id, adminHotelid, hotelid, refund_id, openid);
                                    if (iVal > 0)
                                    {
                                        try
                                        {
                                            Hashtable hs = new Hashtable();
                                            hs["vipkh"]  = dt.Rows[0]["Phone"];
                                            hs["bmcode"] = "99";
                                            hs["yddh"]   = orderNum;
                                            hs["je"]     = CommonHelper.GetDouble(cancel_money);
                                            //hs["fhcs"] = "T";
                                            hs["OUT_fhcs"] = null;
                                            Hashtable rs = new Hashtable();
                                            DataFactory.SqlDataBase(adminHotelid).ExecuteByProcReturn("PROC_WXCZKK", hs, ref rs);
                                        }
                                        catch (Exception ex)
                                        {
                                        }
                                        CommonMethod.Base_Log("充值退款", "Reservation", "ID:" + hdId.Value, "退款金额:" + cancel_money + "," + txtReason.Text, "订单编号:" + orderNum);
                                    }
                                }
                                else
                                {
                                    //https://pay.weixin.qq.com/wiki/doc/api/micropay.php?chapter=9_4
                                    if (GetResultCode == "NOTENOUGH")    //余额不足
                                    {
                                        ShowMsgHelper.ShowScript("cancelTips()");
                                        return;
                                    }
                                    ShowMsgHelper.Alert_Error("操作失败," + data.GetValue("err_code_des") + "!");
                                    return;
                                }
                            }
                            else
                            {
                                ShowMsgHelper.Alert_Error("签名验证失败!");
                                return;
                            }
                        }
                        catch (Exception ex)
                        {
                            ShowMsgHelper.Alert_Error("操作错误,签名验证失败");
                            return;
                        }
                        #endregion
                        break;

                    default:
                        ShowMsgHelper.Alert_Error("操作失败!");
                        return;

                        break;
                    }
                }

                Hashtable ht = new Hashtable();
                //ht["CancelNumber"] = cancel_night;
                ht["CancelTime"] = DateTime.Now;
                //string qxtxt = cancel_night + "间夜";

                CommonMethod.Base_Log("充值退款", "Finance", "ID:" + hdId.Value, "退款原因:" + txtReason.Text, "订单编号:" + orderNum);
                //int val = DataFactory.SqlDataBase().UpdateByHashtable("Reservation", "id", hdId.Value, ht);
                //if (val > 0)
                //{
                ShowMsgHelper.OpenClose("退款成功!");
                //}
            }
        }
Exemplo n.º 5
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType     = "text/plain";
            context.Response.Buffer          = true;
            context.Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
            context.Response.AddHeader("pragma", "no-cache");
            context.Response.AddHeader("cache-control", "");
            context.Response.CacheControl = "no-cache";
            string    Action  = context.Request["action"];                  //提交动作
            string    user_ID = context.Request["user_ID"];                 //用户主键
            Hashtable ht      = new Hashtable();
            int       Return  = -1;

            switch (Action)
            {
            case "accredit":                                                //用户信息启用
                ht["DeleteMark"] = 1;
                Return           = DataFactory.SqlDataBase().UpdateByHashtable("Base_UserInfo", "User_ID", user_ID, ht);
                context.Response.Write(Return.ToString());
                break;

            case "lock":                                                    //锁定用户信息
                ht["DeleteMark"] = 2;
                Return           = DataFactory.SqlDataBase().UpdateByHashtable("Base_UserInfo", "User_ID", user_ID, ht);
                context.Response.Write(Return.ToString());
                break;

            case "Dimission":     //离职
                ht["DeleteMark"] = 0;
                ht["LeaveDate"]  = DateTime.Now.ToString("yyyy-MM-dd");
                Return           = DataFactory.SqlDataBase().UpdateByHashtable("Base_UserInfo", "User_ID", user_ID, ht);
                string name = context.Request["user_name"];
                CommonMethod.Base_Log("离职", "Base_UserInfo", user_ID, "办理离职", "员工[" + name + "]离职");    //操作日志
                context.Response.Write(Return > 0);
                break;

            case "UntieById":     //解绑
                ht["openid"]      = "";
                ht["WX_Nickname"] = "";
                Return            = DataFactory.SqlDataBase().UpdateByHashtable("Base_UserInfo", "User_ID", user_ID, ht);
                string jb_name = context.Request["user_name"];
                CommonMethod.Base_Log("解绑", "Base_UserInfo", user_ID, "解绑微信", "员工[" + jb_name + "]微信解绑");
                context.Response.Write(Return > 0);
                break;

            case "Entry":                                          //重新入职
                ht["DeleteMark"] = 1;
                string data_val = context.Request["data_val"];     //删除以前下线关系
                string gx_msg   = "关联回以前下线关系";
                if (data_val == "0")
                {
                    gx_msg = "永久删除以前下线关系";
                    Hashtable ht_del = new Hashtable();
                    ht_del["UserId"] = user_ID;
                    DataFactory.SqlDataBase().ExecuteByProc("P_UserEntryDelSource", ht_del);
                }
                Return = DataFactory.SqlDataBase().UpdateByHashtable("Base_UserInfo", "User_ID", user_ID, ht);
                string rz_name = context.Request["user_name"];
                CommonMethod.Base_Log("入职", "Base_UserInfo", user_ID, "重新入职", "员工[" + rz_name + "]重新入职," + gx_msg);
                context.Response.Write(Return > 0);
                break;

            case "GetInfoList":
                GetInfoList(context);
                break;

            case "GetUserRoleList":
                GetUserRoleList(context);
                break;

            case "GetRoleList":
                GetRoleList(context);
                break;

            case "GetRoleGroup":
                GetRoleGroup(context);
                break;

            case "DefaultRole":    //默认角色
                DefaultRole(context);
                break;

            case "GetOrgSelect":    //获取部门信息
                GetOrgSelect(context);
                break;

            case "GetParentIds":    //获取上级
                GetParentIds(context);
                break;

            case "CheckOrg":    //验证是否有部门
                CheckOrg(context);
                break;

            default:
                break;
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// 公共一般处理程序
        /// </summary>
        /// <param name="context"></param>
        public void ProcessRequest(HttpContext context)
        {
            string         Action     = context.Request["action"];    //提交动作
            string         module     = context.Request["module"];    //业务模块
            string         tableName  = context.Request["tableName"]; //数据库表
            string         pkName     = context.Request["pkName"];    //字段主键
            string         pkVal      = context.Request["pkVal"];     //字段值
            int            Return     = -1;
            RM_System_IDAO systemidao = new RM_System_Dal();

            switch (Action)
            {
            case "DeleteP":                      //删除多条记录 1,2,3,4,5,6
                Return = DataFactory.SqlDataBase().BatchDeleteData(tableName.Trim(), pkName.Trim(), pkVal.Split(','));
                if (Return > 0)
                {
                    CommonMethod.Base_Log("删除", tableName.Trim(), pkName.Trim() + ":" + pkVal, module.Trim(), "删除id:" + pkVal);    //操作记录
                }
                context.Response.Write(Return.ToString());
                break;

            case "AdminDelete":                      //删除多条记录 1,2,3,4,5,6
                Return = DataFactory.SqlDataBase().BatchDeleteData(tableName.Trim(), pkName.Trim(), pkVal.Split(','));
                if (Return > 0)
                {
                    //CommonMethod.Base_Log("删除", tableName.Trim(), pkName.Trim() + ":" + pkVal, module.Trim(), "删除id:" + pkVal);//操作记录
                }
                context.Response.Write(Return.ToString());
                break;

            case "ISDelete":                      //逻辑删除数据

                string[] s = pkVal.Split(',');

                for (int i = 0; i < s.Length; i++)
                {
                    Hashtable ht = new Hashtable();
                    ht["DeleteMark"] = 0;
                    Return           = DataFactory.SqlDataBase().UpdateByHashtable(tableName.Trim(), pkName.Trim(), s[i], ht);
                }
                if (Return > 0)
                {
                    CommonMethod.Base_Log("删除", tableName.Trim(), pkName.Trim() + ":" + pkVal, module.Trim(), "删除id:" + pkVal);    //操作记录
                }

                context.Response.Write(Return.ToString());
                break;

            case "GetMenus":
                string ru = "0";
                if (RequestSession.GetSessionUser() == null)
                {
                    context.Response.Write(0);
                }
                else
                {
                    RM_UserInfo_IDAO user_idao = new RM_UserInfo_Dal();
                    ru = user_idao.InitUserRight(RequestSession.GetSessionUser().UserId.ToString(), pkName);    //获取用户对应菜单的权限
                }
                context.Response.Write(ru);
                break;

            default:
                break;
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// 添加,修改
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSumit_Click(object sender, EventArgs e)
        {
            string BiginTime, EndinTime = null;

            if (hfEffectiveType.Value == "1")
            {
                BiginTime = DateTime.Now.ToString("yyyy-MM-dd");
                EndinTime = DateTime.Now.AddYears(100).ToString("yyyy-MM-dd");
            }
            else if (hfEffectiveType.Value == "2")
            {
                BiginTime = DateTime.Now.ToString("yyyy-MM-dd");
                EndinTime = DateTime.Now.AddDays(Convert.ToDouble(txtDay.Value)).ToString("yyyy-MM-dd");
            }
            else
            {
                BiginTime = B_sj.Value;
                EndinTime = E_sj.Value;
            }

            Hashtable hs = new Hashtable();

            hs["CouponName"]   = txtName.Value;
            hs["Par"]          = Convert.ToInt32(txtPar.Value);
            hs["UsedMin"]      = Convert.ToInt32(txtUsedMin.Value);
            hs["BiginTime"]    = BiginTime;
            hs["EndinTime"]    = EndinTime;
            hs["ServiceRange"] = sumhotel.Value;
            hs["ProductRange"] = txtInstructions.Value;
            hs["Mode"]         = Convert.ToInt32(DDLmode.SelectedValue);

            hs["Membergrade"]     = loadaddMembergrade(labelhtml.Value.ToString());
            hs["FirstMoney"]      = txtFirstMoney.Value;
            hs["SecondMoney"]     = txtcz.Value;
            hs["IsEnable"]        = hfsfqy.Value;
            hs["Isgiving"]        = hfsfzs.Value;
            hs["hytype"]          = hhytype.Value;
            hs["EffectiveType"]   = hfEffectiveType.Value;
            hs["EffectiveDay"]    = txtDay.Value;
            hs["AdminHotelid"]    = RequestSession.GetSessionUser().AdminHotelid.ToString();
            hs["yxrq"]            = hyxrq.Value;
            hs["jjr"]             = hjjr.Value;
            hs["count"]           = txtNum.Value;
            hs["ishy"]            = hishy.Value;
            hs["Is_Day_ok"]       = hfIs_Day_ok.Value;
            hs["Total"]           = txtTotal.Value;
            hs["Open_Hotel"]      = HOpen_Hotel.Value;
            hs["ConsumptionType"] = HConsumptionType.Value;

            hs["TypeID"] = ddltype.SelectedValue;

            hs["BirthdaySendType"] = hdSendType.Value;


            if (hfdID.Value == "0")
            {
                //添加
                int x = DataFactory.SqlDataBase().InsertByHashtableReturnPkVal("Coupon", hs);
                if (x <= 0)
                {
                    ShowMsgHelper.Alert_Error("添加失败!");
                }
                else
                {
                    if (hfsfzs.Value == "1")
                    {
                        Gift(x);
                    }                                                                                //赠送优惠券
                    CommonMethod.Base_Log("添加", "Coupon", "", "优惠券管理", "添加[" + txtName.Value + "]"); //操作日志
                    ShowMsgHelper.AlertReloadClose("添加成功!", "ListGrid()");
                }
            }
            else
            {
                //修改

                if (DataFactory.SqlDataBase().UpdateByHashtable("Coupon", "ID", hfdID.Value, hs) <= 0)
                {
                    ShowMsgHelper.Alert_Error("修改失败!");
                }
                else
                {
                    if (hfsfzs.Value == "1")
                    {
                        Gift(Convert.ToInt32(hfdID.Value));
                    }                                                                                         //赠送优惠券

                    CommonMethod.Base_Log("修改", "Coupon", hfdID.Value, "优惠券管理", "修改[" + txtName.Value + "]"); //操作日志

                    ShowMsgHelper.AlertReloadClose("修改成功!", "ListGrid()");
                }
            }
        }