Exemplo n.º 1
0
    protected void btnsetcardnumber_Click(object sender, EventArgs e)
    {
        //  Permissions.CheckManagePermission(Model.Other.EnumCompanyPermission.Setxinyuedu_Add);
        if (this.txttopnumber.Text == "")
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000787", "请输入编号!") + "');</script>");
            return;
        }

        int count = Convert.ToInt32(DBHelper.ExecuteScalar("select count(0) from memberinfo where number='" + this.txttopnumber.Text.Trim() + "' "));

        if (count <= 0)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("001549", "对不起,该编号不存在!") + "');</script>");
            return;
        }
        //判断登录者是否有更改此会员的权限
        //bool isTrue = false;
        //isTrue = BLL.CommonClass.CommonDataBLL.GetRole(" number = '"+Session["Company"].ToString()+"'", txttopnumber.Text.Trim());
        //if (!isTrue)
        //{
        //    ClientScript.RegisterStartupScript(GetType(), "success", "alert('" + GetTran("007131", "对不起,您没有更改此会员的权限!") + "');", true);
        //    return;
        //}
        if (txtxinyue.Text == "")
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("007846", "请输入您要设置的信誉额") + "!');</script>");
            return;
        }
        if (txtlimitdate.Text == "")
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("007847", "请选择您要设置的信誉额有效期") + "!');</script>");
            return;
        }


        try
        {
            int rc = AddMemberInfomDAL.Setxinyuedu(this.txttopnumber.Text.Trim(), Convert.ToDouble(txtxinyue.Text.Trim()), Session["company"].ToString(), Request.UserHostAddress.ToString(), Convert.ToDateTime(txtlimitdate.Text.Trim()));

            if (rc > 0)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("005820", "设置成功!") + "');  window.location.href='Setxinyuedu.aspx';</script>");

                return;
            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("006922", "设置失败!") + "'); window.location.href='Setxinyuedu.aspx';</script>");

                return;
            }
        }
        catch (Exception ex)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("006922", "设置失败!") + "');  window.location.href='Setxinyuedu.aspx';</script>");

            return;
        }
    }
Exemplo n.º 2
0
        public void GetCountry(DropDownList list)
        {
            List <CountryModel> list2 = new AddMemberInfomDAL().GetCountry();

            foreach (CountryModel cm in list2)
            {
                ListItem item = new ListItem(cm.Name, cm.ID.ToString());
                list.Items.Add(item);
            }
        }
Exemplo n.º 3
0
    protected void btnsetcardnumber_Click(object sender, EventArgs e)
    {
        //Permissions.CheckManagePermission(Model.Other.EnumCompanyPermission.ManNetBankcard_Add);
        if (this.txttopnumber.Text == "")
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("007793", "请输入网络编号") + "!');</script>");
            return;
        }

        int count = Convert.ToInt32(DBHelper.ExecuteScalar("select count(0) from memberinfo where number='" + this.txttopnumber.Text.Trim() + "' "));

        if (count <= 0)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000710", "编号不存在") + "!');</script>");
            return;
        }
        //判断登录者是否有更改此会员的权限
        //bool isTrue = false;
        //isTrue = BLL.CommonClass.CommonDataBLL.GetRole(Session["Company"].ToString(), txttopnumber.Text.Trim());
        //if (!isTrue)
        //{
        //    ClientScript.RegisterStartupScript(GetType(), "success", "alert('" + GetTran("007794", "对不起,您没有更改此会员的权限") + "');", true);
        //    return;
        //}
        if (this.ddlbanklist.SelectedIndex == 0)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("007795", "请选择汇入银行卡号") + "!');</script>");
            return;
        }


        try
        {
            int rc = AddMemberInfomDAL.SetNetCardid(this.txttopnumber.Text.Trim(), Convert.ToInt32(this.ddlbanklist.SelectedValue), this.txtnosetnumber.Text.Trim(), Session["Company"].ToString(), Convert.ToInt32(this.rbtltype.SelectedValue));
            if (rc > 0)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("005820", "设置成功!") + "');  window.location.href='ManNetBankcard.aspx';</script>");

                return;
            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("006922", "设置失败") + "'); window.location.href='ManNetBankcard.aspx';</script>");

                return;
            }
        }
        catch (Exception ex)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("006922", "设置失败") + "');  window.location.href='ManNetBankcard.aspx';</script>");

            return;
        }
    }
Exemplo n.º 4
0
        /// <summary>
        ///  获取身份证编码
        /// </summary>
        /// <returns></returns>
        public List <Bsco_PaperType> GetCardCode()
        {
            List <Bsco_PaperType> list = new AddMemberInfomDAL().GetCardCode();

            foreach (Bsco_PaperType model in list)
            {
                if (model.PaperType == "无")
                {
                    model.PaperType = this.GetTran("000221", "无");
                }
                else
                {
                    model.PaperType = CommonDataBLL.GetLanguageStr(model.Id, "bsco_PaperType", "papertype");
                }
            }
            return(list);
        }
Exemplo n.º 5
0
 public DataTable QueryDeclaration2(string storeId, string condition, string symbol, string character, int expectNum)
 {
     return(AddMemberInfomDAL.QueryDeclaration2(storeId, condition, symbol, character, expectNum));
 }
Exemplo n.º 6
0
        public int GetHaveStore(string number, SqlTransaction tran)
        {
            int result = new AddMemberInfomDAL().GetHaveStore(number, tran);

            return(result);
        }
Exemplo n.º 7
0
        public string GetHaveDirect(string number, SqlTransaction tran)
        {
            int result = new AddMemberInfomDAL().GetHavePlace(number, tran);

            return(result > 0 ? (this.GetTran("004147", "抱歉!该会员下有推荐,无法删除")) : (null));//抱歉!该会员下有安置,无法删除
        }
