Ejemplo n.º 1
0
 /// <summary>
 /// Saves INN related info
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnInnSave_Click(object sender, EventArgs e)
 {
     if (txtINN.Text != "")
     {
         INN newInn = new INN();
         if (_innId != 0)
         {
             newInn.LoadByPrimaryKey(_innId);
         }
         else
         {
             newInn.AddNew();
         }
         newInn.IIN = txtINN.Text;
         //newInn.ATC = txtATC.Text;
         newInn.Description = txtIINDescription.Text;
         newInn.TypeID      = ((rdDrug.Checked) ? 1 : 2);
         newInn.Save();
         newInn.LoadAll();
         PopulateINN(newInn);
         ResetInnForm();
     }
     else
     {
         txtINN.BackColor = Color.FromArgb(251, 214, 214);
     }
 }
Ejemplo n.º 2
0
        private void PopulateFields()
        {
            if (_itemId == 0)
            {
                return;
            }

            Items itm = new Items();

            itm.LoadByPrimaryKey(_itemId);
            cboIIN.EditValue = itm.IINID;
            INN nInn = new INN();

            nInn.LoadByPrimaryKey(itm.IINID);
            txtStrength.Text        = itm.Strength;
            cboDosageForm.EditValue = itm.DosageFormID;
            cboUnit.EditValue       = itm.UnitID;
            string code = itm.StockCode;

            txtStockCode.Text = code;
            ckNeedExp.Checked = itm.NeedExpiryBatch;

            if (itm.HasTransactions(_itemId))
            {
                ckNeedExp.Enabled = false;
            }
        }
Ejemplo n.º 3
0
 private void cboIIN_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cboIIN.SelectedValue != null)
     {
         INN getinn = new INN();
         getinn.LoadByPrimaryKey(Convert.ToInt32(cboIIN.SelectedValue));
         // txtATC.Text = getinn.ATC;
     }
 }
Ejemplo n.º 4
0
        public string[] ToRow()
        {
            string[] rez = new string[4];

            rez[0] = INN.ToString();
            rez[1] = Name;
            rez[2] = Adress;
            rez[3] = FIO;

            return(rez);
        }
Ejemplo n.º 5
0
        private void ButtonAddAgent(object sender, RoutedEventArgs e)
        {
            if (FIOagent.Text.Length == 0 || PassportSeriesNumber.Text.Length == 0 || PassportIssuedBy.Text.Length == 0 || Address.Text.Length == 0 || Phone.Text.Length == 0 || INN.Text.Length == 0)
            {
                CallPopup("Не заполнены все поля");
                return;
            }

            if (PassportSeriesNumber.Text.Length != 10)
            {
                CallPopup("Некорректные серия и номер");
                return;
            }

            string patternPhone = @"^[8][9]\d{9}$";
            Regex  regexPh      = new Regex(patternPhone);

            if (regexPh.IsMatch(Phone.Text) == false)
            {
                CallPopup("Некорректный телефон");
                return;
            }

            if (INN.Text.Length != 10)
            {
                CallPopup("Некорректный ИНН");
                return;
            }

            newAgent = new Agent();

            newAgent.full_name = FIOagent.Text;
            newAgent.birthday  = (DateTime)BirthDate.SelectedDate;
            newAgent.passport_series_number = PassportSeriesNumber.Text;
            newAgent.passport_issued_by     = PassportIssuedBy.Text;
            newAgent.passport_date          = (DateTime)PassportDate.SelectedDate;
            newAgent.address      = Address.Text;
            newAgent.phone_number = Phone.Text;
            newAgent.INN          = INN.Text;

            db.Agents.Add(newAgent);
            db.SaveChanges();

            FIOagent.Clear();
            BirthDate.SelectedDate = DateTime.Now;
            PassportSeriesNumber.Clear();
            PassportIssuedBy.Clear();
            PassportDate.SelectedDate = DateTime.Now;
            Address.Clear();
            Phone.Clear();
            INN.Clear();
            this.Close();
        }
