예제 #1
0
    protected void btnGo_Click(object sender, EventArgs e)
    {
        StateWiseLeadAllocationBL objAllocation = new StateWiseLeadAllocationBL();

        objAllocation.SetLeadAssignAllocationForCenters(ddlCenter1.SelectedValue.ToString(), hdnCSID1.Value, hdnSelectedStateID.Value, ddlVehicleType1.SelectedValue);

        FillStates();
        i = 0;
    }
예제 #2
0
    protected void grdAssign_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        StateWiseLeadAllocationBL objLeadsAssign = new StateWiseLeadAllocationBL();

        try
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                DataSet dsStateAllocation = new DataSet();
                if (i == 0)
                {
                    i = +1;
                    dsStateAllocation          = objLeadsAssign.GetStateAllocationForCenters(ddlVehicleType1.SelectedItem.Value);
                    Session["StateAllocation"] = dsStateAllocation;
                }
                else
                {
                    dsStateAllocation = (DataSet)Session["StateAllocation"];
                }
                LinkButton  lblStateCode  = (LinkButton)e.Item.FindControl("lblStateCode");
                HiddenField hdnCenterID   = (HiddenField)e.Item.FindControl("hdnCenterID");
                HiddenField hdnStateID    = (HiddenField)e.Item.FindControl("hdnStateID");
                HiddenField hdnCSID       = (HiddenField)e.Item.FindControl("hdnCSID");
                Label       lblCenterName = (Label)e.Item.FindControl("lblCenterName");
                DataTable   dt            = new DataTable();
                DataView    dv            = new DataView();
                dv           = dsStateAllocation.Tables[0].DefaultView;
                dv.RowFilter = "StateID=" + hdnStateID.Value + "";

                dt = dv.ToTable();
                if (dt.Rows.Count > 0)
                {
                    lblCenterName.Text = "-" + dt.Rows[0]["AgentCenterCode"].ToString();
                    hdnCenterID.Value  = dt.Rows[0]["CenterID"].ToString();
                    hdnCSID.Value      = dt.Rows[0]["CSID"].ToString();
                }
            }
        }
        catch (Exception ex)
        {
        }
    }