public Contract(int id, decimal ssNumber, decimal personNumber, Organization organization, DateTime?hireDate, DateTime?terminationDate, int count, PayCode payCode, decimal rate, string table, string grade, string step, string jobCode, decimal empLongevityAmount, decimal type, decimal empFilled, decimal retirementLock, decimal retirementCode, DateTime?serviceDate, DateTime?anniversaryDate, decimal retirementNumber, string terminationType, string meritStatus, string empEeofunction) { Id = id; SSNumber = ssNumber; PersonNumber = personNumber; Organization = organization; HireDate = hireDate; TerminationDate = terminationDate; Count = count; PayCode = payCode; Rate = rate; Table = table; Grade = grade; Step = step; JobCode = jobCode; EmpLongevityAmount = empLongevityAmount; Type = type; EmpFilled = empFilled; RetirementLock = retirementLock; RetirementCode = retirementCode; ServiceDate = serviceDate; AnniversaryDate = anniversaryDate; RetirementNumber = retirementNumber; TerminationType = terminationType; MeritStatus = meritStatus; EmpEeofunction = empEeofunction; }
protected void addED(object sender, DirectEventArgs e) { PayCode obj = new PayCode(); obj.name = paycodeRef.Text; obj.payCode = paycodeRef.Text; PostRequest <PayCode> req = new PostRequest <PayCode>(); req.entity = obj; PostResponse <PayCode> response = _PayrollService.ChildAddOrUpdate <PayCode>(req); if (response.Success) { Store2.Reload(); paycodeRef.Select(paycodeRef.Text); paycodeRef.SetValue(paycodeRef.Text); } else { X.MessageBox.ButtonText.Ok = Resources.Common.Ok; Common.errorMessage(response); return; } }
private void AddWorkCodeObjects(TreeNode node) { if (node.Nodes.Count == 0) { return; } Code cobj = cctr.GetAdditionDeductionCodes().Where(o => o.ccode == node.Name).FirstOrDefault(); if (cobj != null) { foreach (TreeNode n in node.Nodes) { PayCode pc = new PayCode(); if (cobj.RelatedWorkCodes == null) { cobj.RelatedWorkCodes = new List <PayCode>(); pc = cctr.GetWorkCodes(false).Where(o => o.pacode == n.Name).FirstOrDefault(); cobj.RelatedWorkCodes.Add(pc); } else { if (cobj.RelatedWorkCodes.Count > 0) { pc = cobj.RelatedWorkCodes.Where(o => o.pacode == n.Name).FirstOrDefault(); } else { pc = null; } if (pc == null) { pc = cctr.GetWorkCodes(false).Where(o => o.pacode == n.Name).FirstOrDefault(); cobj.RelatedWorkCodes.Add(pc); } } } } if (dbobj == null) { dbobj = new Code(); bSave.Enabled = true; } dbobj = cobj; dbobj.RelatedWorkCodes = cobj.RelatedWorkCodes; //throw new NotImplementedException(); }
public void DeleteRecord(string paycode, string name) { try { //Step 1 Code to delete the object from the database PayCode s = new PayCode(); s.payCode = paycode; s.name = name; //s.intName = ""; PostRequest <PayCode> req = new PostRequest <PayCode>(); req.entity = s; PostResponse <PayCode> r = _payrollService.ChildDelete <PayCode>(req); if (!r.Success) { X.MessageBox.ButtonText.Ok = Resources.Common.Ok; Common.errorMessage(r); return; } else { //Step 2 : remove the object from the store Store1.Reload(); //Step 3 : Showing a notification for the user Notification.Show(new NotificationConfig { Title = Resources.Common.Notification, Icon = Icon.Information, Html = Resources.Common.RecordDeletedSucc }); } } catch (Exception ex) { //In case of error, showing a message box to the user X.MessageBox.ButtonText.Ok = Resources.Common.Ok; X.Msg.Alert(Resources.Common.Error, Resources.Common.ErrorDeletingRecord).Show(); } }
public PersonnelWithContractDetails(string name, decimal ssNumber, decimal personNumber, int contractId, Organization organization, DateTime?hireDate, DateTime?terminationDate, int count, PayCode payCode, decimal rate, string table, string grade, string step, string jobCode, decimal empLongevityAmount, decimal type, decimal empFilled, decimal retirementLock, decimal retirementCode, DateTime?serviceDate, DateTime?anniversaryDate, decimal retirementNumber, string terminationType, string meritStatus, string empEeofunction, string jobTitle, IEnumerable <Deduction> deductions, IEnumerable <YtdHistory> ytdHistories) { Name = name; SSNumber = ssNumber; PersonNumber = personNumber; Id = contractId; Organization = organization; HireDate = hireDate; TerminationDate = terminationDate; Count = count; PayCode = payCode; Rate = rate; Table = table; Grade = grade; Step = step; JobCode = jobCode; EmpLongevityAmount = empLongevityAmount; Type = type; EmpFilled = empFilled; RetirementLock = retirementLock; RetirementCode = retirementCode; ServiceDate = serviceDate; AnniversaryDate = anniversaryDate; RetirementNumber = retirementNumber; TerminationType = terminationType; MeritStatus = meritStatus; EmpEeofunction = empEeofunction; JobTitle = jobTitle; Deductions = deductions; YtdHistories = ytdHistories; }
protected void SaveNewRecord(object sender, DirectEventArgs e) { //Getting the id to check if it is an Add or an edit as they are managed within the same form. string obj = e.ExtraParams["values"]; PayCode b = JsonConvert.DeserializeObject <PayCode>(obj); // Define the object to add or edit as null if (string.IsNullOrEmpty(b.payCode)) { try { //New Mode //Step 1 : Fill The object and insert in the store PostRequest <PayCode> request = new PostRequest <PayCode>(); request.entity = b; PostResponse <PayCode> r = _payrollService.ChildAddOrUpdate <PayCode>(request); //check if the insert failed if (!r.Success)//it maybe be another condition { //Show an error saving... X.MessageBox.ButtonText.Ok = Resources.Common.Ok; Common.errorMessage(r); return; } else { //Display successful notification Notification.Show(new NotificationConfig { Title = Resources.Common.Notification, Icon = Icon.Information, Html = Resources.Common.RecordSavingSucc }); this.EditRecordWindow.Close(); Store1.Reload(); } } catch (Exception ex) { //Error exception displaying a messsage box X.MessageBox.ButtonText.Ok = Resources.Common.Ok; X.Msg.Alert(Resources.Common.Error, Resources.Common.ErrorSavingRecord).Show(); } } else { //Update Mode try { //getting the id of the record PostRequest <PayCode> request = new PostRequest <PayCode>(); request.entity = b; PostResponse <PayCode> r = _payrollService.ChildAddOrUpdate <PayCode>(request); //Step 1 Selecting the object or building up the object for update purpose //Step 2 : saving to store //Step 3 : Check if request fails if (!r.Success)//it maybe another check { X.MessageBox.ButtonText.Ok = Resources.Common.Ok; Common.errorMessage(r); return; } else { Store1.Reload(); Notification.Show(new NotificationConfig { Title = Resources.Common.Notification, Icon = Icon.Information, Html = Resources.Common.RecordUpdatedSucc }); this.EditRecordWindow.Close(); } } catch (Exception ex) { X.MessageBox.ButtonText.Ok = Resources.Common.Ok; X.Msg.Alert(Resources.Common.Error, Resources.Common.ErrorUpdatingRecord).Show(); } } }