Пример #1
0
 public UserInfo()
 {
     mId          = 0;
     mFirstName   = "";
     mLastName    = "";
     mMotherName  = "";
     mFatherName  = "";
     mB_Date      = DateTime.Now;
     mCity        = "";
     mStreet      = "";
     mBuildingNum = 0;
     mAppNum      = 0;
     mEMail       = "";
     mPhones      = "";
     mSex         = Enums.EnumProvider.Sex.Male;
     mPassedRect  = Enums.EnumProvider.PassedRectification.NotPassed;
     mApplication = "";
     mReachMaster = Enums.EnumProvider.ReachedMaster.No;
 }
Пример #2
0
        public void XmlNode2UserInfo(XmlNode usernode)
        {
            mId = Convert.ToInt16(usernode.Attributes["id"].Value);

            foreach (XmlNode node in usernode.ChildNodes)
            {
                switch (Enums.EnumProvider.Instance.GetInnerXmlDBFieldsEnumFromString(node.Name.ToLower()))
                {
                case Enums.EnumProvider.InnerXmlDBFields.Appartment:
                    mAppNum = Convert.ToDouble(node.InnerText.ToString());
                    break;

                case Enums.EnumProvider.InnerXmlDBFields.Application:
                    mApplication = node.InnerText.ToString();
                    break;

                case Enums.EnumProvider.InnerXmlDBFields.BirthDay:
                    DateTime bd  = DateTime.Now;
                    bool     res = DateTime.TryParse(node.InnerText.ToString(), out bd);
                    mB_Date = bd;
                    break;

                case Enums.EnumProvider.InnerXmlDBFields.Building:
                    mBuildingNum = Convert.ToDouble(node.InnerText.ToString());
                    break;

                case Enums.EnumProvider.InnerXmlDBFields.City:
                    mCity = node.InnerText.ToString();
                    break;

                case Enums.EnumProvider.InnerXmlDBFields.EMail:
                    mEMail = node.InnerText.ToString();
                    break;

                case Enums.EnumProvider.InnerXmlDBFields.FatherName:
                    mFatherName = node.InnerText.ToString();
                    break;

                case Enums.EnumProvider.InnerXmlDBFields.FirstName:
                    mFirstName = node.InnerText.ToString();
                    break;

                case Enums.EnumProvider.InnerXmlDBFields.LastName:
                    mLastName = node.InnerText.ToString();
                    break;

                case Enums.EnumProvider.InnerXmlDBFields.MotherName:
                    mMotherName = node.InnerText.ToString();
                    break;

                case Enums.EnumProvider.InnerXmlDBFields.PassedRect:
                    mPassedRect = Enums.EnumProvider.Instance.GetPassedRectificationEnumFromString(node.InnerText.ToString());
                    break;

                case Enums.EnumProvider.InnerXmlDBFields.Phones:
                    mPhones = node.InnerText.ToString();
                    break;

                case Enums.EnumProvider.InnerXmlDBFields.Sex:
                    mSex = Enums.EnumProvider.Instance.GetSexEnumFromString(node.InnerText.ToString());
                    break;

                case Enums.EnumProvider.InnerXmlDBFields.Street:
                    mStreet = node.InnerText.ToString();
                    break;

                case Enums.EnumProvider.InnerXmlDBFields.ReachedMaster:
                    mReachMaster = Enums.EnumProvider.Instance.GGetIsMasterEnumFromString(node.InnerText.ToString());
                    break;
                }
            }
        }
Пример #3
0
        public bool ProgData2UserInfo(MainForm mainForm)
        {
            bool resFInal = true;

            try
            {
                mFirstName   = mainForm.Controls.Find("txtPrivateName", true)[0].Text;
                mLastName    = mainForm.Controls.Find("txtFamilyName", true)[0].Text;
                mMotherName  = mainForm.Controls.Find("txtMotherName", true)[0].Text;
                mFatherName  = mainForm.Controls.Find("txtFatherName", true)[0].Text;
                mCity        = mainForm.Controls.Find("txtCity", true)[0].Text;
                mStreet      = mainForm.Controls.Find("txtStreet", true)[0].Text;
                mBuildingNum = Convert.ToDouble(mainForm.Controls.Find("txtBiuldingNum", true)[0].Text);
                mAppNum      = Convert.ToDouble(mainForm.Controls.Find("txtAppNum", true)[0].Text);
                mEMail       = mainForm.Controls.Find("txtEMail", true)[0].Text;
                mPhones      = mainForm.Controls.Find("txtPhones", true)[0].Text;
                mApplication = mainForm.Controls.Find("txtApplication", true)[0].Text;

                mB_Date = (mainForm.Controls.Find("DateTimePickerFrom", true)[0] as System.Windows.Forms.DateTimePicker).Value;
                string sSex = (mainForm.Controls.Find("cmbSexSelect", true)[0] as System.Windows.Forms.ComboBox).SelectedItem.ToString();
                switch (BLL.AppSettings.Instance.ProgramLanguage)
                {
                case BLL.AppSettings.Language.Hebrew:
                    mSex = Omega.Enums.EnumProvider.Instance.GetSexEnumFromString(sSex);
                    break;

                case BLL.AppSettings.Language.English:
                    if (sSex.ToLower() == Omega.Enums.EnumProvider.Sex.Female.ToString().ToLower())
                    {
                        mSex = Omega.Enums.EnumProvider.Sex.Female;
                    }
                    if (sSex.ToLower() == Omega.Enums.EnumProvider.Sex.Male.ToString().ToLower())
                    {
                        mSex = Omega.Enums.EnumProvider.Sex.Male;
                    }
                    break;
                }

                bool cbPassedValue = (mainForm.Controls.Find("cbMainCorrectionDone", true)[0] as System.Windows.Forms.CheckBox).Checked;
                if (cbPassedValue == true)
                {
                    mPassedRect = Enums.EnumProvider.PassedRectification.Passed;
                }
                else
                {
                    mPassedRect = Enums.EnumProvider.PassedRectification.NotPassed;
                }

                bool cbMasterValue = (mainForm.Controls.Find("cbPersonMaster", true)[0] as System.Windows.Forms.CheckBox).Checked;
                if (cbMasterValue == true)
                {
                    mReachMaster = Enums.EnumProvider.ReachedMaster.Yes;
                }
                else
                {
                    mReachMaster = Enums.EnumProvider.ReachedMaster.No;
                }
            }
            catch // (Exception exp)
            {
                resFInal = false;
            }

            return(resFInal);
        }