Esempio n. 1
0
    protected void btnRemoveEmployee_Click(object sender, EventArgs e)
    {
        try
        {
            int ResID = 0;
            if (HiddenField1.Value.ToString() != "")
            {
                ResID = Convert.ToInt32(HiddenField1.Value.ToString());

                Resident res = new Resident();

                bool result = res.DeactivateResident(DateTime.UtcNow, ResID);
                if (result)
                {
                    FillEmployeeData();
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "alertmessage", "javascript:hideRemoveEmployeeModal()", true);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "alertmessage", "javascript:alert(Error)", true);
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alertmessage", "javascript:alert(Empty Employee)", true);
            }
        }
        catch (Exception ex)
        {
        }
    }
Esempio n. 2
0
    protected void removeno_Click(object sender, EventArgs e)
    {
        try
        {
            int resid  = Convert.ToInt32(HiddenField1.Value);
            int userid = Convert.ToInt32(HiddenField2.Value);

            Resident deactresident = new Resident();
            bool     result        = deactresident.DeactivateResident(DateTime.UtcNow, resid);

            if (result)
            {
                FillFlatdata();
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alertmessage", "javascript:HideRemoveOwner()", true);
            }
            else
            {
                lblRemoveOwnerMessage.ForeColor = System.Drawing.Color.Red;
                lblRemoveOwnerMessage.Text      = "Could not remove owner try later or Contact Admin";
            }
        }
        catch (Exception ex)
        {
        }
    }