protected void lnkEdit_Click(object sender, EventArgs e) { EnableDisableCommandButtons(true); LinkButton lnkBtn = (LinkButton)sender; AttendanceApplicationID = int.Parse(lnkBtn.CommandArgument); AttendanceApplication objAttendanceApplication = new AttendanceApplication(); objAttendanceApplication = AttendanceApplicationManagement.GetAttendanceApplicationByAttendanceApplicationID(AttendanceApplicationID); // objAttendanceAmendment = AttendanceAmendmentManagement.GetAttendanceAmendmentByAttendanceAmendmentID(AttendanceAmendmentID); // lbl_AttandanceApproval.Text = String.Format("{0} details of {1}", objAttendanceApplication.EmployeeName, objAt); txt_EmpCode.Text = objAttendanceApplication.EmployeeCode; txt_EmpName.Text = objAttendanceApplication.EmployeeName; txt_Designation.Text = objAttendanceApplication.DesignationDescription; txt_AttendanceDate.Text = objAttendanceApplication.DateOfAttendance.ToShortDateString(); txt_InTime.Text = objAttendanceApplication.InTime.ToString("HH:mm:ss"); txt_OutTime.Text = objAttendanceApplication.OutTime.ToString("HH:mm:ss"); }
protected void gridview_AttendanceApply_RowCommand(object sender, GridViewCommandEventArgs e) { try { // EnabledisableButtons(true); int RowIndex = Convert.ToInt32(e.CommandArgument); int RecordID = int.Parse(((Label)gridview_AttendanceApply.Rows[RowIndex].FindControl("lbl_AttendanceApplicationID")).Text); lbl_DataOperationMode.Text = String.Format("EDIT APPLICATION : {0} [{1}]", gridview_AttendanceApply.Rows[RowIndex].Cells[2].Text.ToUpper(), RecordID); PageVariables.ThisAttendanceApplication = AttendanceApplicationManagement.GetAttendanceApplicationByAttendanceApplicationID(RecordID); if (e.CommandArgument.Equals("First")) { RowIndex = 0; } else if (e.CommandArgument.Equals("Last")) { RowIndex = gridview_AttendanceApply.PageCount - 1; } else { RowIndex = Convert.ToInt32(e.CommandArgument); } if (e.CommandName.Equals(MicroEnums.DataOperation.Edit.GetStringValue())) { Btn_Save.Text = MicroEnums.DataOperation.Update.GetStringValue(); multiView_AttandenceApplicationDetails.SetActiveView(view_InputControls); PopulatePageFields(PageVariables.ThisAttendanceApplication); EnableControls(view_InputControls, true); //ChangeBackColor(view_InputControls); } else if (e.CommandName.Equals(MicroEnums.DataOperation.Delete.GetStringValue())) { int ProcReturnValue = 0; ProcReturnValue = DeleteRecord(PageVariables.ThisAttendanceApplication); if (ProcReturnValue > 0) { lbl_TheMessage.Text = ReadXML.GetSuccessMessage("OK_ATTENDANCEAMMENDMENT_DELETED"); FillGridView(); dialog_Message.Show(); } else { lbl_TheMessage.Text = ReadXML.GetFailureMessage("KO_ATTENDANCEAMMENDMENT_DELETED"); dialog_Message.Show(); } } //else if (e.CommandName.Equals(MicroEnums.DataOperation.Select.GetStringValue())) //{ // lbl_DataOperationMode.Text = String.Format("VIEW DCACCOUNT : {0} [{1}]", gridview_AttendanceAmmendmentApply.Rows[RowIndex].Cells[2].Text.ToUpper(), RecordID); // multiView_DCAccounts.SetActiveView(view_InputControls); // EnableControls(view_InputControls, false); // PopulateFormFields(PageVariables.ThisDCAccount); // EnabledisableButtons(false); //} } catch (Exception ex) { throw new Exception(ex.Message); } }