Exemplo n.º 8
0
        /// <summary>
        /// 确认 当期,未支付的自由注册 信息
        /// </summary>
        /// <param name="Number"></param>
        /// <param name="OrderID"></param>
        /// <param name="StoreID"></param>
        /// <returns></returns>
        public string ConfirmCurretMemberinfo(string Number, string OrderID, string StoreID, string TotalPV, string TotalMoney, int DefrayType, string ElectronicAccountID)
        {
            //根据订单编号获得订单详细
            string info = "";

            //获取电子账号
            string elcAccountId = new AddOrderDataDAL().GerExcNuber(OrderID);
            //try
            //{
            BrowseMemberOrdersBLL browseMemberOrdersBLL = new BrowseMemberOrdersBLL();
            ViewFuXiaoBLL         viewFuXiaoBLL         = new ViewFuXiaoBLL();

            using (SqlConnection con = new SqlConnection(DAL.DBHelper.connString))
            {
                con.Open();
                SqlTransaction tran = con.BeginTransaction();

                //获得会员电子账户剩余金额
                object zhifumoney = CommonDataBLL.EctIsEnough(Number);
                //获得会员订单信息
                DataTable dt = BrowseMemberOrdersBLL.DeclarationProduct(StoreID, OrderID);


                if (DefrayType == 2)//支付类型,1是现金,2电子转帐,3网上支付,
                {
                    //电子钱包余额是否大于订单金额
                    if (Convert.ToDouble(zhifumoney) < Convert.ToDouble(TotalMoney))
                    {
                        info = BLL.Translation.Translate("000599", "会员") + ":" + Number + BLL.Translation.Translate("001736", "的电子帐户不够支付本报单!");
                        return(info);
                    }
                }

                //获得店铺不足货时可以报单的金额
                object memberordermoney = CommonDataBLL.StoreLaveAmount(StoreID);

                //获得该订单所以不足货所的报单的金额
                double sumNotenoughMoney = ViewFuXiaoBLL.GetNotEnoughMoney(OrderID, tran);

                // 店铺剩余可报单额是否大于订单金额
                if (Convert.ToDouble(memberordermoney) < sumNotenoughMoney)
                {
                    info = BLL.Translation.Translate("000388", "店铺") + ": " + StoreID + BLL.Translation.Translate("001739", "的可以用来报单的费用不足!");
                    return(info);
                }

                //是否是网上银行支付
                if (DefrayType == 3)
                {
                    //info = "网上银行支付";
                    ////Response.Write("<script>location.href='../Send.aspx?V_amount=" + Totalmoney.Value + "&V_oid=" + orderId + "';</script>");
                    //return info;
                }


                //获得最大期数(测试)
                int maxQs = CommonDataBLL.getMaxqishu();
                //更新会员订单信息
                if (!CommonDataBLL.ConfirmMembersOrder(tran, OrderID, maxQs))
                {
                    info = BLL.Translation.Translate("000979", "支付失败");
                    return(info);
                }
                //更新结算(需要修改存储过程)
                if (!BLL.CommonClass.CommonDataBLL.UPMemberInfoBalance(tran, Number, decimal.Parse(TotalPV), maxQs))
                {
                    info = BLL.Translation.Translate("001741", "结算失败");
                    return(info);
                }


                //更新店铺库存

                List <Model.MemberDetailsModel> list = ViewFuXiaoBLL.GetDetails(OrderID);


                int  result = 0;
                bool real   = true;
                foreach (Model.MemberDetailsModel memberDetailsModel in list)
                {
                    //循环根据订单明细跟新库存
                    if (memberDetailsModel.IsGroupItem == "" || memberDetailsModel.IsGroupItem == null)
                    {
                        if (memberDetailsModel.HasGroupItem == "true")
                        {
                            result = new AddMemberInfomDAL().updateStore11(StoreID, memberDetailsModel, tran);
                            real   = false;
                        }
                        else
                        {
                            result = ViewFuXiaoBLL.UptStock(tran, StoreID, memberDetailsModel.ProductId, memberDetailsModel.Quantity, memberDetailsModel.NotEnoughProduct);
                            real   = false;
                        }
                    }
                    if (result <= 0 && real == false)
                    {
                        if (browseMemberOrdersBLL.updateStore2(memberDetailsModel, tran) <= 0)
                        {
                            tran.Rollback();
                            con.Close();
                            return(info);
                        }
                    }
                }


                if (DefrayType == 2)
                {
                    //添加到店汇款表
                    int result3 = new AddOrderDataDAL().AddDataTORemittances(tran, MemberOrderBLL.GetMemberOrder(OrderID));
                    if (result3 > 0)
                    {
                        //跟新被转账会员的电子帐户
                        if (!BLL.CommonClass.CommonDataBLL.UPMemberEct(elcAccountId, Convert.ToDecimal(TotalMoney)))
                        {
                            tran.Rollback();
                            con.Close();
                            return(info);
                        }
                        ;
                        //更新店铺的汇款
                        int result2 = new AddOrderDataDAL().Add_Remittances(tran, Convert.ToDouble(TotalMoney), StoreID);
                    }
                    else
                    {
                        tran.Rollback();
                        con.Close();
                        return(info);
                    }
                }

                //更新店铺总保单额(累计)
                if (new AddOrderBLL().updateStore4(StoreID, tran, Convert.ToDouble(TotalMoney)) <= 0)
                {
                    tran.Rollback();
                    con.Close();
                    return(info);
                }
                //提交事务
                tran.Commit();
            }


            //}
            //catch
            //{

            //}
            info = BLL.Translation.Translate("001743", "确定完成!");

            return(info);
        }