void FillRegions() { _regions = Soato.GetRegions(); if (Object.Id == 0) { Object.PlaceOfIssue = User.Instance.Department; } //var placeOfBirth = Object.Holder.PlaceOfBirth; //if (!String.IsNullOrEmpty(placeOfBirth)) //{ // var i = placeOfBirth.IndexOf(':'); // if (i != -1) // ktbPlaceOfBirthId.Text = placeOfBirth.Substring(0, i).ToSafeTrimmedString(); //} //var region = Object.Holder.PlaceOfResidence.Region; //if (!String.IsNullOrEmpty(region)) //{ // var i = region.IndexOf(':'); // if (i != -1) // ktbRegionId.Text = region.Substring(0, i).ToSafeTrimmedString(); //} kcbRegionOrg.DisplayMember = "NameUz"; kcbRegionOrg.ValueMember = "FullName"; kcbRegionOrg.DataSource = Soato.GetRegions(); }
void ktbRegionId_TextChanged(object sender, EventArgs e) { var txt = ktbRegionId.Text; if (!String.IsNullOrEmpty(txt)) { var id = int.Parse(txt); kcbRegion.SelectedValue = id; Object.Holder.PlaceOfResidence.Region = Soato.FindById(id); } }
void FillRegions() { if (Object.Id == 0) { Object.PlaceOfIssue = User.Instance.Department; Object.PlaceOfIssueId = User.Instance.DepartmentId; } else { Object.PlaceOfIssue = Soato.FindById(Object.PlaceOfIssueId); Object.Holder.PlaceOfResidence.District = Soato.FindById(Object.Holder.PlaceOfResidence.DistrictId); } kcbRegion.DisplayMember = "NameUz"; kcbRegion.ValueMember = "Id"; kcbRegion.DataSource = Soato.GetRegions(); }
ParametersCollection GetParameters() { if (String.IsNullOrEmpty(Holder.PlaceOfResidence.Region)) { Holder.PlaceOfResidence.Region = Soato.FindById(Holder.PlaceOfResidence.RegionId); } if (String.IsNullOrEmpty(Holder.PlaceOfResidence.District)) { Holder.PlaceOfResidence.District = Soato.FindById(Holder.PlaceOfResidence.DistrictId); } if (String.IsNullOrEmpty(PlaceOfIssue)) { PlaceOfIssue = Soato.FindById(PlaceOfIssueId); } var prm = new ParametersCollection { { "LastName", Holder.LastName, DbType.String }, { "FirstName", Holder.FirstName, DbType.String }, { "MiddleName", Holder.MiddleName, DbType.String }, { "PlaceOfBirth", Holder.PlaceOfBirth, DbType.String }, { "DateOfBirth", Holder.DateOfBirth, DbType.DateTime }, { "PersonalNumber", Holder.PersonalNumber, DbType.String }, { "PlaceOfResidence", Holder.PlaceOfResidence.Address, DbType.String }, { "Region", Holder.PlaceOfResidence.Region, DbType.String }, { "District", Holder.PlaceOfResidence.District, DbType.String }, { "PlaceOfIssue", PlaceOfIssue, DbType.String }, { "CardNumber", CardNumber, DbType.String }, { "Category", Category, DbType.String }, { "DateOfIssue", DateOfIssue, DbType.DateTime }, { "DateOfExpiry", DateOfExpiry, DbType.DateTime }, { "PassportSeries", Holder.Passport.Seria, DbType.String }, { "PassportNumber", Holder.Passport.Number, DbType.Int32 }, { "LicenseId", Id, DbType.Int64 }, { "Status", Status, DbType.String } }; return(prm); }