Exemple #1
0
  /// <summary>
  /// 取得上級帳號
  /// </summary>
  /// <param name="o_aPK"></param>
  /// <returns></returns>
  public static string GetUPID(string strparid, string strlvl)
  {
      string        strzh            = "";
      AgentManageDB objAgentManageDB = new AgentManageDB();
      KFB_ZHGL      mo_zhgl          = objAgentManageDB.GetModel(strparid);

      if (strlvl.Equals("5"))
      {
          strzh = mo_zhgl.N_DZJDH;
      }
      else if (strlvl.Equals("6"))
      {
          strzh = mo_zhgl.N_ZJDH;
      }
      else if (strlvl.Equals("7"))
      {
          strzh = mo_zhgl.N_DGDDH;
      }
      else if (strlvl.Equals("8"))
      {
          strzh = mo_zhgl.N_GDDH;
      }
      else if (strlvl.Equals("9"))
      {
          strzh = mo_zhgl.N_ZDLDH;
      }
      return(strzh);
  }
Exemple #2
0
  public static string GetFlag(string s_aUserID)
  {
      AgentManageDB objAgentManageDB = new AgentManageDB();
      KFB_ZHGL      m_zhgl           = objAgentManageDB.GetModel(s_aUserID);

      return(m_zhgl.N_ADDFLAG.ToString());
  }
Exemple #3
0
  public static bool SJYXXZ(string strZH)
  {
      AgentManageDB objAgentManage = new AgentManageDB();

      int n_yxxz  = 1;
      int?zh_yxxz = objAgentManage.GetModel(strZH).N_YXXZ;

      if (zh_yxxz == null)
      {
          zh_yxxz = objAgentManage.GetModel(strZH).N_YXXZ;
      }

      if (zh_yxxz != null && !zh_yxxz.ToString().Equals(""))
      {
          n_yxxz = int.Parse(zh_yxxz.ToString());
      }
      return(n_yxxz.Equals(0) ? false : true);
  }
Exemple #4
0
    protected void drpDLS_SelectedIndexChanged(object sender, EventArgs e)
    {
        string s_DLS = String.Empty;

        if (this.drpDLS.SelectedValue.Equals(String.Empty))
        {
            s_DLS = this.drpDLS.SelectedValue;
            this.btnAddUser.Visible = false;
            this.btnBack.Visible    = false;
        }
        else
        {
            // s_DLS = this.drpDLS.SelectedValue.Split('-')[5].ToString();
            string[] s_dls = this.drpDLS.SelectedValue.Split('-');
            if (s_dls.Length == 7)
            {
                s_DLS = s_dls[5].ToString() + "-" + s_dls[6].ToString();
            }
            else if (s_dls.Length == 6)
            {
                s_DLS = s_dls[5].ToString();
            }
            else
            {
                s_DLS = this.drpDLS.SelectedValue;
            }
            this.btnAddUser.Visible = true;
            this.btnBack.Visible    = true;
        }

        DataSet ds = objAgentManageDB.GetHYZH(s_DLS);

        if (ds.Tables[0].Rows.Count > 0)
        {
            this.trsj.Visible = true;
            this.lbxj.Text    = ds.Tables[0].Rows.Count.ToString();
            KFB_ZHGL mo_zhgl = new KFB_ZHGL();
            mo_zhgl           = objAgentManageDB.GetModel(s_DLS);
            this.lbsj.Text    = mo_zhgl.N_HYMC;
            this.lbm1.Text    = Convert.ToString(Convert.ToDouble(objAgentManageDB.Getxyed(s_DLS)) - Convert.ToDouble(objAgentManageDB.Getsyed(s_DLS)));
            this.lbm2.Text    = objAgentManageDB.Getsyed(s_DLS);
            this.trbj.Visible = false;
        }
        else
        {
            this.trsj.Visible = false;
            this.trbj.Visible = true;
        }
        this.grvUserManage.DataSource = ds;
        this.grvUserManage.DataBind();
        if (Comm.GetFlag(mUserID) == "1")
        {
            btnAddUser.Visible = false;
        }
    }
