public bool save(GlobalVariables.Operation pOperation)
        {
            bool _result = false;

            try
            {
                switch (pOperation)
                {
                case GlobalVariables.Operation.Add:
                    HttpClient clientAdd = new HttpClient();
                    clientAdd.BaseAddress = new Uri(GlobalVariables.BaseAddress);
                    HttpResponseMessage responseAdd = clientAdd.PostAsJsonAsync("api/main/insertPOSTransactionDetail/", this).Result;
                    _result = bool.Parse(responseAdd.Content.ReadAsStringAsync().Result);
                    break;

                case GlobalVariables.Operation.Edit:
                    HttpClient clientEdit = new HttpClient();
                    clientEdit.BaseAddress = new Uri(GlobalVariables.BaseAddress);
                    HttpResponseMessage responseEdit = clientEdit.PostAsJsonAsync("api/main/updatePOSTransactionDetail/", this).Result;
                    _result = bool.Parse(responseEdit.Content.ReadAsStringAsync().Result);
                    break;

                default:
                    break;
                }
            }
            catch { }
            return(_result);
        }
 public SalesInchargeDetailUI(string[] pRecords)
 {
     InitializeComponent();
     lOperation     = GlobalVariables.Operation.Edit;
     lSalesIncharge = new SalesIncharge();
     lRecords       = pRecords;
 }
Ejemplo n.º 3
0
 public DesignationDetailUI()
 {
     InitializeComponent();
     lId           = "";
     lOperation    = GlobalVariables.Operation.Add;
     loDesignation = new Designation();
 }
 public EarningTypeDetailUI()
 {
     InitializeComponent();
     lId           = "";
     lOperation    = GlobalVariables.Operation.Add;
     loEarningType = new EarningType();
 }
 public ModeOfPaymentDetailUI()
 {
     InitializeComponent();
     lId             = "";
     lOperation      = GlobalVariables.Operation.Add;
     loModeOfPayment = new ModeOfPayment();
 }
        public bool saveSystemConfiguration(GlobalVariables.Operation pOperation)
        {
            bool _Status = false;

            try
            {
                switch (pOperation)
                {
                case GlobalVariables.Operation.Add:
                    _Status = lSystemConfigurationDAO.insertSystemConfiguration(this);
                    break;

                case GlobalVariables.Operation.Edit:
                    _Status = lSystemConfigurationDAO.updateSystemConfiguration(this);
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBoxUI mb = new MessageBoxUI(ex, GlobalVariables.Icons.Error, GlobalVariables.Buttons.OK);
                mb.ShowDialog();
            }
            return(_Status);
        }
 public ProductDetailUI()
 {
     InitializeComponent();
     lId        = "";
     lOperation = GlobalVariables.Operation.Add;
     loProduct  = new Product();
 }
Ejemplo n.º 8
0
 public LeaveTypeDetailUI()
 {
     InitializeComponent();
     lId         = "";
     lOperation  = GlobalVariables.Operation.Add;
     loLeaveType = new LeaveType();
 }
 public EquipmentDetailUI()
 {
     InitializeComponent();
     lId         = "";
     lOperation  = GlobalVariables.Operation.Add;
     loEquipment = new Equipment();
 }
 public CategoryDetailUI()
 {
     InitializeComponent();
     lOperation       = GlobalVariables.Operation.Add;
     loCategory       = new Category();
     loInventoryGroup = new InventoryGroup();
 }
 public SalesDiscountDetailUI()
 {
     InitializeComponent();
     lId             = "";
     lOperation      = GlobalVariables.Operation.Add;
     loSalesDiscount = new SalesDiscount();
 }
 public UnitDetailUI(string[] pRecords)
 {
     InitializeComponent();
     lOperation = GlobalVariables.Operation.Edit;
     loUnit     = new Unit();
     lRecords   = pRecords;
 }
 public LocationDetailUI(string[] pRecords)
 {
     InitializeComponent();
     lOperation = GlobalVariables.Operation.Edit;
     loLocation = new Location();
     lRecords   = pRecords;
 }
Ejemplo n.º 14
0
 public UserGroupUI()
 {
     InitializeComponent();
     lOperation  = GlobalVariables.Operation.Add;
     loUserGroup = new UserGroup();
     txtId.Text  = "AUTO";
 }
 public SalesPersonDetailUI()
 {
     InitializeComponent();
     lId           = "";
     lOperation    = GlobalVariables.Operation.Add;
     loSalesPerson = new SalesPerson();
 }
Ejemplo n.º 16
0
 public WorkScheduleDetailUI()
 {
     InitializeComponent();
     lId            = "";
     lOperation     = GlobalVariables.Operation.Add;
     loWorkSchedule = new WorkSchedule();
 }
 public ProcurementDiscountDetailUI()
 {
     InitializeComponent();
     lId                   = "";
     lOperation            = GlobalVariables.Operation.Add;
     loProcurementDiscount = new ProcurementDiscount();
 }
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (!GlobalFunctions.checkRights("tsmSystemConfiguration", "Save"))
                {
                    return;
                }

                lOperation = GlobalVariables.Operation.Edit;
                loadDataToHash();
                foreach (DictionaryEntry Hash in lSystemConfigHash)
                {
                    try
                    {
                        loSystemConfiguration.Key   = Hash.Key.ToString();
                        loSystemConfiguration.Value = Hash.Value.ToString();
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                    loSystemConfiguration.saveSystemConfiguration(lOperation);
                }
                writeSystemSettings();
                MessageBoxUI _mb = new MessageBoxUI("System Configuration has been saved successfully!", GlobalVariables.Icons.Save, GlobalVariables.Buttons.OK);
                _mb.ShowDialog();
            }
            catch (Exception ex)
            {
                ErrorMessageUI em = new ErrorMessageUI(ex.Message, this.Name, "btnSave_Click");
                em.ShowDialog();
                return;
            }
        }
 public InventoryTypeDetailUI()
 {
     InitializeComponent();
     lId             = "";
     lOperation      = GlobalVariables.Operation.Add;
     loInventoryType = new InventoryType();
 }
 public UserDetailUI()
 {
     InitializeComponent();
     lOperation  = GlobalVariables.Operation.Add;
     loUser      = new User();
     loUserGroup = new UserGroup();
 }
