Esempio n. 1
0
        // Kontragent məlumatlarının yenilənməsi:
        private void BtnUpdate_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(TxtCounterpartyName.Text))
            {
                TxtCounterpartyName.BorderBrush     = Brushes.Red;
                TxtCounterpartyName.BorderThickness = new Thickness(2);
            }
            if (string.IsNullOrWhiteSpace(TxtResponsiblePerson.Text))
            {
                TxtResponsiblePerson.BorderBrush     = Brushes.Red;
                TxtResponsiblePerson.BorderThickness = new Thickness(2);
            }
            if (string.IsNullOrWhiteSpace(TxtPhone.Text))
            {
                TxtPhone.BorderBrush     = Brushes.Red;
                TxtPhone.BorderThickness = new Thickness(2);
            }
            if (string.IsNullOrWhiteSpace(TxtAddress.Text))
            {
                TxtAddress.BorderBrush     = Brushes.Red;
                TxtAddress.BorderThickness = new Thickness(2);
            }
            if (string.IsNullOrWhiteSpace(TxtCounterpartyName.Text) ||
                string.IsNullOrWhiteSpace(TxtResponsiblePerson.Text) ||
                string.IsNullOrWhiteSpace(TxtPhone.Text) ||
                string.IsNullOrWhiteSpace(TxtAddress.Text))
            {
                TxtBlcAttention.Text = "Qırmızı sahələr doldurulmalıdır";
                return;
            }
            if (CmbPosition.SelectedItem == null)
            {
                MessageBox.Show("Vəzifə seçin");
                return;
            }
            TxtBlcAttention.Text = "";
            if (db.Counterparties.Count(c => c.Phone == TxtPhone.Text) > 0 && TxtPhone.Text != selectedCounterparty.Phone)
            {
                TxtBlcAttention.Text = "Bu telefon nömrəsi artıq qeyd olunub";
                TxtPhone.Focus();
                return;
            }
            if (db.Counterparties.Count(c => c.Mobile == TxtMobile.Text) > 0 && TxtMobile.Text != selectedCounterparty.Mobile)
            {
                TxtBlcAttention.Text = "Bu telefon nömrəsi artıq qeyd olunub";
                TxtMobile.Focus();
                return;
            }
            Counterparty counterparty = db.Counterparties.Find(selectedCounterparty.Id);

            counterparty.Name = TxtCounterpartyName.Text;
            counterparty.ResponsiblePerson = TxtResponsiblePerson.Text;
            counterparty.PositionID        = db.Positions.First(p => p.Name == CmbPosition.SelectedValue.ToString()).Id;
            counterparty.Phone             = TxtPhone.Text;
            counterparty.Mobile            = TxtMobile.Text;
            counterparty.Address           = TxtAddress.Text;
            db.SaveChanges();
            TxtBlcAttention.Text = "Kontragent yeniləndi";
            crmWindow.Refresh();
        }
