Esempio n. 1
0
        public void CommonFormValUpdtae()
        {
            try
            {
                if (String.IsNullOrEmpty(Convert.ToString(LocCode)))
                {
                    System.Windows.MessageBox.Show("Location Code should be Entered", "Process Designer");
                }
                else if (String.IsNullOrEmpty(LocName))
                {
                    System.Windows.MessageBox.Show("Location Name should be Entered", "Process Designer");
                }
                else
                {
                    bool val = oLocMaster.AddNewLocationMaster(LocCode, LocName, NextAction, ref _errMessage);
                    if (val)
                    {
                        System.Windows.MessageBox.Show(_errMessage, "Process Designer");
                        //MessageBox.Show(_errMessage);
                        ClearOperMaster();
                    }
                    if (val == false)
                    {
                        if ((string)_errMessage != "")
                        {
                            MessageBox.Show(_errMessage, "Process Designer");
                        }
                    }
                }

                DtDataview = oLocMaster.GetLocationMaster();
                //   LoadTableData();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public void CommonFormValUpdtae()
        {
            try
            {
                isActiveSave = (IsActive) ? false : true;
                if (ButtonEnable == Visibility.Visible)
                {
                    NextAction = "EDIT";
                }
                else if (ButtonEnable == Visibility.Collapsed)
                {
                    NextAction = "ADD";
                }

                //    NextAction = "EDIT";

                if (String.IsNullOrEmpty(Convert.ToString(LocCode)) || LocCode.Trim().Length == 0)
                {
                    ShowInformationMessage(PDMsg.NotEmpty("Location Code"));
                    //FocusButton = true;
                    Flag = true;
                    //System.Windows.MessageBox.Show("Location Code should be Entered", "SmartPD", MessageBoxButton.OK, MessageBoxImage.Information);
                }
                else if (String.IsNullOrEmpty(LocName) || LocName.Trim().Length == 0)
                {
                    ShowInformationMessage(PDMsg.NotEmpty("Location Name"));
                    // FocusButton = true;
                    Flag = true;
                    //System.Windows.MessageBox.Show("Location Name should be Entered", "SmartPD", MessageBoxButton.OK, MessageBoxImage.Information);
                }
                else
                {
                    Flag = false;
                    //Progress.ProcessingText = PDMsg.ProgressUpdateText;
                    //Progress.Start();
                    bool val = oLocMaster.AddNewLocationMaster(isActiveSave, LocCode, LocName, NextAction, ref _errMessage);
                    //Progress.End();
                    if (val)
                    {
                        ShowInformationMessage(_errMessage);
                        FocusButton = true;
                        //System.Windows.MessageBox.Show(_errMessage, "SmartPD", MessageBoxButton.OK, MessageBoxImage.Information);
                        //MessageBox.Show(_errMessage);
                        ClearOperMaster();
                    }
                    if (val == false)
                    {
                        if ((string)_errMessage != "")
                        {
                            ShowInformationMessage(_errMessage);
                        }
                        FocusButton = true;
                        //MessageBox.Show(_errMessage, "SmartPD", MessageBoxButton.OK, MessageBoxImage.Information);
                    }
                }

                DtDataview = oLocMaster.GetLocationMaster();
                // FocusButton = true;
                if (Flag == true)
                {
                    if (AddEnable == true)
                    {
                        NextAction = "EDIT";
                        SetUserRights("EDIT");
                        ButtonEnable = Visibility.Visible;
                    }
                    else if (EditEnable == true)
                    {
                        NextAction = "ADD";
                        SetUserRights("ADD");
                        ButtonEnable = Visibility.Collapsed;
                    }
                }
                TxtReadOnly = (NextAction == "EDIT") ? true : false;
                //   LoadTableData();
            }
            catch (Exception ex)
            {
                Progress.End();
                throw ex.LogException();
            }
        }