Ejemplo n.º 21
0
 public DeductionTypeDetailUI()
 {
     InitializeComponent();
     lId             = "";
     lOperation      = GlobalVariables.Operation.Add;
     loDeductionType = new DeductionType();
 }
        public string save(GlobalVariables.Operation pOperation)
        {
            string _Id = "";

            try
            {
                switch (pOperation)
                {
                case GlobalVariables.Operation.Add:
                    HttpClient clientAdd = new HttpClient();
                    clientAdd.BaseAddress = new Uri(GlobalVariables.BaseAddress);
                    HttpResponseMessage responseAdd = clientAdd.PostAsJsonAsync("api/main/insertSalesPerson/", this).Result;
                    _Id = responseAdd.Content.ReadAsStringAsync().Result;
                    break;

                case GlobalVariables.Operation.Edit:
                    HttpClient clientEdit = new HttpClient();
                    clientEdit.BaseAddress = new Uri(GlobalVariables.BaseAddress);
                    HttpResponseMessage responseEdit = clientEdit.PostAsJsonAsync("api/main/updateSalesPerson/", this).Result;
                    _Id = responseEdit.Content.ReadAsStringAsync().Result;
                    break;

                default:
                    break;
                }
            }
            catch { }
            return(_Id.Replace("\"", ""));
        }
 public CustomerDetailUI(string[] pRecords)
 {
     InitializeComponent();
     lOperation = GlobalVariables.Operation.Edit;
     loCustomer = new Customer();
     lRecords   = pRecords;
 }
Ejemplo n.º 24
0
 public HolidayDetailUI()
 {
     InitializeComponent();
     lId        = "";
     lOperation = GlobalVariables.Operation.Add;
     loHoliday  = new Holiday();
 }
 public DepartmentDetailUI()
 {
     InitializeComponent();
     lId          = "";
     lOperation   = GlobalVariables.Operation.Add;
     loDepartment = new Department();
 }
Ejemplo n.º 26
0
        public bool save(GlobalVariables.Operation pOperation, ref MySqlTransaction pTrans)
        {
            bool _Status = false;

            try
            {
                switch (pOperation)
                {
                case GlobalVariables.Operation.Add:
                    _Status = lUserDAO.insertUser(this, ref pTrans);
                    break;

                case GlobalVariables.Operation.Edit:
                    _Status = lUserDAO.updateUser(this, ref pTrans);
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBoxUI mb = new MessageBoxUI(ex, GlobalVariables.Icons.Error, GlobalVariables.Buttons.OK);
                mb.ShowDialog();
            }
            return(_Status);
        }
 public UnitDetailUI()
 {
     InitializeComponent();
     lId        = "";
     lOperation = GlobalVariables.Operation.Add;
     loUnit     = new Unit();
 }
Ejemplo n.º 28
0
        public string save(GlobalVariables.Operation pOperation, ref MySqlTransaction pTrans)
        {
            string _UserGroupId = "";

            try
            {
                switch (pOperation)
                {
                case GlobalVariables.Operation.Add:
                    _UserGroupId = lUserGroupDAO.insertUserGroup(this, ref pTrans);
                    break;

                case GlobalVariables.Operation.Edit:
                    _UserGroupId = lUserGroupDAO.updateUserGroup(this, ref pTrans);
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBoxUI mb = new MessageBoxUI(ex, GlobalVariables.Icons.Error, GlobalVariables.Buttons.OK);
                mb.ShowDialog();
            }
            return(_UserGroupId);
        }
Ejemplo n.º 29
0
 public BuildingDetailUI(string[] pRecords)
 {
     InitializeComponent();
     lId        = "";
     lOperation = GlobalVariables.Operation.Edit;
     loBuilding = new Building();
     lRecords   = pRecords;
 }
Ejemplo n.º 30
0
 public SalesDiscountDetailUI(string[] pRecords)
 {
     InitializeComponent();
     lId             = "";
     lOperation      = GlobalVariables.Operation.Edit;
     loSalesDiscount = new SalesDiscount();
     lRecords        = pRecords;
 }