Esempio n. 2
0
 private void TxtSuppName_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         TxtPhone.Focus();
     }
 }
 private void TxtItemCompany_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         TxtPhone.Focus();
     }
 }
        // Yeni kontragentin yaddaşda saxlanılması:
        private void Save_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(TxtCounterpartyName.Text))
            {
                TxtCounterpartyName.BorderBrush     = Brushes.Red;
                TxtCounterpartyName.BorderThickness = new Thickness(2);
            }
            if (string.IsNullOrWhiteSpace(TxtResponsiblePerson.Text))
            {
                TxtResponsiblePerson.BorderBrush     = Brushes.Red;
                TxtResponsiblePerson.BorderThickness = new Thickness(2);
            }
            if (string.IsNullOrWhiteSpace(TxtPhone.Text))
            {
                TxtPhone.BorderBrush     = Brushes.Red;
                TxtPhone.BorderThickness = new Thickness(2);
            }
            if (string.IsNullOrWhiteSpace(TxtAddress.Text))
            {
                TxtAddress.BorderBrush     = Brushes.Red;
                TxtAddress.BorderThickness = new Thickness(2);
            }
            if (string.IsNullOrWhiteSpace(TxtCounterpartyName.Text) ||
                string.IsNullOrWhiteSpace(TxtResponsiblePerson.Text) ||
                string.IsNullOrWhiteSpace(TxtPhone.Text) ||
                string.IsNullOrWhiteSpace(TxtAddress.Text))
            {
                TxtBlcAttention.Text = "Qırmızı sahələr doldurulmalıdır";
                return;
            }
            if (CmbPosition.SelectedItem == null)
            {
                MessageBox.Show("Vəzifə seçin");
                return;
            }
            TxtBlcAttention.Text = "";
            if (db.Counterparties.Count(c => c.Phone == TxtPhone.Text) > 0)
            {
                TxtBlcAttention.Text = "Bu telefon nömrəsi artıq qeyd olunub";
                TxtPhone.Focus();
                return;
            }
            Counterparty counterparty = new Counterparty
            {
                Name = TxtCounterpartyName.Text,
                ResponsiblePerson = TxtResponsiblePerson.Text,
                PositionID        = db.Positions.First(p => p.Name == CmbPosition.SelectedValue.ToString()).Id,
                Phone             = TxtPhone.Text,
                Mobile            = TxtMobile.Text,
                Address           = TxtAddress.Text
            };

            db.Counterparties.Add(counterparty);
            db.SaveChanges();
            TxtBlcAttention.Text = "Yeni kontragent yaddaşa yazıldı";
        }
Esempio n. 5
0
 protected void Btnotp_Click(object sender, EventArgs e)
 {
     if (TxtPhone.Text == "")
     {
         TxtPhone.Focus();
         TxtPhone.BorderColor = System.Drawing.Color.Red;
     }
     else
     {
         checkmobile();
     }
 }
Esempio n. 6
0
        // Kontragent məlumatlarının yenilənməsi:
        private void BtnSave_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(TxtEmployeeName.Text))
            {
                TxtEmployeeName.BorderBrush     = Brushes.Red;
                TxtEmployeeName.BorderThickness = new Thickness(2);
            }
            if (string.IsNullOrWhiteSpace(TxtEmployeeSurname.Text))
            {
                TxtEmployeeSurname.BorderBrush     = Brushes.Red;
                TxtEmployeeSurname.BorderThickness = new Thickness(2);
            }
            if (string.IsNullOrWhiteSpace(TxtPhone.Text))
            {
                TxtPhone.BorderBrush     = Brushes.Red;
                TxtPhone.BorderThickness = new Thickness(2);
            }
            if (string.IsNullOrWhiteSpace(TxtEmployeeName.Text) ||
                string.IsNullOrWhiteSpace(TxtEmployeeSurname.Text) ||
                string.IsNullOrWhiteSpace(TxtPhone.Text))
            {
                TxtBlcAttention.Text = "Qırmızı sahələr doldurulmalıdır";
                return;
            }
            if (CmbPosition.SelectedItem == null)
            {
                MessageBox.Show("Vəzifə seçin");
                return;
            }
            TxtBlcAttention.Text = "";
            if (db.Employees.Count(c => c.Phone == TxtPhone.Text) > 0)
            {
                TxtBlcAttention.Text = "Bu telefon nömrəsi artıq qeyd olunub";
                TxtPhone.Focus();
                return;
            }

            Employee employee = new Employee
            {
                Name            = TxtEmployeeName.Text,
                Surname         = TxtEmployeeSurname.Text,
                Phone           = TxtPhone.Text,
                PositionID      = db.Positions.First(p => p.Name == CmbPosition.SelectedValue.ToString()).Id,
                RecruitmentDate = DpRecruitmentDate.SelectedDate.Value.Date,
            };

            db.Employees.Add(employee);
            db.SaveChanges();
            TxtBlcAttention.Text = "Yeni işçi əlavə olundu.";
            crmWindow.Refresh();
        }
Esempio n. 7
0
    protected void Btnotp_Click(object sender, EventArgs e)
    {
        if (TxtPhone.Text == "")
        {
            TxtPhone.Focus();
            TxtPhone.BorderColor = System.Drawing.Color.Red;
        }
        else
        {
            checkmobile();
        }

        //Btnotp.Enabled = false;
        //Btnverify.Visible = true;
    }
