protected void bt_Save_Click(object sender, EventArgs e)
    {
        select_Client.SelectValue = "0";
        select_Client.SelectText  = "";
        ORD_OrderApply_ClientTimesBLL bll;

        if (gv_List.SelectedIndex > -1)
        {
            bll = new ORD_OrderApply_ClientTimesBLL((int)gv_List.DataKeys[gv_List.SelectedIndex].Value);
        }
        else
        {
            bll = new ORD_OrderApply_ClientTimesBLL();
        }
        int Client = 0, Times = 1;

        int.TryParse(select_Client2.SelectValue, out Client);
        int.TryParse(tbx_Times.Text, out Times);
        bll.Model.Client     = Client;
        bll.Model.OrderTimes = Times;
        if (bll.Model.ID > 0)
        {
            bll.Update();
        }
        else
        {
            bll.Add();
        }
        MessageBox.Show(this, "保存成功!");
        BindGrid();
    }
    private void BindGrid()
    {
        int OrganizeCity = 0, Client = 0;

        int.TryParse(tr_OrganizeCity.SelectValue, out OrganizeCity);
        int.TryParse(select_Client.SelectValue, out Client);

        gv_List.DataSource = ORD_OrderApply_ClientTimesBLL.GetByOrganizeCity(OrganizeCity, Client);
        gv_List.BindGrid();

        tr_Detail.Visible = false;
    }
 protected void gv_List_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (gv_List.SelectedIndex > -1)
     {
         ORD_OrderApply_ClientTimesBLL bll = new ORD_OrderApply_ClientTimesBLL((int)gv_List.DataKeys[gv_List.SelectedIndex].Value);
         select_Client2.SelectValue = bll.Model.Client.ToString();
         select_Client2.SelectText = new CM_ClientBLL(bll.Model.Client).Model.FullName;
         tbx_Times.Text = bll.Model.OrderTimes.ToString();
         tr_Detail.Visible = true;
     }
     else
         tr_Detail.Visible = false;
 }
 protected void gv_List_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (gv_List.SelectedIndex > -1)
     {
         ORD_OrderApply_ClientTimesBLL bll = new ORD_OrderApply_ClientTimesBLL((int)gv_List.DataKeys[gv_List.SelectedIndex].Value);
         select_Client2.SelectValue = bll.Model.Client.ToString();
         select_Client2.SelectText  = new CM_ClientBLL(bll.Model.Client).Model.FullName;
         tbx_Times.Text             = bll.Model.OrderTimes.ToString();
         tr_Detail.Visible          = true;
     }
     else
     {
         tr_Detail.Visible = false;
     }
 }
 protected void bt_Save_Click(object sender, EventArgs e)
 {
     select_Client.SelectValue = "0";
     select_Client.SelectText = "";
     ORD_OrderApply_ClientTimesBLL bll;
     if (gv_List.SelectedIndex > -1)
         bll = new ORD_OrderApply_ClientTimesBLL((int)gv_List.DataKeys[gv_List.SelectedIndex].Value);
     else
         bll = new ORD_OrderApply_ClientTimesBLL();
     int Client=0,Times=1;
     int.TryParse(select_Client2.SelectValue,out Client);
     int.TryParse(tbx_Times.Text,out Times);
     bll.Model.Client = Client;
     bll.Model.OrderTimes = Times;
     if (bll.Model.ID > 0)
         bll.Update();
     else
         bll.Add();
     MessageBox.Show(this, "保存成功!");
     BindGrid();
 }