Exemple #1
0
    public void btnSaveRetension_click(object sender, EventArgs e)
    {
        long        id       = Convert.ToInt64(hdnselected.Value);
        tblAllottee _allotte = Allottee.GetAllottee(id);

        if (_allotte != null)
        {
            DateTime dateofRetension;
            DateTime.TryParse(txtDateOfRetension.Text, out dateofRetension);
            DateTime dateofRetensionupto;
            DateTime.TryParse(txtdateofretensionupto.Text, out dateofRetensionupto);
            _allotte.DateOfRetensionUpto = dateofRetensionupto;

            _allotte.Status          = (int)AllotementStatus.Retension;
            _allotte.DateOfRetension = dateofRetension;
            _allotte.RetentionReason = ddlRetentionRule.SelectedValue;
            Allottee.Update(_allotte);
            BindData();
            Quarters.UpdateQuarterStatus(_allotte.tblQuarter.Id, QuarterStatus.Vacant);
            tbluserhistory _userhistory = new tbluserhistory();
            _userhistory.Action      = "Allotement";
            _userhistory.description = _user.Username + " has marked vacant with id " + id;
            _userhistory.time        = DateTime.Now;
            _userhistory.useraan     = _user.AAN;
            userHistory.Save(_userhistory);
        }
    }
Exemple #2
0
    protected void gridCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Allotte")
        {
            long id;
            Int64.TryParse(e.CommandArgument.ToString(), out id);

            var gridRow = ((LinkButton)e.CommandSource).NamingContainer as GridViewRow;


            HiddenField hidApplicationId = gridRow.FindControl("hidApplicationId") as HiddenField;

            //AllotementApplications.UpdateApplicationStaus(id, ApplicationStatus.Allotted);
            Response.Redirect("~/admin/Allottee.aspx?appid=" + hidApplicationId.Value + "&ChangeRequestID=" + id + "&returnurl=admin/ViewChangeRequest.aspx");
        }
        else if (e.CommandName == "Withdraw")
        {
            long id;
            Int64.TryParse(e.CommandArgument.ToString(), out id);
            DataClassesDataContext dataContext = new DataClassesDataContext();
            var requests = from request in dataContext.tblChangeRequests where request.Id == id select request;
            tblChangeRequest tblreject = requests.FirstOrDefault();
            if (tblreject != null)
            {
                //Added on January 24,2017
                tblAllottee allottee = Allottee.GetAllotteeByAAN(tblreject.AAN);
                Quarters.UpdateQuarterStatus(allottee.QuarterNumber, QuarterStatus.Vacant);

                //update allottee
                //Reset the quarter to previous one at the time of change request
                allottee.QuarterNumber = tblreject.QuarterNumber;
                Allottee.Update(allottee);
                //Added on January 24,2017 end

                dataContext.tblChangeRequests.DeleteOnSubmit(tblreject);
                dataContext.SubmitChanges();
            }
            BindGrid();
            AllotementApplications.UpdateApplicationStaus(id, ApplicationStatus.rejected);
            //Quarters.UpdateQuarterStatus(tblreject.QuarterNumber, QuarterStatus.Vacant); //Commented on Dec 12,2016 purposely
        }
        else if (e.CommandName == "Possesed")
        {
            var        gridRow    = ((LinkButton)e.CommandSource).NamingContainer as GridViewRow;
            LinkButton lnkAllotte = gridRow.FindControl("lnkAllotte") as LinkButton;
            hdnChangeRequestId.Value = lnkAllotte.CommandArgument;

            hdnSelected.Value = e.CommandArgument.ToString();
            tblAllottee _allotte = Allottee.getAllotteByApplicationid(Convert.ToInt64(e.CommandArgument));
            txtName.Text = AllotementApplications.GetApplication(Convert.ToInt64(e.CommandArgument)).tblUser.fullName;
            if (_allotte != null)
            {
                txtQuarternumber.Text = _allotte.QuarterNumber;
            }

            pop.Show();
        }
    }
    protected void grdQuarters_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "UpdateStatus")
        {
            Button btnUpdateStatus = e.CommandSource as Button;
            if (btnUpdateStatus != null)
            {
                long        quarterId   = Convert.ToInt64(e.CommandArgument);
                GridViewRow selectedRow = btnUpdateStatus.NamingContainer as GridViewRow;
                if (selectedRow != null)
                {
                    int         status            = 0;
                    RadioButton radBtnCPWD        = (RadioButton)selectedRow.FindControl("radBtnCPWD");
                    RadioButton radBtnDamaged     = (RadioButton)selectedRow.FindControl("radBtnDamaged");
                    RadioButton radBtnVacant      = (RadioButton)selectedRow.FindControl("radBtnVacant");
                    RadioButton radBtnSurrender   = (RadioButton)selectedRow.FindControl("radBtnSurrender");
                    TextBox     txtDateOfVacation = (TextBox)selectedRow.FindControl("txtDateOfVacation");

                    TextBox txtRemarks = (TextBox)selectedRow.FindControl("txtRemarks");

                    if (radBtnCPWD.Checked)
                    {
                        status = (int)QuarterStatus.CPWD;
                    }
                    else if (radBtnDamaged.Checked)
                    {
                        status = (int)QuarterStatus.Damaged;
                    }
                    else if (radBtnVacant.Checked)
                    {
                        status = (int)QuarterStatus.Vacant;
                    }
                    else if (radBtnSurrender.Checked)
                    {
                        status = (int)QuarterStatus.Surrender;
                    }


                    Quarters.UpdateQuarterStatus(quarterId, status, txtRemarks.Text, txtDateOfVacation.Text);
                }
            }
        }
        SearchAndBindQuarters(txtSearch.Text.Trim());
    }
