Ejemplo n.º 1
0
        private void EditBtn_Click_1(object sender, RoutedEventArgs e)
        {
            if (currentEval.PermanentRecord == true && UserData.CurrentAccessRight.SysAdmin == false)
            {
                ErrorHandler.NotifyUser("این سند قبلا ثبت نهایی شده است");
                return;
            }
            if (MinTxt.Text == "")
            {
                ErrorHandler.NotifyUser("حداقل امتیاز وارد نشده است");
                return;
            }

            if (CheckScoresValidity())
            {
                DataManagement.SubmitEvaluationScoreWeight(standardList, currentEval.EvaluationId, contractorId);
                UpdateContractorTotalScore();
                DataManagement.EditEvaluationForm(currentEval.EvaluationId, RecordDescriptionTxt.Text);
                ErrorHandler.NotifyUser("ویرایش با موفقیت انجام شد");
            }
            else
            {
                ErrorHandler.ShowErrorMessage("امتیازها(یا) وزن های وارد شده صحیح نیستند");
            }
        }
Ejemplo n.º 2
0
        private void EditBtn_Click(object sender, RoutedEventArgs e)
        {
            if (currentEval.PermanentRecord == true && UserData.CurrentAccessRight.SysAdmin == false)
            {
                ErrorHandler.NotifyUser("اين سند قبلا به تأييد نهايي رسيده است.");
                return;
            }
            if (TitleTxt.Text == "")
            {
                l1.Foreground = new SolidColorBrush(Colors.Red);
            }
            else
            {
                l1.Foreground = new SolidColorBrush(Colors.Black);
            }
            if (MinTxt.Text == "")
            {
                l22.Foreground = new SolidColorBrush(Colors.Red);
            }
            else
            {
                l22.Foreground = new SolidColorBrush(Colors.Black);
            }
            if (Grid2.Items.Count == 0)
            {
                l4.Foreground = new SolidColorBrush(Colors.Red);
            }
            else
            {
                l4.Foreground = new SolidColorBrush(Colors.Black);
            }
            if (Grid4.Items.Count == 0)
            {
                l5.Foreground = new SolidColorBrush(Colors.Red);
            }
            else
            {
                l5.Foreground = new SolidColorBrush(Colors.Black);
            }
            if (HourTxt.Text == "" || MinuteTxt.Text == "")
            {
                l6.Foreground = new SolidColorBrush(Colors.Red);
            }
            else
            {
                l6.Foreground = new SolidColorBrush(Colors.Black);
            }
            if (HourTxt.Text == "" || MinuteTxt.Text == "" || TitleTxt.Text == "" || MinTxt.Text == "" || Grid2.Items.Count == 0 || Grid4.Items.Count == 0)
            {
                ErrorHandler.NotifyUser("برخی اطلاعات ضروری وارد نشده اند");
                return;
            }
            List <User> l = new List <User>();

            foreach (var item in Grid2.Items)
            {
                l.Add(item as User);
            }
            List <Contractor> l2 = new List <Contractor>();

            foreach (var item in Grid4.Items)
            {
                l2.Add(item as Contractor);
            }
            try
            {
                var      d    = (DateTime)datePicker1.SelectedDate;
                DateTime date = new DateTime(d.Year, d.Month, d.Day, Int32.Parse(HourTxt.Text), Int32.Parse(MinuteTxt.Text), 0);
                DataManagement.EditEvaluationForm(currentEval.EvaluationId, Int32.Parse(MinTxt.Text), date, TitleTxt.Text, null, l, l2, true, false, null, null, false, (bool)currentEval.PermanentRecord);
                ErrorHandler.NotifyUser("ویرایش با موفقیت انجام شد");
            }
            catch (System.Exception ex)
            {
                MessageBox.Show("ویرایش با مشکل مواجه شد");
            }
        }