public void InsertOfficerDetails()
    {
        string Result;

        objOfficer            = new clsOfficerRegistration();
        objOfficer.FName      = txtFName.Text.Trim();
        objOfficer.MName      = txtMName.Text.Trim();
        objOfficer.LName      = txtLName.Text.Trim();
        objOfficer.DOB        = Convert.ToDateTime(txtDOB.Text);
        objOfficer.Address    = txtAddress.Text;
        objOfficer.EmailId    = txtEmailId.Text.Trim();
        objOfficer.PhoneNo    = txtPhoneNo.Text.Trim();
        objOfficer.UserName   = txtUserName.Text.Trim();
        objOfficer.Password   = txtPassword.Text.Trim();
        objOfficer.Experience = txtExperience.Text.Trim();
        objOfficer.Photo      = (byte[])Session["Photo"];
        objOfficer.ImageFile  = Session["FileName"].ToString();
        int i = objOfficer.InsertOfficerDetails(out Result);

        if (i > 0)
        {
            Page.RegisterClientScriptBlock("Student", "<script>alert('" + Result + "')</script>");
        }
        else
        {
            Page.RegisterClientScriptBlock("Student", "<script>alert('" + Result + "')</script>");
        }
    }
Пример #2
0
    public void GetOfficerProfile()
    {
        objOfficer           = new clsOfficerRegistration();
        objOfficer.OfficerId = Convert.ToInt32(Session["OfficerId"]);
        DataSet dsOfficer = objOfficer.GetOfficerProfile();

        if (dsOfficer.Tables[0].Rows.Count > 0)
        {
            lblOfficerId.Text  = dsOfficer.Tables[0].Rows[0][0].ToString();
            txtFirstName.Text  = dsOfficer.Tables[0].Rows[0][1].ToString();
            txtMiddleName.Text = dsOfficer.Tables[0].Rows[0][2].ToString();
            txtLastName.Text   = dsOfficer.Tables[0].Rows[0][3].ToString();
            txtAddress.Text    = dsOfficer.Tables[0].Rows[0][6].ToString();
            txtPhone.Text      = dsOfficer.Tables[0].Rows[0][8].ToString();
            txtEmailId.Text    = dsOfficer.Tables[0].Rows[0][7].ToString();
        }
    }
Пример #3
0
    public void UpdateOfficerProfile()
    {
        objOfficer           = new clsOfficerRegistration();
        objOfficer.OfficerId = Convert.ToInt32(Session["OfficerId"]);
        objOfficer.FName     = txtFirstName.Text.Trim();
        objOfficer.MName     = txtMiddleName.Text.Trim();
        objOfficer.LName     = txtLastName.Text.Trim();
        objOfficer.Address   = txtAddress.Text;
        objOfficer.PhoneNo   = txtPhone.Text.Trim();
        objOfficer.EmailId   = txtEmailId.Text.Trim();
        objOfficer.Photo     = (byte[])Session["Photo"];
        objOfficer.ImageFile = Session["FileName"].ToString();
        int i = objOfficer.UpdateOfficerProfile();

        if (i > 0)
        {
            Page.RegisterClientScriptBlock("Officer", "<script>alert('Profile Updated')</script>");
        }
        else
        {
            Page.RegisterClientScriptBlock("Officer", "<script>alert('Bad Request')</script>");
        }
    }