Exemple #4
0
    protected void btnVacant_click(object sender, EventArgs e)
    {
        int         id       = Convert.ToInt32(hdnselected.Value);
        tblAllottee _allotte = Allottee.GetAllottee(id);

        if (_allotte != null)
        {
            DateTime dateofVacation;
            DateTime.TryParse(txtDateOfVacation.Text, out dateofVacation);
            _allotte.Status         = (int)AllotementStatus.vacant;
            _allotte.DateOfVacation = dateofVacation;
            Allottee.Update(_allotte);
            BindData();
            Quarters.UpdateQuarterStatus(_allotte.tblQuarter.Id, (int)QuarterStatus.Vacant, "Quarter marked as vacant.", txtDateOfVacation.Text);
            tbluserhistory _userhistory = new tbluserhistory();
            _userhistory.Action      = "Allotement";
            _userhistory.description = _user.Username + " has marked vacant with id " + id;
            _userhistory.time        = DateTime.Now;
            _userhistory.useraan     = _user.AAN;
            userHistory.Save(_userhistory);
        }
    }
Exemple #5
0
    protected void gridCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Allotte")
        {
            long id;
            Int64.TryParse(e.CommandArgument.ToString(), out id);
            // AllotementApplications.UpdateApplicationStaus(id, ApplicationStatus.Allotted);
            Response.Redirect("~/admin/Allottee.aspx?Applicationid=" + id + "&returnurl=admin/Prioritizeapplications.aspx");
        }
        else if (e.CommandName == "Possesed")
        {
            hdnSelected.Value = e.CommandArgument.ToString();
            tblAllottee _allotte = Allottee.getAllotteByApplicationid(Convert.ToInt64(e.CommandArgument));
            txtName.Text          = AllotementApplications.GetApplication(Convert.ToInt64(e.CommandArgument)).tblUser.fullName;
            txtQuarternumber.Text = _allotte.QuarterNumber;

            pop.Show();
        }
        else if (e.CommandName == "Withdraw")
        {
            long id;
            Int64.TryParse(e.CommandArgument.ToString(), out id);
            AllotementApplications.UpdateApplicationStaus(id, ApplicationStatus.withdraw);
            Allottee.UpdateAllottementStatus(id, AllotementStatus.withdraw);
            tblAllottee _allotte = Allottee.getAllotteByApplicationid(id);
            if (_allotte != null)
            {
                long quarterid = _allotte.tblQuarter.Id;
                _allotte.Status         = (int)AllotementStatus.withdraw;
                _allotte.DateOfwithdraw = DateTime.Now;
                Allottee.Update(_allotte);

                Quarters.UpdateQuarterStatus(_allotte.tblQuarter.Id, QuarterStatus.Vacant);
            }
            tbluserhistory _userhistory = new tbluserhistory();
            _userhistory.Action      = "Withdraw";
            _userhistory.description = _user.Username + " has marked Withdraw application with " + id;
            _userhistory.time        = DateTime.Now;
            _userhistory.useraan     = _user.AAN;
            userHistory.Save(_userhistory);
            // Response.Redirect("~/admin/Allottee.aspx?Applicationid=" + id + "&returnurl=admin/Prioritizeapplications.aspx");
        }
        else if (e.CommandName == "CancelApplication")
        {
            //Move quarter to vacant list
            long id;
            Int64.TryParse(e.CommandArgument.ToString(), out id);
            AllotementApplications.UpdateApplicationStaus(id, ApplicationStatus.rejected);
            Allottee.UpdateAllottementStatus(id, AllotementStatus.vacant);
            tblAllottee _allotte = Allottee.getAllotteByApplicationid(id);
            if (_allotte != null)
            {
                long quarterid = _allotte.tblQuarter.Id;
                _allotte.Status         = (int)AllotementStatus.vacant;
                _allotte.DateOfVacation = DateTime.Now;
                Allottee.Update(_allotte);

                Quarters.UpdateQuarterStatus(_allotte.tblQuarter.Id, QuarterStatus.Vacant);
            }
            tbluserhistory _userhistory = new tbluserhistory();
            _userhistory.Action      = "Cancel";
            _userhistory.description = _user.Username + " has marked cancel application with " + id;
            _userhistory.time        = DateTime.Now;
            _userhistory.useraan     = _user.AAN;
            userHistory.Save(_userhistory);
        }
        BindData();
        //DataNavigateUrlFormatString="~/admin/Allottee.aspx?Applicationid={0}&returnurl=admin/Prioritizeapplications.aspx"
    }