Esempio n. 8
0
        private void checkValues()
        {
            bool emailCheck = checkValiditEmail(TxtEmail.Text);

            if (emailCheck == false)
            {
                TxtEmail.Focus();
                showErrorMwssage(3010);
                return;
            }
            if (TxtPhone.Text.Length < 9 || TxtPhone.Text.Length > 11)
            {
                TxtPhone.Focus();
                showErrorMwssage(3011);
                return;
            }
            string m_PERID = TxtId.Text;

            char[] digits   = m_PERID.PadLeft(9, '0').ToCharArray();
            int[]  oneTwo   = { 1, 2, 1, 2, 1, 2, 1, 2, 1 };
            int[]  multiply = new int[9];
            int[]  oneDigit = new int[9];
            for (int i = 0; i < 9; i++)
            {
                multiply[i] = Convert.ToInt32(digits[i].ToString()) * oneTwo[i];
            }
            for (int i = 0; i < 9; i++)
            {
                oneDigit[i] = (int)(multiply[i] / 10) + multiply[i] % 10;
            }
            int sum = 0;

            for (int i = 0; i < 9; i++)
            {
                sum += oneDigit[i];
            }
            if (sum % 10 != 0)
            {
                showErrorMwssage(3012);
                TxtId.Focus();
                return;
            }
        }
Esempio n. 9
0
 protected void BtnReg_Click(object sender, EventArgs e)
 {
     if (TxtCity.SelectedValue == "-1")
     {
         TxtCity.Focus();
         showErrorMwssage(4);
     }
     else if (DdlLicensCode.SelectedValue == "-1")
     {
         DdlLicensCode.Focus();
         showErrorMwssage(5);
     }
     else
     {
         if (GlobFuncs.IsExist(TxtEmail.Text.ToString()) == true)
         {
             TxtEmail.Focus();
             showErrorMwssage(6);
         }
         else if (checkbox1.Checked != true)
         {
             showErrorMwssage(7);
         }
         else if (TxtName.Text.Length == 0)
         {
             TxtName.Focus();
             showErrorMwssage(8);
         }
         else if (TxtAddress.Text.Length == 0)
         {
             TxtAddress.Focus();
             showErrorMwssage(9);
         }
         else if (TxtId.Text.Length == 0)
         {
             TxtId.Focus();
             showErrorMwssage(10);
         }
         else if (TxtDateOfBirth.Text.Length == 0)
         {
             TxtDateOfBirth.Focus();
             showErrorMwssage(11);
         }
         else if (TxtLicenseNumber.Text.Length == 0)
         {
             TxtLicenseNumber.Focus();
             showErrorMwssage(12);
         }
         else if (TxtDateOfIssuanceLicense.Text.Length == 0)
         {
             TxtDateOfIssuanceLicense.Focus();
             showErrorMwssage(13);
         }
         else if (TxtEmail.Text.Length == 0)
         {
             TxtEmail.Focus();
             showErrorMwssage(14);
         }
         else if (TxtPass.Text.Length == 0)
         {
             TxtPass.Focus();
             showErrorMwssage(15);
         }
         else if (TxtPhone.Text.Length == 0)
         {
             TxtPhone.Focus();
             showErrorMwssage(16);
         }
         else
         {
             string pass = GlobFuncs.Hash(TxtPass.Text.ToString());
             Users  Us   = new Users(-1, TxtName.Text.ToString(), TxtAddress.Text.ToString(), int.Parse(TxtCity.Text.ToString()), TxtId.Text.ToString(), DateTime.Parse(TxtDateOfBirth.Text), TxtLicenseNumber.Text.ToString(), int.Parse(DdlLicensCode.Text.ToString()), DateTime.Parse(TxtDateOfIssuanceLicense.Text), TxtEmail.Text.ToString(), pass, TxtPhone.Text.ToString());
             person per  = new person();
             per = Us.RegUser();
             sendRegMessage(per.CustomId, 0.ToString(), per.FullName);
             Session["Person"] = per;
             Response.Redirect("PrivateArea.aspx");
         }
     }
 }