コード例 #1
0
ファイル: Positions.aspx.cs プロジェクト: EliasTous/ERP
        public void DeleteRecord(string index)
        {
            try
            {
                //Step 1 Code to delete the object from the database
                PostRequest <Model.Company.Structure.Position> req = new PostRequest <Model.Company.Structure.Position>();
                Model.Company.Structure.Position p = new Model.Company.Structure.Position();
                p.recordId = index;
                req.entity = p;
                PostResponse <Model.Company.Structure.Position> resp = _branchService.ChildDelete <Model.Company.Structure.Position>(req);
                if (!resp.Success)
                {
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    Common.errorMessage(resp);
                    return;
                }
                //Step 2 :  remove the object from the store
                Store1.Remove(index);

                //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();
            }
        }
コード例 #2
0
        public void DoYes()
        {
            try
            {
                RowSelectionModel sm = this.GridPanel1.GetSelectionModel() as RowSelectionModel;

                foreach (SelectedRow row in sm.SelectedRows)
                {
                    //Step 1 :Getting the id of the selected record: it maybe string
                    int id = int.Parse(row.RecordID);


                    //Step 2 : removing the record from the store
                    //To do add code here

                    //Step 3 :  remove the record from the store
                    Store1.Remove(id);
                }
                //Showing successful notification
                Notification.Show(new NotificationConfig
                {
                    Title = Resources.Common.Notification,
                    Icon  = Icon.Information,
                    Html  = Resources.Common.ManyRecordDeletedSucc
                });
            }
            catch (Exception ex)
            {
                //Alert in case of any failure
                X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                X.Msg.Alert(Resources.Common.Error, Resources.Common.ErrorDeletingRecord).Show();
            }
        }