Exemple #5
0
  public static bool SJYXDL(string strZH)
  {
      AgentManageDB objAgentManage = new AgentManageDB();
      int           n_yxdl         = 1;
      int?          zh_yxdl        = objAgentManage.GetModel(strZH).N_YXDL;

      if (zh_yxdl == null)
      {
          zh_yxdl = objAgentManage.GetModelHYGL(strZH).N_YXDL;
      }

      if (zh_yxdl != null && !zh_yxdl.ToString().Equals(""))
      {
          n_yxdl = int.Parse(zh_yxdl.ToString());
      }
      return(n_yxdl.Equals(0) ? false : true);
  }
Exemple #6
0
  /// <summary>
  ///
  /// </summary>
  ///
  public static string GetPage(string strlv, string strzh)
  {
      string        strturn          = "";
      string        strpara          = "";
      AgentManageDB objAgentManageDB = new AgentManageDB();
      KFB_ZHGL      m_zhgl           = objAgentManageDB.GetModel(strzh);

      if (m_zhgl != null)
      {
          if (strlv.Equals("9"))
          {
              strpara = "?n_dzjdh=" + m_zhgl.N_DZJDH + "&n_zjdh=" + m_zhgl.N_ZJDH + "&n_dgddh=" + m_zhgl.N_DGDDH + "&n_gddh=" + m_zhgl.N_GDDH + "&n_zdldh=" + m_zhgl.N_ZDLDH + "&n_dldh=" + m_zhgl.N_DLDH;
          }
          else if (strlv.Equals("5"))
          {
              strpara = "?id=" + m_zhgl.N_DZJDH;
          }
          else
          {
              strpara = "?dzjid=" + m_zhgl.N_DZJDH + "&zjid=" + m_zhgl.N_ZJDH + "&dgdid=" + m_zhgl.N_DGDDH + "&gdid=" + m_zhgl.N_GDDH + "&zdlid=" + m_zhgl.N_ZDLDH + "&dlid=" + m_zhgl.N_DLDH;
          }
      }
      switch (strlv)
      {
      case "4": strturn = "dzjgl.aspx" + strpara; break;

      case "5": strturn = "zjgl.aspx" + strpara; break;

      case "6": strturn = "dgdgl.aspx" + strpara; break;

      case "7": strturn = "gdgl.aspx" + strpara; break;

      case "8": strturn = "AgentManage.aspx" + strpara; break;

      case "9": strturn = "dlgl.aspx" + strpara; break;
      }
      return(strturn);
  }
    protected void btdel_Click(object sender, EventArgs e)
    {
        KFB_ZHGL   mo_zhgl = new KFB_ZHGL();
        LinkButton btn     = (LinkButton)sender;
        int        i_Index = ((GridViewRow)(btn.Parent.Parent)).RowIndex;

        string s_NID = "";

        s_NID   = ((GridView)(btn.Parent.Parent.Parent.Parent)).Rows[i_Index].Cells[0].Text.ToString().Trim();
        mo_zhgl = objAgentManageDB.GetModel(s_NID);

        //判断是否有注單
        int i_Count = objAgentManageDB.GetZD(s_NID, Comm.GetZHCol(mo_zhgl.N_HYDJ.ToString()));

        if (i_Count > 0)
        {
            this.ShowMsg("本賬號已有注單,無法删除!");
            return;
        }

        int i_HYCount = objAgentManageDB.GetHYZD(s_NID, Comm.GetZHCol(mo_zhgl.N_HYDJ.ToString()));

        if (i_HYCount > 0)
        {
            this.ShowMsg("本賬號下級會員已有注單,無法删除!");
            return;
        }

        int i_oCount = objAgentManageDB.GetOZD(s_NID, Comm.GetZHCol(mo_zhgl.N_HYDJ.ToString()));

        if (i_oCount > 0)
        {
            this.ShowMsg("本賬號已有歷史注單,無法删除!");
            return;
        }

        int i_oHYCount = objAgentManageDB.GetOHYZD(s_NID, Comm.GetZHCol(mo_zhgl.N_HYDJ.ToString()));

        if (i_oHYCount > 0)
        {
            this.ShowMsg("本賬號下級會員已有歷史注單,無法删除!");
            return;
        }

        try
        {
            //判斷是否存在
            bool chuser = objAgentManageDB.Exists(s_NID);
            if (!chuser)
            {
                this.ShowMsg("該會員已被刪除!");
            }
            else//存在則修改
            {
                #region "修改上级剩余额度"
                objAgentManageDB.UpSJED(mo_zhgl);

                #endregion
                //o_KFB_ZHGL.Delete(strparid, Convert.ToInt32(strlvl));
                objAgentManageDB.DeleteAll(s_NID, Comm.GetZHCol(mo_zhgl.N_HYDJ.ToString()));

                SetGrid(this.drzdl.SelectedValue);
            }
        }
        catch (Exception ex)
        {
            this.WriteLog("用户名=" + mUserID + ex.ToString());
            this.ShowMsg("删除失败");
        }
    }
    /// <summary>
    /// 保存按鈕
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            #region "修改棒球設定檔"
            KFB_SETUPMB mo_mb   = new KFB_SETUPMB();
            Hashtable   GetSql  = new Hashtable();
            KFB_ZHGL    mo_zhgl = new KFB_ZHGL();
            mo_zhgl = objAgentManageDB.GetModel(this.lblName.Text.ToString().Trim());

            mo_mb.N_HYZH   = this.lblName.Text;
            mo_mb.N_RFTY   = Convert.ToDecimal(this.drptyrf.Text);
            mo_mb.N_RFDZ   = Convert.ToDecimal(this.txtdzrf.Text);
            mo_mb.N_RFDC   = Convert.ToDecimal(this.txtdcrf.Text);
            mo_mb.N_DXTY   = Convert.ToDecimal(this.drptydx.Text);
            mo_mb.N_DXDZ   = Convert.ToDecimal(this.txtdzdx.Text);
            mo_mb.N_DXDC   = Convert.ToDecimal(this.txtdcdx.Text);
            mo_mb.N_DYTY   = Convert.ToDecimal(this.drptydy.Text);
            mo_mb.N_DYDZ   = Convert.ToDecimal(this.txtdzdy.Text);
            mo_mb.N_DYDC   = Convert.ToDecimal(this.txtdcdy.Text);
            mo_mb.N_DSTY   = Convert.ToDecimal(this.drptyds.Text);
            mo_mb.N_DSDZ   = Convert.ToDecimal(this.txtdzds.Text);
            mo_mb.N_DSDC   = Convert.ToDecimal(this.txtdcds.Text);
            mo_mb.N_ZDRFTY = Convert.ToDecimal(this.drptyzdrf.Text);
            mo_mb.N_ZDRFDZ = Convert.ToDecimal(this.txtdzzdrf.Text);
            mo_mb.N_ZDRFDC = Convert.ToDecimal(this.txtdczdrf.Text);
            mo_mb.N_ZDDXTY = Convert.ToDecimal(this.drptyzddx.Text);
            mo_mb.N_ZDDXDZ = Convert.ToDecimal(this.txtdzzddx.Text);
            mo_mb.N_ZDDXDC = Convert.ToDecimal(this.txtdczddx.Text);
            mo_mb.N_SYTY   = Convert.ToDecimal(this.drptysy.Text);
            mo_mb.N_SYDZ   = Convert.ToDecimal(this.txtdzsy.Text);
            mo_mb.N_SYDC   = Convert.ToDecimal(this.txtdcsy.Text);
            mo_mb.N_GGTY   = Convert.ToDecimal(this.drptygg.Text);
            mo_mb.N_GGDZ   = Convert.ToDecimal(this.txtdzgg.Text);
            mo_mb.N_GGDC   = Convert.ToDecimal(this.txtdcgg.Text);
            mo_mb.N_GJTY   = Convert.ToDecimal(this.drptybcrf.Text);
            mo_mb.N_GJDZ   = Convert.ToDecimal(this.txtdzbcrf.Text);
            mo_mb.N_GJDC   = Convert.ToDecimal(this.txtdcbcrf.Text);
            objAgentManageDB.UpdateMB(mo_mb, GetSql);
            objAgentManageDB.Update(GetSql);
            #endregion

            #region "修改下綫"
            string  strhidvalue = this.hidvalue.Value;
            string  strZH       = "";
            string  strFlag     = "";
            DataSet getds       = new DataSet();
            if (strhidvalue.IndexOf(":") > -1)
            {
                //取出所有會員
                if (mo_zhgl.N_HYDJ.ToString() != "9")    //取得下屬帳號
                {
                    getds = objAgentManageDB.GetZH(mo_zhgl.N_HYDJ.ToString(), this.lblName.Text);
                    if (getds.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < getds.Tables[0].Rows.Count; i++)
                        {
                            strZH   = strZH + strFlag + "'" + getds.Tables[0].Rows[i]["n_hyzh"].ToString() + "'";
                            strFlag = ",";
                        }
                    }
                }
                getds = objAgentManageDB.GetHYZH(mo_zhgl.N_HYDJ.ToString(), this.lblName.Text);    //取得下屬會員
                if (getds.Tables[0].Rows.Count > 0)
                {
                    for (int i = 0; i < getds.Tables[0].Rows.Count; i++)
                    {
                        strZH   = strZH + strFlag + "'" + getds.Tables[0].Rows[i]["n_hyzh"].ToString() + "'";
                        strFlag = ",";
                    }
                }
                if (!strZH.Equals(""))
                {
                    string[] strarr = strhidvalue.Split(';');
                    for (int i = 0; i < strarr.Length - 1; i++)
                    {
                        string[] strElement = strarr[i].ToString().Split(':');
                        string   strtable   = strElement[0];
                        string[] strvalue   = strElement[1].ToString().Split(',');
                        objAgentManageDB.Update("mb", strvalue[0].ToString(), strvalue[1].ToString(), strZH);
                    }
                }
            }
            #endregion


            ShowMsg("修改成功!");
        }
        catch (Exception ex)
        {
            ShowMsg("修改失敗,請通知管理員!");
        }
    }
    /// <summary>
    /// 保存按鈕
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            #region "修改足球設定檔"
            KFB_SETUPZQ mo_zq   = new KFB_SETUPZQ();
            Hashtable   GetSql  = new Hashtable();
            KFB_ZHGL    mo_zhgl = new KFB_ZHGL();
            mo_zhgl         = objAgentManageDB.GetModel(this.lblName.Text.ToString().Trim());
            mo_zq.N_HYZH    = this.lblName.Text.ToString().Trim();
            mo_zq.N_ARFTY   = Convert.ToDecimal(this.drptyarf.Text);
            mo_zq.N_ADXTY   = Convert.ToDecimal(this.drptyadx.Text);
            mo_zq.N_ADYTY   = Convert.ToDecimal(this.drptyady.Text);
            mo_zq.N_ADSTY   = Convert.ToDecimal(this.drptyads.Text);
            mo_zq.N_AZDRFTY = Convert.ToDecimal(this.drptyazdrf.Text);
            mo_zq.N_AZDDXTY = Convert.ToDecimal(this.drptyazddx.Text);
            mo_zq.N_ABCRFTY = Convert.ToDecimal(this.drptyabcrf.Text);
            mo_zq.N_ABCDXTY = Convert.ToDecimal(this.drptyabcdx.Text);
            mo_zq.N_ABCDYTY = Convert.ToDecimal(this.drptyabcdy.Text);
            mo_zq.N_ARQSTY  = Convert.ToDecimal(this.drptyarqs.Text);
            mo_zq.N_ABDTY   = Convert.ToDecimal(this.drptyabd.Text);
            mo_zq.N_ABQCTY  = Convert.ToDecimal(this.drptyabqc.Text);
            mo_zq.N_AGGTY   = Convert.ToDecimal(this.drptyagg.Text);
            mo_zq.N_AGJTY   = Convert.ToDecimal(this.drptyagj.Text);

            mo_zq.N_BRFTY   = Convert.ToDecimal(this.drptybrf.Text);
            mo_zq.N_BDXTY   = Convert.ToDecimal(this.drptybdx.Text);
            mo_zq.N_BDYTY   = Convert.ToDecimal(this.drptybdy.Text);
            mo_zq.N_BDSTY   = Convert.ToDecimal(this.drptybds.Text);
            mo_zq.N_BZDRFTY = Convert.ToDecimal(this.drptybzdrf.Text);
            mo_zq.N_BZDDXTY = Convert.ToDecimal(this.drptybzddx.Text);
            mo_zq.N_BBCRFTY = Convert.ToDecimal(this.drptybbcrf.Text);
            mo_zq.N_BBCDXTY = Convert.ToDecimal(this.drptybbcdx.Text);
            mo_zq.N_BBCDYTY = Convert.ToDecimal(this.drptybbcdy.Text);
            mo_zq.N_BRQSTY  = Convert.ToDecimal(this.drptybrqs.Text);
            mo_zq.N_BBDTY   = Convert.ToDecimal(this.drptybbd.Text);
            mo_zq.N_BBQCTY  = Convert.ToDecimal(this.drptybbqc.Text);
            mo_zq.N_BGGTY   = Convert.ToDecimal(this.drptybgg.Text);
            mo_zq.N_BGJTY   = Convert.ToDecimal(this.drptybgj.Text);

            mo_zq.N_CRFTY   = Convert.ToDecimal(this.drptycrf.Text);
            mo_zq.N_CDXTY   = Convert.ToDecimal(this.drptycdx.Text);
            mo_zq.N_CDYTY   = Convert.ToDecimal(this.drptycdy.Text);
            mo_zq.N_CDSTY   = Convert.ToDecimal(this.drptycds.Text);
            mo_zq.N_CZDRFTY = Convert.ToDecimal(this.drptyczdrf.Text);
            mo_zq.N_CZDDXTY = Convert.ToDecimal(this.drptyczddx.Text);
            mo_zq.N_CBCRFTY = Convert.ToDecimal(this.drptycbcrf.Text);
            mo_zq.N_CBCDXTY = Convert.ToDecimal(this.drptycbcdx.Text);
            mo_zq.N_CBCDYTY = Convert.ToDecimal(this.drptycbcdy.Text);
            mo_zq.N_CRQSTY  = Convert.ToDecimal(this.drptycrqs.Text);
            mo_zq.N_CBDTY   = Convert.ToDecimal(this.drptycbd.Text);
            mo_zq.N_CBQCTY  = Convert.ToDecimal(this.drptycbqc.Text);
            mo_zq.N_CGGTY   = Convert.ToDecimal(this.drptycgg.Text);
            mo_zq.N_CGJTY   = Convert.ToDecimal(this.drptycgj.Text);

            mo_zq.N_RFDZ   = Convert.ToDecimal(this.txtdzrf.Text);
            mo_zq.N_RFDC   = Convert.ToDecimal(this.txtdcrf.Text);
            mo_zq.N_DXDZ   = Convert.ToDecimal(this.txtdzdx.Text);
            mo_zq.N_DXDC   = Convert.ToDecimal(this.txtdcdx.Text);
            mo_zq.N_DYDZ   = Convert.ToDecimal(this.txtdzdy.Text);
            mo_zq.N_DYDC   = Convert.ToDecimal(this.txtdcdy.Text);
            mo_zq.N_DSDZ   = Convert.ToDecimal(this.txtdzds.Text);
            mo_zq.N_DSDC   = Convert.ToDecimal(this.txtdcds.Text);
            mo_zq.N_ZDRFDZ = Convert.ToDecimal(this.txtdzzdrf.Text);
            mo_zq.N_ZDRFDC = Convert.ToDecimal(this.txtdczdrf.Text);
            mo_zq.N_ZDDXDZ = Convert.ToDecimal(this.txtdzzddx.Text);
            mo_zq.N_ZDDXDC = Convert.ToDecimal(this.txtdczddx.Text);
            mo_zq.N_BCRFDZ = Convert.ToDecimal(this.txtdzbcrf.Text);
            mo_zq.N_BCRFDC = Convert.ToDecimal(this.txtdcbcrf.Text);
            mo_zq.N_BCDXDZ = Convert.ToDecimal(this.txtdzbcdx.Text);
            mo_zq.N_BCDXDC = Convert.ToDecimal(this.txtdcbcdx.Text);
            mo_zq.N_BCDYDZ = Convert.ToDecimal(this.txtdzbcdy.Text);
            mo_zq.N_BCDYDC = Convert.ToDecimal(this.txtdcbcdy.Text);
            mo_zq.N_RQSDZ  = Convert.ToDecimal(this.txtdzrqs.Text);
            mo_zq.N_RQSDC  = Convert.ToDecimal(this.txtdcrqs.Text);
            mo_zq.N_BDDZ   = Convert.ToDecimal(this.txtdzbd.Text);
            mo_zq.N_BDDC   = Convert.ToDecimal(this.txtdcbd.Text);
            mo_zq.N_BQCDZ  = Convert.ToDecimal(this.txtdzbqc.Text);
            mo_zq.N_BQCDC  = Convert.ToDecimal(this.txtdcbqc.Text);
            mo_zq.N_GGDZ   = Convert.ToDecimal(this.txtdzgg.Text);
            mo_zq.N_GGDC   = Convert.ToDecimal(this.txtdcgg.Text);
            mo_zq.N_GJDZ   = Convert.ToDecimal(this.txtdzgj.Text);
            mo_zq.N_GJDC   = Convert.ToDecimal(this.txtdcgj.Text);
            objAgentManageDB.UpdateZQ(mo_zq, GetSql);
            objAgentManageDB.Update(GetSql);
            #endregion

            #region "修改下綫"
            string  strhidvalue = this.hidvalue.Value;
            string  strZH       = "";
            string  strFlag     = "";
            DataSet getds       = new DataSet();
            if (strhidvalue.IndexOf(":") > -1)
            {
                //取出所有會員
                if (mo_zhgl.N_HYDJ.ToString() != "9")    //取得下屬帳號
                {
                    getds = objAgentManageDB.GetZH(mo_zhgl.N_HYDJ.ToString(), this.lblName.Text);
                    if (getds.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < getds.Tables[0].Rows.Count; i++)
                        {
                            strZH   = strZH + strFlag + "'" + getds.Tables[0].Rows[i]["n_hyzh"].ToString() + "'";
                            strFlag = ",";
                        }
                    }
                }
                getds = objAgentManageDB.GetHYZH(mo_zhgl.N_HYDJ.ToString(), this.lblName.Text);    //取得下屬會員
                if (getds.Tables[0].Rows.Count > 0)
                {
                    for (int i = 0; i < getds.Tables[0].Rows.Count; i++)
                    {
                        strZH   = strZH + strFlag + "'" + getds.Tables[0].Rows[i]["n_hyzh"].ToString() + "'";
                        strFlag = ",";
                    }
                }
                if (!strZH.Equals(""))
                {
                    string[] strarr = strhidvalue.Split(';');
                    for (int i = 0; i < strarr.Length - 1; i++)
                    {
                        string[] strElement = strarr[i].ToString().Split(':');
                        string   strtable   = strElement[0];
                        string[] strvalue   = strElement[1].ToString().Split(',');
                        objAgentManageDB.Update("zq", strvalue[0].ToString(), strvalue[1].ToString(), strZH);
                    }
                }
            }
            #endregion


            ShowMsg("修改成功!");
        }
        catch (Exception ex)
        {
            ShowMsg("修改失敗,請通知管理員!");
        }
    }