Ejemplo n.º 1
0
    public void GridUserUpdateList_RowDeleting(object sender, EventArgs e)
    {
        int Cols = GridUserUpdateList.Rows.Count;

        GridUserUpdateList.DeleteRow(Cols);
        GridUserUpdateList.DataBind();
    }
Ejemplo n.º 2
0
    public void lnlupdatelist_Click(object sender, EventArgs e)
    {
        String empid = ""; String empid1 = "";
        //Deactivate Emploees from HR
        DataSet DeactivEMp  = objHotLeadBL.CheckDeactEmployees();
        int     DeacEmpcoun = DeactivEMp.Tables[0].Rows.Count;

        if (DeacEmpcoun >= 1)
        {
            for (int i = 0; i < DeactivEMp.Tables[0].Rows.Count; i++)
            {
                empid = DeactivEMp.Tables[0].Rows[0]["EMpid"].ToString() + ",";
            }
            if (empid.EndsWith(","))
            {
                empid = empid.Remove(empid.Length - 1, 1);
            }

            //Updating List
            bool Updatelist = objHotLeadBL.UpdateDeactEmployees();
        }
        //If Reactive Employees

        DataSet ReactiveEmp = objHotLeadBL.ReactiveEmp();
        int     Reacount    = ReactiveEmp.Tables[0].Rows.Count;

        if (Reacount >= 1)
        {
            for (int i = 0; i < ReactiveEmp.Tables[0].Rows.Count; i++)
            {
                empid1 = ReactiveEmp.Tables[0].Rows[0]["Empid"].ToString() + ",";
            }
            if (empid1.EndsWith(","))
            {
                empid1 = empid1.Remove(empid1.Length - 1, 1);
            }

            //Updating Reactive List
            bool Updatelist = objHotLeadBL.UpdateReactiveEmp();
        }
        if (empid.Length > 1 && empid1.Length > 1)
        {
            string text = "" + empid + "  deactivate and  \\n " + empid1 + "  activated from HR System.so changing status in carsales";
            System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Script", "alert('" + text + "');", true);
        }
        else if (empid.Length > 1 && empid1.Length < 1)
        {
            System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Script", "alert('" + empid + "  deactivate from HR System.so changing status in carsales');", true);
        }
        else if (empid.Length < 1 && empid1.Length > 1)
        {
            System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Script", "alert('" + empid1 + "  activated from HR System.so changing status in carsales');", true);
        }

        //if all records are complted to add

        DataSet dsSalesUpdateList = objHotLeadBL.SalesUsersUpdateList(Convert.ToInt32(ddlcenters.SelectedValue));
        int     EMpcoun           = dsSalesUpdateList.Tables[0].Rows.Count;

        if (EMpcoun > 1)
        {
            MpUserUpdatelist.Show();
            GridUserUpdateList.DataSource = dsSalesUpdateList.Tables[0];
            GridUserUpdateList.DataBind();
        }
        else
        {
            System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Script", "alert('No More New Employees from HR System.');", true);
        }
    }