コード例 #3
0
        public void DeleteRecord(string index)
        {
            try
            {
                WorkingCalendar c = new WorkingCalendar();
                c.name     = "";
                c.recordId = index;
                PostRequest <WorkingCalendar> req = new PostRequest <WorkingCalendar>();
                req.entity = c;

                PostResponse <WorkingCalendar> response = _branchService.ChildDelete <WorkingCalendar>(req);
                if (!response.Success)
                {
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    Common.errorMessage(response);
                    return;
                }
                else
                {
                    //Step 1 Code to delete the object from the database
                    if (_systemService.SessionHelper.GetCalendarId().ToString() == index)
                    {
                        List <KeyValuePair <string, string> > submittedValues = new List <KeyValuePair <string, string> >();
                        submittedValues.Add(new KeyValuePair <string, string>("caId", index));
                        KeyValuePair <string, string>[] valArr = submittedValues.ToArray();
                        PostRequest <KeyValuePair <string, string>[]> reqDef = new PostRequest <KeyValuePair <string, string>[]>();
                        reqDef.entity = valArr;
                        PostResponse <KeyValuePair <string, string>[]> resp = _systemService.ChildAddOrUpdate <KeyValuePair <string, string>[]>(reqDef);
                        if (!resp.Success)
                        {
                            X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                            Common.errorMessage(resp);

                            return;
                        }
                    }
                    //Step 2 :  remove the object from the store
                    Store1.Remove(index);

                    //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();
            }
        }
コード例 #4
0
        public void DeleteRecord(string index)
        {
            try
            {
                //Step 1 Code to delete the object from the database
                loanSelfService s = new loanSelfService();
                s.recordId      = index;
                s.employeeId    = "0";
                s.purpose       = "";
                s.date          = DateTime.Now;
                s.effectiveDate = DateTime.Now;
                s.apStatus      = "0";
                s.ltId          = 0;
                s.ltName        = "";
                s.amount        = 0;

                s.currencyId = 0;

                PostRequest <loanSelfService> req = new PostRequest <loanSelfService>();
                req.entity = s;
                PostResponse <loanSelfService> r = _selfServiceService.ChildDelete <loanSelfService>(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.Remove(index);

                    //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();
            }
        }
コード例 #5
0
        public void DeleteRecord(string index)
        {
            try
            {
                //Step 1 Code to delete the object from the database
                CompanyRightToWork s = new CompanyRightToWork();
                s.recordId    = index;
                s.remarks     = "";
                s.documentRef = "";
                s.issueDate   = DateTime.Now;
                s.expiryDate  = DateTime.Now;
                s.dtId        = 0;
                s.dtName      = "";
                s.branchId    = 0;
                s.branchName  = "";



                PostRequest <CompanyRightToWork> req = new PostRequest <CompanyRightToWork>();
                req.entity = s;
                PostResponse <CompanyRightToWork> r = _systemService.ChildDelete <CompanyRightToWork>(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.Remove(index);

                    //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();
            }
        }
コード例 #6
0
ファイル: Departments.aspx.cs プロジェクト: EliasTous/ERP
        public void DeleteRecord(string index)
        {
            try
            {
                //Step 1 Code to delete the object from the database
                Department n = new Department();
                n.recordId      = index;
                n.name          = "";
                n.departmentRef = "";


                PostRequest <Department> req = new PostRequest <Department>();
                req.entity = n;
                PostResponse <Department> res = _branchService.ChildDelete <Department>(req);

                if (!res.Success)
                {
                    //Show an error saving...


                    Common.errorMessage(res);
                    return;
                }
                else
                {
                    //Step 2 :  remove the object from the store
                    Store1.Remove(index);

                    //Step 3 : Showing a notification for the user
                    Notification.Show(new NotificationConfig
                    {
                        Title = Resources.Common.Notification,
                        Icon  = Icon.Information,
                        Html  = Resources.Common.RecordDeletedSucc
                    });
                }
                departmentStore.Reload();
            }

            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();
            }
        }
コード例 #7
0
        public void DeleteRecord(string index)
        {
            try
            {
                //Step 1 Code to delete the object from the database
                LeaveRequest s = new LeaveRequest();
                s.recordId      = index;
                s.destination   = "";
                s.employeeId    = "0";
                s.endDate       = DateTime.Now;
                s.startDate     = DateTime.Now;
                s.apStatus      = 0;
                s.isPaid        = false;
                s.justification = "";
                s.ltId          = 0;

                PostRequest <LeaveRequest> req = new PostRequest <LeaveRequest>();
                req.entity = s;
                PostResponse <LeaveRequest> r = _leaveManagementService.ChildDelete <LeaveRequest>(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.Remove(index);

                    //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();
            }
        }
コード例 #8
0
        public void DeleteRecord(string index)
        {
            try
            {
                //Step 1 Code to delete the object from the database
                MediaItem s = new MediaItem();
                s.recordId       = index;
                s.description    = "";
                s.date           = DateTime.Now;
                s.mcId           = 0;
                s.mcName         = "";
                s.departmentId   = 0;
                s.departmentName = "";
                s.type           = 0;


                PostRequest <MediaItem> req = new PostRequest <MediaItem>();
                req.entity = s;
                PostResponse <MediaItem> r = _mediaGalleryService.ChildDelete <MediaItem>(req);
                if (!r.Success)
                {
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    X.Msg.Alert(Resources.Common.Error, GetGlobalResourceObject("Errors", r.ErrorCode) != null ? GetGlobalResourceObject("Errors", r.ErrorCode).ToString() + "<br>" + GetGlobalResourceObject("Errors", "ErrorLogId") + r.LogId : r.Summary).Show();
                    return;
                }
                else
                {
                    //Step 2 :  remove the object from the store
                    Store1.Remove(index);

                    //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();
            }
        }
コード例 #9
0
        public void DeleteRecord(string index)
        {
            try
            {
                //Step 1 Code to delete the object from the database
                Case s = new Case();
                s.recordId   = index;
                s.employeeId = 0;
                //  s.employeeName = new EmployeeName();
                s.details    = "";
                s.date       = DateTime.Now;
                s.closedDate = DateTime.Now;
                s.status     = 0;


                PostRequest <Case> req = new PostRequest <Case>();
                req.entity = s;
                PostResponse <Case> r = _caseService.Delete <Case>(req);
                if (!r.Success)
                {
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    X.Msg.Alert(Resources.Common.Error, GetGlobalResourceObject("Errors", r.ErrorCode) != null ? GetGlobalResourceObject("Errors", r.ErrorCode).ToString() + "<br>" + GetGlobalResourceObject("Errors", "ErrorLogId") + r.LogId : r.Summary).Show();
                    return;
                }
                else
                {
                    //Step 2 :  remove the object from the store
                    Store1.Remove(index);

                    //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();
            }
        }
コード例 #10
0
ファイル: Geofences.aspx.cs プロジェクト: EliasTous/ERP
        public void DeleteRecord(string index)
        {
            try
            {
                //Step 1 Code to delete the object from the database
                Geofence s = new Geofence();
                s.recordId = index;
                s.branchId = 0;
                s.lat2     = 0;
                s.lat      = s.lon = 0;
                s.lon2     = 0;
                s.radius   = 0;
                s.shape    = 0;
                s.name     = "";
                PostRequest <Geofence> req = new PostRequest <Geofence>();
                req.entity = s;
                PostResponse <Geofence> r = _timeAttendanceService.ChildDelete <Geofence>(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.Remove(index);

                    //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();
            }
        }
コード例 #11
0
        public void DeleteRecord(string index)
        {
            try
            {
                //Step 1 Code to delete the object from the database
                Sponsor s = new Sponsor();
                s.address  = "";
                s.city     = "";
                s.email    = "";
                s.fax      = "";
                s.mobile   = "";
                s.name     = "";
                s.phone    = "";
                s.recordId = index;
                PostRequest <Sponsor> req = new PostRequest <Sponsor>();
                req.entity = s;
                PostResponse <Sponsor> r = _employeeService.ChildDelete <Sponsor>(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.Remove(index);

                    //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();
            }
        }
コード例 #12
0
ファイル: Users.aspx.cs プロジェクト: eliea85/AionHR
        public void DeleteRecord(string index)
        {
            try
            {
                //Step 1 Code to delete the object from the database
                UserInfo s = new UserInfo();
                s.recordId    = index;
                s.accountId   = "";
                s.companyName = "";
                s.email       = "";
                s.fullName    = "";
                s.languageId  = 0;

                PostRequest <UserInfo> req = new PostRequest <UserInfo>();
                req.entity = s;
                PostResponse <UserInfo> r = _systemService.ChildDelete <UserInfo>(req);
                if (!r.Success)
                {
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    X.Msg.Alert(Resources.Common.Error, r.Summary).Show();
                    return;
                }
                else
                {
                    //Step 2 :  remove the object from the store
                    Store1.Remove(index);

                    //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();
            }
        }
コード例 #13
0
        public void DeleteAttachment(string index, string path)
        {
            try
            {
                //Step 1 Code to delete the object from the database
                Attachement n = new Attachement();
                n.classId  = ClassId.DMDO;
                n.recordId = 0;
                n.seqNo    = Convert.ToInt16(index);
                n.fileName = path;

                PostRequest <Attachement> req = new PostRequest <Attachement>();
                req.entity = n;
                PostResponse <Attachement> res = _systemService.ChildDelete <Attachement>(req);
                if (!res.Success)
                {
                    //Show an error saving...
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    X.Msg.Alert(Resources.Common.Error, res.Summary).Show();
                    return;
                }
                else
                {
                    //Step 2 :  remove the object from the store
                    Store1.Remove(index);

                    //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();
            }
        }
コード例 #14
0
        public void DeleteRecord(string index)
        {
            try
            {
                //Step 1 Code to delete the object from the database
                BiometricDevice n = new BiometricDevice();
                n.recordId   = index;
                n.name       = "";
                n.reference  = "";
                n.divisionId = "0";

                PostRequest <BiometricDevice> req = new PostRequest <BiometricDevice>();
                req.entity = n;
                PostResponse <BiometricDevice> res = _timeAttendanceService.ChildDelete <BiometricDevice>(req);
                if (!res.Success)
                {
                    //Show an error saving...
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    Common.errorMessage(res);
                    return;
                }
                else
                {
                    //Step 2 :  remove the object from the store
                    Store1.Remove(index);

                    //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();
            }
        }
コード例 #15
0
        public void DeleteRecord(string index)
        {
            try
            {
                //Step 1 Code to delete the object from the database
                SocialSecuritySchedule s = new SocialSecuritySchedule();
                s.recordId = index;

                //s.intName = "";

                PostRequest <SocialSecuritySchedule> req = new PostRequest <SocialSecuritySchedule>();
                req.entity = s;
                PostResponse <SocialSecuritySchedule> r = _PayrollService.ChildDelete <SocialSecuritySchedule>(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.Remove(index);

                    //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();
            }
        }
コード例 #16
0
ファイル: AllowanceTypes.aspx.cs プロジェクト: eliea85/AionHR
        public void DeleteRecord(string index)
        {
            try
            {
                //Step 1 Code to delete the object from the database
                AllowanceType s = new AllowanceType();
                s.recordId = index;
                s.isCash   = false;

                s.name = "";
                PostRequest <AllowanceType> req = new PostRequest <AllowanceType>();
                req.entity = s;
                PostResponse <AllowanceType> r = _employeeService.ChildDelete <AllowanceType>(req);
                if (!r.Success)
                {
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    X.Msg.Alert(Resources.Common.Error, r.Summary).Show();
                    return;
                }
                else
                {
                    //Step 2 :  remove the object from the store
                    Store1.Remove(index);

                    //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();
            }
        }
コード例 #17
0
ファイル: ApprovalReasons.aspx.cs プロジェクト: EliasTous/ERP
        public void DeleteRecord(string index)
        {
            try
            {
                //Step 1 Code to delete the object from the database
                ApprovalReason s = new ApprovalReason();
                s.recordId = index;
                //s.reference = "";

                s.name = "";
                PostRequest <ApprovalReason> req = new PostRequest <ApprovalReason>();
                req.entity = s;
                PostResponse <ApprovalReason> r = _companyStructureRepository.ChildDelete <ApprovalReason>(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.Remove(index);

                    //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();
            }
        }
コード例 #18
0
        public void DeleteRecord(string index)
        {
            try
            {
                //Step 1 Code to delete the object from the database
                Router s = new Router();
                s.routerRef  = index;
                s.isInactive = false;
                s.branchId   = 0;
                PostRequest <Router> req = new PostRequest <Router>();
                req.entity = s;
                PostResponse <Router> r = _timeAttendanceService.ChildDelete <Router>(req);
                if (!r.Success)
                {
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    X.Msg.Alert(Resources.Common.Error, r.Summary).Show();
                    return;
                }
                else
                {
                    //Step 2 :  remove the object from the store
                    Store1.Remove(index);

                    //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();
            }
        }
コード例 #19
0
        public void DeleteRecord(string index)
        {
            try
            {
                //Step 1 Code to delete the object from the database
                Letter n = new Letter();
                n.recordId = index;

                PostRequest <Letter> req = new PostRequest <Letter>();
                req.entity = n;
                PostResponse <Letter> res = _systemService.ChildDelete <Letter>(req);
                if (!res.Success)
                {
                    //Show an error saving...
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    X.Msg.Alert(Resources.Common.Error, res.Summary).Show();
                    return;
                }
                else
                {
                    //Step 2 :  remove the object from the store
                    Store1.Remove(index);

                    //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();
            }
        }
コード例 #20
0
        public void DeleteRecord(string index)
        {
            try
            {
                WorkingCalendar c = new WorkingCalendar();
                c.name     = "";
                c.recordId = index;
                PostRequest <WorkingCalendar> req = new PostRequest <WorkingCalendar>();
                req.entity = c;
                PostResponse <WorkingCalendar> response = _branchService.ChildDelete <WorkingCalendar>(req);
                if (!response.Success)
                {
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    X.Msg.Alert(Resources.Common.Error, response.Summary).Show();
                    return;
                }
                else
                {
                    //Step 1 Code to delete the object from the database

                    //Step 2 :  remove the object from the store
                    Store1.Remove(index);

                    //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();
            }
        }
コード例 #21
0
        public void DeleteRecord(string index)
        {
            try
            {
                //Step 1 Code to delete the object from the database

                //Step 2 :  remove the object from the store
                Store1.Remove(index);

                //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();
            }
        }