Ejemplo n.º 6
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Name != null ? Name.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (INN != null ? INN.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (KPP != null ? KPP.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ PositionsCount.GetHashCode();
         hashCode = (hashCode * 397) ^ Sum.GetHashCode();
         return(hashCode);
     }
 }
Ejemplo n.º 7
0
 private void FindINN_Click(object sender, EventArgs e)
 {
     if (INN == null)
     {
         ResultTexBox.Text = "Введите ИНН!";
     }
     else
     {
         clientsBindingSource.Filter = "SocialNumber = \'" + INN.Text + "\'";
         ResultTexBox.Text           = "ИНН найден";
     }
     INN.Clear();
 }
Ejemplo n.º 8
0
        /// <summary>
        /// Handles when the focused row gets changed
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void gridProductView_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            DataRow dr        = gridProductView.GetFocusedDataRow();
            int     selection = Convert.ToInt32(dr["ID"]);

            INN nInn = new INN();

            nInn.LoadByPrimaryKey(selection);
            //txtATC.Text = nInn.ATC;
            txtINN.Text            = nInn.IIN;
            txtIINDescription.Text = nInn.Description;
            rdDrug.Checked         = ((nInn.TypeID == 1) ? true : false);
            rdSupply.Checked       = ((nInn.TypeID == 2) ? true : false);
            _innId          = nInn.ID;
            btnInnSave.Text = "Update";
        }
