Ejemplo n.º 1
0
    public void OnConfirm(object sender, EventArgs e)
    {
        string confirmValue = Request.Form["confirm_value"];

        if (confirmValue == "Yes")
        {
            //Deactivating Empid from carsales.
            string  EMpid             = Session["EMpid"].ToString();
            DataSet dsSalesUpdateList = objHotLeadBL.DeleteEmployee(EMpid);
            System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Script", "alert('" + EMpid + " has been deleted succesfully.');", true);
            MpVechlAdd.Hide();
            GetUserDefaultRights();
        }
        else
        {
        }
    }
Ejemplo n.º 2
0
    protected void GridDefaultUserRights_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        try
        {
            MpVechlAdd.Show();
            if (e.CommandName == "Empdeta")
            {
                Ckleads.Items[0].Selected      = false; Ckleads.Items[1].Selected = false; Ckleads.Items[2].Selected = false; Ckleads.Items[3].Selected = false;
                chksales.Items[0].Selected     = false; chksales.Items[1].Selected = false; chksales.Items[2].Selected = false; chksales.Items[3].Selected = false;
                ChkReports.Items[0].Selected   = false; ChkReports.Items[1].Selected = false; ChkReports.Items[1].Selected = false;
                chksaleadmin.Items[0].Selected = false;
                string EmpIdva = e.CommandArgument.ToString();


                Session["EMpid"] = EmpIdva.ToString();
                DataSet GetUserDefaultRight = new DataSet();
                GetUserDefaultRight = objHotLeadBL.AllEMployeeUserRights(EmpIdva.ToString());
                int count = GetUserDefaultRight.Tables[0].Rows.Count;

                for (int i = 0; i < count; i++)
                {
                    if (GetUserDefaultRight.Tables[0].Rows[i]["Active"].ToString() == "1")
                    {
                        string Modulename = GetUserDefaultRight.Tables[0].Rows[i]["SubModuleName"].ToString();

                        if (Modulename == "LeadsUpload")
                        {
                            Ckleads.Items[0].Selected = true;
                        }

                        if (Modulename == "Transferin")
                        {
                            Ckleads.Items[1].Selected = true;
                        }
                        if (Modulename == "Abondoned")
                        {
                            Ckleads.Items[2].Selected = true;
                        }
                        if (Modulename == "FreePackage")
                        {
                            Ckleads.Items[3].Selected = true;
                        }

                        if (Modulename == "IntroMail")
                        {
                            chksales.Items[0].Selected = true;
                        }
                        if (Modulename == "NewEntry")
                        {
                            chksales.Items[1].Selected = true;
                        }
                        if (Modulename == "TransferOut")
                        {
                            chksales.Items[2].Selected = true;
                        }
                        if (Modulename == "Ticker")
                        {
                            chksales.Items[3].Selected = true;
                        }

                        if (Modulename == "Self")
                        {
                            ChkReports.Items[0].Selected = true;
                        }
                        if (Modulename == "Center")
                        {
                            ChkReports.Items[1].Selected = true;
                        }

                        if (Modulename == "SalesAdmin")
                        {
                            chksaleadmin.Items[0].Selected = true;
                        }
                    }
                }
            }
        }
        catch { }
    }
Ejemplo n.º 3
0
    protected void btnAddVehicle_Click(object sender, EventArgs e)
    {
        //DataSet UserEmploRights = objHotLeadBL.UpdateUserRights(EMPID,LeadsUpload,LeadsDownLoad ,Abondoned,FreePackage ,Ticker ,IntroMail ,
        //                      NewEntry ,Transferin ,MyReport ,QC ,Payments ,Publish ,MyReport1 ,Leads ,Sales ,Process ,Executive ,LeadsAdmin ,
        //                      SalesAdmin ,ProcessAdmin ,ExecutiveAdmin ,BrandsAdmin ,CentersAdmin ,UsersLog ,EditLog ,Center ,Self );

        bool LeadsUpload = false, LeadsDownLoad = false, Abondoned = false, FreePackage = false, Ticker = false, IntroMail = false,
             NewEntry = false, Transferin = false, TransferOut = false, QC = false, Payments = false, Publish = false, MyReport1 = false,
             Leads = false, Sales = false, Process = false, Executive = false, LeadsAdmin = false,
             SalesAdmin = false, ProcessAdmin = false, ExecutiveAdmin = false, BrandsAdmin = false,
             CentersAdmin = false, UsersLog = false, EditLog = false, Center = false, Self = false;
        string EMPID = "";

        if (Ckleads.Items[0].Selected == true)
        {
            LeadsUpload = true; LeadsDownLoad = true;
        }
        else
        {
            LeadsUpload = false; LeadsDownLoad = false;
        }

        if (Ckleads.Items[1].Selected == true)
        {
            Transferin = true;
        }
        else
        {
            Transferin = false;
        }
        if (Ckleads.Items[2].Selected == true)
        {
            Abondoned = true;
        }
        else
        {
            Abondoned = false;
        }
        if (Ckleads.Items[3].Selected == true)
        {
            FreePackage = true;
        }
        else
        {
            FreePackage = false;
        }


        if (chksales.Items[0].Selected == true)
        {
            IntroMail = true;
        }
        else
        {
            IntroMail = false;
        }
        if (chksales.Items[1].Selected == true)
        {
            NewEntry = true;
        }
        else
        {
            NewEntry = false;
        }
        if (chksales.Items[2].Selected == true)
        {
            TransferOut = true;
        }
        else
        {
            TransferOut = false;
        }
        if (chksales.Items[3].Selected == true)
        {
            Ticker = true;
        }
        else
        {
            Ticker = false;
        }


        if (ChkReports.Items[0].Selected == true)
        {
            Self = true;
        }
        else
        {
            Self = false;
        }
        if (ChkReports.Items[1].Selected == true)
        {
            Center = true;
        }
        else
        {
            Center = false;
        }

        if (chksaleadmin.Items[0].Selected == true)
        {
            LeadsAdmin = true;
        }
        else
        {
            LeadsAdmin = false;
        }


        EMPID = Session["EMpid"].ToString();

        string usertypid = "", LogPerson = "";

        try
        {
            usertypid = Session[Constants.USER_TYPE_ID].ToString();
        }
        catch { usertypid = "1"; }
        try
        {
            LogPerson = Session[Constants.USER_ID].ToString();
        }
        catch { }
        DataSet UserEmploRights = objHotLeadBL.UpdateUserRightsSales(EMPID, LeadsUpload, LeadsDownLoad, Abondoned, FreePackage, Ticker, IntroMail,
                                                                     NewEntry, Transferin, TransferOut, Center, Self, SalesAdmin, usertypid, LogPerson);

        System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Script", "alert('User Rights are updated successfully.');", true);
        GetUserDefaultRights();
        MpVechlAdd.Hide();
    }