Ejemplo n.º 1
0
        public void deleteBranchAttendances()
        {
            BranchAttendance BA = new BranchAttendance();


            try
            {
                PostRequest <BranchAttendance> request = new PostRequest <BranchAttendance>();

                request.entity = BA;


                PostResponse <BranchAttendance> r = _helpFunctionService.ChildAddOrUpdate <BranchAttendance>(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
                {
                    //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();
            }
        }
Ejemplo n.º 2
0
        public void deleteBranchAttendances()
        {
            BranchAttendance BA = new BranchAttendance();
            var d = jobInfo1.GetJobInfo();

            if (d.BranchId.HasValue)
            {
                BA.branchId = Convert.ToInt32(d.BranchId.Value.ToString());
            }
            else
            {
                BA.branchId = 0;
            }


            if (startDayId.SelectedDate != DateTime.MinValue)

            {
                BA.fromDayId = startDayId.SelectedDate.ToString("yyyyMMdd");
            }
            else
            {
                BA.fromDayId = "";
            }
            if (endDayId.SelectedDate != DateTime.MinValue)

            {
                BA.toDayId = endDayId.SelectedDate.ToString("yyyyMMdd");
            }
            else
            {
                BA.toDayId = "";
            }

            try
            {
                PostRequest <BranchAttendance> request = new PostRequest <BranchAttendance>();

                request.entity = BA;


                PostResponse <BranchAttendance> r = _helpFunctionService.ChildAddOrUpdate <BranchAttendance>(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
                {
                    //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();
            }
        }