Exemplo n.º 1
0
    protected void btnOperate_Click(object sender, EventArgs e)
    {
        try
        {
            Hashtable  GetSql  = new Hashtable();
            LinkButton btn     = (LinkButton)sender;
            int        i_Index = ((GridViewRow)(btn.Parent.Parent)).RowIndex;

            string s_NID = "";
            s_NID = ((Label)((GridViewRow)(btn.Parent.Parent)).FindControl("lblHYZH")).Text.ToString();
            KFB_HYGL mo_zhgl = objAgentManageDB.GetModelHYGL(s_NID);

            if (btn.Text == "啟用")
            {
                objAgentManageDB.NoLogHY("N_HYZH", mo_zhgl.N_HYZH, "1", GetSql);
            }
            else if (btn.Text == "停用")
            {
                objAgentManageDB.NoLogHY("N_HYZH", mo_zhgl.N_HYZH, "0", GetSql);
            }

            else if (btn.Text == "解除停押")
            {
                objAgentManageDB.NoXZHY("N_HYZH", mo_zhgl.N_HYZH, "1", GetSql);
            }
            else
            {
                objAgentManageDB.NoXZHY("N_HYZH", mo_zhgl.N_HYZH, "0", GetSql);
            }
            objAgentManageDB.Update(GetSql);
            drpDLS_SelectedIndexChanged(sender, e);
        }
        catch
        {
            this.ShowMsg("修改失敗");
        }
    }
Exemplo n.º 2
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);
  }