コード例 #1
0
ファイル: LeadAssign.aspx.cs プロジェクト: BInny1/car-sales
    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
ファイル: LeadAssign.aspx.cs プロジェクト: BInny1/car-sales
    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)
        {

        }
    }