private void addRestriction() { try { validationTable valid = new validationTable(); DateTime endTime = endDateTimePickerX1.SelectedDateInDateTime; StartEndMonthClass date = new StartEndMonthClass(); date.endDate = Convert.ToInt64(endTime.ToFa("yyyyMMdd")); valid.startDate = startendDate.min; valid.enDate = date.endDate; valid.City = Convert.ToInt64(validCityComboBox.SelectedValue); SqlManipulator sql = new SqlManipulator(); //if (this.lockAllCitiesCheckBox.Checked == true) //{ // var cities = sql.getDataCity(); // foreach(var city in cities) // { // } //} var cityName = sql.getCityName(valid.City); FarsiDateUtil startDate = new FarsiDateUtil(startendDate.min.ToString()); FarsiDateUtil endDate = new FarsiDateUtil(date.endDate.ToString()); valid.description = "قفل" + " " + cityName + " " + endDate.MonthName + endDate.Year; Reporter rpt = new Reporter(sql.addValidation(valid), (int)errorImages.info); rpt.Show(); makeValidationTable(sql.getValidationData()); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }