protected void PoPuP(object sender, DirectEventArgs e) { int id = Convert.ToInt32(e.ExtraParams["id"]); string type = e.ExtraParams["type"]; switch (type) { case "ColName": //Step 1 : get the object from the Web Service panelRecordDetails.ActiveIndex = 0; RecordRequest r = new RecordRequest(); r.RecordID = id.ToString(); RecordResponse <VacationSchedule> response = _branchService.ChildGetRecord <VacationSchedule>(r); if (!response.Success) { X.MessageBox.ButtonText.Ok = Resources.Common.Ok; X.Msg.Alert(Resources.Common.Error, response.Summary).Show(); return; } //Step 2 : call setvalues with the retrieved object this.BasicInfoTab.SetValues(response.result); VacationPeriodsListRequest req = new VacationPeriodsListRequest(); req.VacationScheduleId = r.RecordID; ListResponse <VacationSchedulePeriod> periods = _branchService.ChildGetAll <VacationSchedulePeriod>(req); periodsGrid.Store[0].DataSource = periods.Items; periodsGrid.Store[0].DataBind(); periodsGrid.DataBind(); // InitCombos(response.result); this.EditRecordWindow.Title = Resources.Common.EditWindowsTitle; this.EditRecordWindow.Show(); break; case "colDelete": X.Msg.Confirm(Resources.Common.Confirmation, Resources.Common.DeleteOneRecord, new MessageBoxButtonsConfig { Yes = new MessageBoxButtonConfig { //We are call a direct request metho for deleting a record Handler = String.Format("App.direct.DeleteRecord({0})", id), Text = Resources.Common.Yes }, No = new MessageBoxButtonConfig { Text = Resources.Common.No } }).Show(); break; case "colAttach": //Here will show up a winow relatice to attachement depending on the case we are working on break; default: break; } }
protected void PoPuP(object sender, DirectEventArgs e) { string id = e.ExtraParams["id"]; string type = e.ExtraParams["type"]; leaveScheduleStore.Reload(); switch (type) { case "imgEdit": //Step 1 : get the object from the Web Service RecordRequest r = new RecordRequest(); r.RecordID = id; RecordResponse <LeaveType> response = _leaveManagementService.ChildGetRecord <LeaveType>(r); if (!response.Success) { X.MessageBox.ButtonText.Ok = Resources.Common.Ok; Common.errorMessage(response); return; } //Step 2 : call setvalues with the retrieved object this.BasicInfoTab.SetValues(response.result); apId.Select(response.result.apId.ToString()); this.EditRecordWindow.Title = Resources.Common.EditWindowsTitle; this.EditRecordWindow.Show(); break; case "imgDelete": X.Msg.Confirm(Resources.Common.Confirmation, Resources.Common.DeleteOneRecord, new MessageBoxButtonsConfig { Yes = new MessageBoxButtonConfig { //We are call a direct request metho for deleting a record Handler = String.Format("App.direct.DeleteRecord({0})", id), Text = Resources.Common.Yes }, No = new MessageBoxButtonConfig { Text = Resources.Common.No } }).Show(); break; case "imgAttach": //Here will show up a winow relatice to attachement depending on the case we are working on break; default: break; } }
protected void PoPuP(object sender, DirectEventArgs e) { string id = e.ExtraParams["leaveId"]; string employeeIdParam = e.ExtraParams["employeeId"]; string returnTypeParam = e.ExtraParams["returnType"]; string type = e.ExtraParams["type"]; ApprovalsGridPanel.Disabled = false; switch (type) { case "imgEdit": BasicInfoTab.Reset(); //LeaveRequestListRequest leaveReq = new LeaveRequestListRequest(); //leaveReq.BranchId = 0; //leaveReq.DepartmentId = 0; //leaveReq.raEmployeeId = 0; //leaveReq.EmployeeId = Convert.ToInt32(employeeId.SelectedItem.Value); //leaveReq.status = 2; //leaveReq.Size = "50"; //leaveReq.StartAt = "0"; //leaveReq.SortBy = "recordId"; //leaveReq.Filter = ""; //ListResponse<LeaveRequest> leaveResp = _leaveManagementService.ChildGetAll<LeaveRequest>(leaveReq); //if (!leaveResp.Success) //{ // X.MessageBox.ButtonText.Ok = Resources.Common.Ok; // Common.errorMessage(leaveResp); // return; //} //leaveIdStore.DataSource = leaveResp.Items; //leaveIdStore.DataBind(); LeaveReturnRecordRequest r = new LeaveReturnRecordRequest(); r.leaveId = id; RecordResponse <LeaveReturn> response = _leaveManagementService.ChildGetRecord <LeaveReturn>(r); if (!response.Success) { X.MessageBox.ButtonText.Ok = Resources.Common.Ok; Common.errorMessage(response); return; } employeeId.GetStore().Add(new object[] { new { recordId = response.result.employeeId, fullName = response.result.employeeName } }); employeeId.SetValue(response.result.employeeId); employeeId.Select(response.result.employeeId); fillLeavesStore(); //Step 2 : call setvalues with the retrieved object this.BasicInfoTab.SetValues(response.result); FillApprovalsStore(id, employeeIdParam, returnTypeParam); this.EditRecordWindow.Title = Resources.Common.EditWindowsTitle; this.EditRecordWindow.Show(); break; case "imgDelete": X.Msg.Confirm(Resources.Common.Confirmation, Resources.Common.DeleteOneRecord, new MessageBoxButtonsConfig { Yes = new MessageBoxButtonConfig { //We are call a direct request metho for deleting a record Handler = String.Format("App.direct.DeleteRecord({0},{1},{2})", id, employeeIdParam, returnTypeParam), Text = Resources.Common.Yes }, No = new MessageBoxButtonConfig { Text = Resources.Common.No } }).Show(); break; case "imgAttach": //Here will show up a winow relatice to attachement depending on the case we are working on break; default: break; } }