Ejemplo n.º 9
0
        public string this[string columnName]
        {
            get
            {
                string error = String.Empty;
                switch (columnName)
                {
                case "Name":
                    if (Regex.Match(Name, @"[^A-Za-zА-яа-я]").Success || Name == "")
                    {
                        return("Имя не может содержать цифры или спецсимволы");
                    }
                    break;

                case "Surname":
                    if (Regex.Match(Surname, @"[^A-Za-zА-яа-я]").Success || Surname == "")
                    {
                        return("Фамилия не может содержать цифры или спецсимволы");
                    }
                    break;

                case "Patronymic":
                    if (Patronymic != null && Regex.Match(Patronymic, @"[^A-Za-zА-яа-я]").Success || Patronymic == "")
                    {
                        return("Отчество не может содержать цифры или спецсимволы");
                    }
                    break;

                case "INN":
                    if (Regex.Match(INN.ToString(), @"[^0-9]").Success || INN == "")
                    {
                        return("ИНН должен быть числом");
                    }
                    break;

                case "Salary":
                    if (Regex.Match(Salary.Pay.ToString(), @"[^0-9]").Success || Salary.Pay.ToString() == "")
                    {
                        return("Зарплата должна быть числом");
                    }
                    break;
                }
                return(error);
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Метод конвертации в xml файл по схеме SnuOneForm.xsd
        /// <![CDATA[
        /// <?xml version="1.0"?>
        ///<SnuOneForm xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        ///    <INN INN ="504602844980" />
        ///    <INN INN="772576444844" />
        /// </SnuOneForm> ]]>
        /// </summary>
        /// <param name="masivInnStrings">Параметр список</param>
        /// <param name="path">Параметр пути сохранения</param>
        public void SerializSnuOneForm(List <string> masivInnStrings, string path)
        {
            int        i   = 0;
            SnuOneForm snu = new SnuOneForm()
            {
                INN = new INN[masivInnStrings.Count]
            };

            foreach (var inn in masivInnStrings)
            {
                INN k = new INN()
                {
                    INN1 = inn
                };
                snu.INN[i] = k;
                i++;
            }
            SerializerClassToXml(path, snu, typeof(SnuOneForm));
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Populates lookups and tables
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SystemSetting_Load(object sender, EventArgs e)
        {
            PopulatePrograms();
            // TAb IIN
            BLL.INN innInfo = new INN();
            innInfo.LoadAll();
            innInfo.Sort = "IIN";
            PopulateINN(innInfo);

            // TAb Category

            BLL.Type type = new BLL.Type();
            type.LoadAll();
            lkCategory.DataSource = type.DefaultView;

            PopulateCategoryTree();
            //unit section
            BLL.Unit uni = new Unit();
            uni.LoadAll();
            lstUnits.DataSource = uni.DefaultView;

            // dosage form section
            DosageForm doForm = new DosageForm();

            doForm.LoadAll();
            doForm.Sort = "Form";
            PopulateDosageForm(doForm);
            //receiving status section
            // PopulateManufacturer();
            //disposal reasons
            DisposalReasons reason = new DisposalReasons();

            reason.LoadAll();
            reason.Sort = "Reason";
            PopulateDisposalReason(reason);
            //location regions zones and woredas
            PopulateLocationTree();
            PopulateSupplyCatTree();

            PopulateBalance();
        }
Ejemplo n.º 12
0
 private void PopulateINN(INN innInfo)
 {
     gridProducts.DataSource = innInfo.DefaultView;
 }
        /// <summary>
        /// This merges in labels from the auxDocument into the mainDocument when
        /// tokens have one of the labels in auxLabels, and the subsequence
        /// labeled with this auxLabel does not conflict with any non-background
        /// labelling in the mainDocument.
        /// </summary>
        internal static void MergeTwoDocuments <Inn>(IList <INN> mainDocument, IList <INN> auxDocument, ICollection <string> auxLabels, string background)
            where Inn : ICoreMap
        {
            bool              insideAuxTag = false;
            bool              auxTagValid  = true;
            string            prevAnswer   = background;
            ICollection <INN> constituents = new List <INN>();
            IEnumerator <INN> auxIterator  = auxDocument.ListIterator();

            foreach (INN wMain in mainDocument)
            {
                string mainAnswer    = wMain.Get(typeof(CoreAnnotations.AnswerAnnotation));
                INN    wAux          = auxIterator.Current;
                string auxAnswer     = wAux.Get(typeof(CoreAnnotations.AnswerAnnotation));
                bool   insideMainTag = !mainAnswer.Equals(background);

                /* if the auxiliary classifier gave it one of the labels unique to
                 * auxClassifier, we might set the mainLabel to that. */
                if (auxLabels.Contains(auxAnswer))
                {
                    if (!prevAnswer.Equals(auxAnswer) && !prevAnswer.Equals(background))
                    {
                        if (auxTagValid)
                        {
                            foreach (INN wi in constituents)
                            {
                                wi.Set(typeof(CoreAnnotations.AnswerAnnotation), prevAnswer);
                            }
                        }
                        auxTagValid  = true;
                        constituents = new List <INN>();
                    }
                    insideAuxTag = true;
                    if (insideMainTag)
                    {
                        auxTagValid = false;
                    }
                    prevAnswer = auxAnswer;
                    constituents.Add(wMain);
                }
                else
                {
                    if (insideAuxTag)
                    {
                        if (auxTagValid)
                        {
                            foreach (INN wi in constituents)
                            {
                                wi.Set(typeof(CoreAnnotations.AnswerAnnotation), prevAnswer);
                            }
                        }
                        constituents = new List <INN>();
                    }
                    insideAuxTag = false;
                    auxTagValid  = true;
                    prevAnswer   = background;
                }
            }
            // deal with a sequence final auxLabel
            if (auxTagValid)
            {
                foreach (INN wi in constituents)
                {
                    wi.Set(typeof(CoreAnnotations.AnswerAnnotation), prevAnswer);
                }
            }
        }
Ejemplo n.º 14
0
 public FCTrainer(INN <Array3D, Array3D> network, int epochSize, int batch, IDataProvider <Array3D, Array3D> dataProvider)
     : base(epochSize, batch, dataProvider)
 {
     _network = network;
 }
Ejemplo n.º 15
0
 private void FindAll_Click(object sender, EventArgs e)
 {
     clientsBindingSource.Filter = null;
     ResultTexBox.Clear();
     INN.Clear();
 }
Ejemplo n.º 16
0
 public override string ToString()
 {
     return(INN.ToString().PadRight(5) + " " + Sername + " " + Name + " " + MiddleName);
 }