private void btEnter_Click(object sender, EventArgs e) { string passw=""; string login=""; login=txbLogin.Text; passw=txbPassword.Text; if (login!="" && passw!="") { ClFunctions func = new ClFunctions(); passw = func.GetMD5String(passw); string sql = "SELECT Ag_id,Ag_FIO, Ag_Agency, Ag_isadmin, Ag_mail FROM agents WHERE Ag_login ='******' AND Ag_password='******'"; string message = ""; DataTable dt = func.ReadFromTable(sql, out message); if (message == "" && dt.Rows.Count>0) { Current_admin.id = dt.Rows[0][0].ToString(); Current_admin.FIO = dt.Rows[0][1].ToString(); Current_admin.agency = dt.Rows[0][2].ToString(); if (dt.Rows[0][3].ToString() == "1" || dt.Rows[0][3].ToString().ToLower() == "true")Current_admin.isadmin = true; else Current_admin.isadmin = false; Current_admin.mail = dt.Rows[0][4].ToString(); this.Close(); } else { MessageBox.Show("Неверные входные данные..."); } } }
public AddEditAgencyFr(int oper) { InitializeComponent(); func = new ClFunctions(); operation = oper; Aname = ""; Aphone = ""; Address = ""; Aid = ""; }
public AddEditAgentFr(int oper) { InitializeComponent(); operation = oper; func = new ClFunctions(); Aid=""; Afio=""; Amail=""; Alogin=""; A_agency=""; A_isadmin=false; Aphone = ""; terra_count = 0; realt_count = 0; }
public AddEditAgentFr(int oper) { InitializeComponent(); operation = oper; func = new ClFunctions(); Aid = ""; Afio = ""; Amail = ""; Alogin = ""; A_agency = ""; A_isadmin = false; Aphone = ""; terra_count = 0; realt_count = 0; }
private void simpleButton4_Click(object sender, EventArgs e) { func = new ClFunctions(); for (int i = listView1.CheckedIndices.Count - 1; i >= 0; i--) { //MessageBox.Show(listBox2.Items[listBox2.SelectedIndices[i]] as Img).Name); if ((Program.user.IsAdmin) || (listView1.Items[listView1.CheckedIndices[i]].SubItems[1].Text == Program.user.email)) { dbcomm.DeleteCommentFromDB(listView1.CheckedIndices[i]); dbcomm.CommentsList.RemoveAt(listView1.CheckedIndices[i]); listView1.Items.RemoveAt(listView1.CheckedIndices[i]); } else { MessageBox.Show("Комментарий пользователя " + listView1.Items[listView1.CheckedIndices[i]].SubItems[0].Text + " не может быть удален", "Внимание", MessageBoxButtons.OK); } } }
private void simpleButton6_Click(object sender, EventArgs e) { System.Uri ftpuri; record.Rphoto = ""; if (MessageBox.Show("Сохранить изменения?", "Внимание", MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.OK) { func = new ClFunctions(); for (int i = 0; i < listBox2.Items.Count; i++) { if ((listBox2.Items[i] as Img).IsNew) { //MessageBox.Show(listBox2.Items[listBox2.SelectedIndices[i]] as Img).Name); ftpuri = new Uri("ftp://*****:*****@tamarrra.net:21//www/img1/" + (listBox2.Items[i] as Img).Url); func.UploadFileToServer((listBox2.Items[i] as Img).OriginalPath, ftpuri); (listBox2.Items[i] as Img).IsNew = false; (listBox2.Items[i] as Img).Url = "http://tamarrra.net/img1/" + (listBox2.Items[i] as Img).Url; } record.Rphoto = String.Concat(record.Rphoto, (listBox2.Items[i] as Img).Url, ";"); } record.Rphoto = record.Rphoto.Substring(0, record.Rphoto.Length - 1); if (listBox2.Items.Count != 0) { listBox2.SelectedIndex = 0; } } //if (CheckEstateDataConsistensy()) { SaveFormMoodToTheObject(); if (Program.objectedit.newrecord) { dbw.InsertNewEstate(record); Form1. } else { dbw.UpdateEstate(record); } this.Close(); } Program.objectedit.Close(); }
private void simpleButton7_Click(object sender, EventArgs e) { System.Uri ftpuri; if (MessageBox.Show("Подтвердите удаление", "Операция", MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.OK) { func = new ClFunctions(); for (int i = listBox2.SelectedIndices.Count - 1; i >= 0; i--) { //MessageBox.Show(listBox2.Items[listBox2.SelectedIndices[i]] as Img).Name); ftpuri = new Uri("ftp://*****:*****@tamarrra.net:21//www/img1/" + (listBox2.Items[listBox2.SelectedIndices[i]] as Img).Name); func.DeleteFileFromServer("", ftpuri); dbvals.photolist.RemoveAt(listBox2.SelectedIndices[i]); listBox2.Items.RemoveAt(listBox2.SelectedIndices[i]); } if (listBox2.Items.Count != 0) { listBox2.SelectedIndex = 0; } } }
private void btEnter_Click(object sender, EventArgs e) { string passw = ""; string login = ""; login = txbLogin.Text; passw = txbPassword.Text; if (login != "" && passw != "") { ClFunctions func = new ClFunctions(); passw = func.GetMD5String(passw); string sql = "SELECT Ag_id,Ag_FIO, Ag_Agency, Ag_isadmin, Ag_mail FROM agents WHERE Ag_login ='******' AND Ag_password='******'"; string message = ""; DataTable dt = func.ReadFromTable(sql, out message); if (message == "" && dt.Rows.Count > 0) { Current_admin.id = dt.Rows[0][0].ToString(); Current_admin.FIO = dt.Rows[0][1].ToString(); Current_admin.agency = dt.Rows[0][2].ToString(); if (dt.Rows[0][3].ToString() == "1" || dt.Rows[0][3].ToString().ToLower() == "true") { Current_admin.isadmin = true; } else { Current_admin.isadmin = false; } Current_admin.mail = dt.Rows[0][4].ToString(); this.Close(); } else { MessageBox.Show("Неверные входные данные..."); } } }
public AgentsForm() { InitializeComponent(); func = new ClFunctions(); }
private void LoadXML_Load(object sender, EventArgs e) { openFileDialog1.Filter = "Zip files (*.zip)|*.zip|XML files (*.xml)|*.xml"; openFileDialog1.FileName = ""; openFileDialog1.InitialDirectory = Application.StartupPath; btLaunch.Enabled = false; func = new ClFunctions(); Images = new List<ImageStruct>(); unzipDir = Application.StartupPath + "\\tempFolder"; this.FormBorderStyle = FormBorderStyle.FixedSingle; }
public Form1() { InitializeComponent(); func = new ClFunctions(); allFields = new ChListStruct[18]; //allFields[0].FieldName = "Rcity"; //allFields[0].caption = "Населенный пункт"; //allFields[1].FieldName = "Rstreet"; //allFields[1].caption = "Улица"; allFields[0].FieldName = "Rtotal_floor_space"; allFields[0].caption = "Площадь (кв.м)"; allFields[1].FieldName = "Rroom_quantity"; allFields[1].caption = "Кол-во комнат"; allFields[2].FieldName = "Rprice"; allFields[2].caption = "Стоимость (руб)"; allFields[3].FieldName = "Rfloor"; allFields[3].caption = "Этаж"; allFields[4].FieldName = "Rnumber_of_storeys"; allFields[4].caption = "Этажность"; allFields[5].FieldName = "Restate_type"; allFields[5].caption = "Тип недвидимости"; allFields[6].FieldName = "Rwalling_type"; allFields[6].caption = "Материал стен"; allFields[7].FieldName = "Rroom_layout"; allFields[7].caption = "Планировка комнат"; allFields[8].FieldName = "Rhouse_type"; allFields[8].caption = "Тип дома"; allFields[9].FieldName = "Rcondition2"; allFields[9].caption = "Состояние"; allFields[10].FieldName = "Rdate_add"; allFields[10].caption = "Дата добавления"; allFields[11].FieldName = "Rdate_change"; allFields[11].caption = "Дата последнего изменения"; allFields[12].FieldName = "Rdistrict_region"; allFields[12].caption = "Район"; allFields[13].FieldName = "Rtrade_price"; allFields[13].caption = "Стоимость сделки"; allFields[14].FieldName = "Rtrade_date"; allFields[14].caption = "Дата сделки"; allFields[15].FieldName = "Rrent_price_day"; allFields[15].caption = "Аренда в день (руб)"; allFields[16].FieldName = "Rrent_price_month"; allFields[16].caption = "Аренда в месяц (руб)"; allFields[17].FieldName = "Rpurpose_use"; allFields[17].caption = "Назначение недвижимости"; RsaleCheckedFields = new List<ChListStruct>(); RexchCheckedFields = new List<ChListStruct>(); RrentCheckedFields = new List<ChListStruct>(); TerraCheckedFields= new List<ChListStruct>(); terraFields = new ChListStruct[12]; terraFields[0].FieldName = "Tground_area"; terraFields[0].caption = "Площадь (сотки)"; terraFields[1].FieldName = "Tprice"; terraFields[1].caption = "Стоимость"; terraFields[2].FieldName = "Twidth"; terraFields[2].caption = "Ширина"; terraFields[3].FieldName = "Theight"; terraFields[3].caption = "Глубина"; terraFields[4].FieldName = "Tpurpose_land"; terraFields[4].caption = "Назначение земли"; terraFields[5].FieldName = "Tdistrict_region"; terraFields[5].caption = "Район"; terraFields[6].FieldName = "Tdate_add"; terraFields[6].caption = "Дата добавления"; terraFields[7].FieldName = "Tdate_change"; terraFields[7].caption = "Дата последнего изменения"; terraFields[8].FieldName = "Tdistance_to_city"; terraFields[8].caption = "Расстояние до города"; terraFields[9].FieldName = "Toperation"; terraFields[9].caption = "Операция"; terraFields[10].FieldName = "Ttrade_date"; terraFields[10].caption = "Дата сделки"; terraFields[11].FieldName = "Ttrade_price"; terraFields[11].caption = "Стоимость сделки"; terraId = ""; realtId = ""; realtEstate_type=""; }
private void simpleButton7_Click(object sender, EventArgs e) { System.Uri ftpuri; if (MessageBox.Show("Подтвердите удаление", "Операция", MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.OK) { func = new ClFunctions(); for (int i = listBox2.SelectedIndices.Count-1; i >= 0; i--) { //MessageBox.Show(listBox2.Items[listBox2.SelectedIndices[i]] as Img).Name); ftpuri = new Uri("ftp://*****:*****@tamarrra.net:21//www/img1/" + (listBox2.Items[listBox2.SelectedIndices[i]] as Img).Name); func.DeleteFileFromServer("", ftpuri); dbvals.photolist.RemoveAt(listBox2.SelectedIndices[i]); listBox2.Items.RemoveAt(listBox2.SelectedIndices[i]); } if (listBox2.Items.Count!=0) { listBox2.SelectedIndex = 0; } } }
private void simpleButton4_Click(object sender, EventArgs e) { func = new ClFunctions(); for (int i = listView1.CheckedIndices.Count - 1; i >= 0; i--) { //MessageBox.Show(listBox2.Items[listBox2.SelectedIndices[i]] as Img).Name); if ((Program.user.IsAdmin) || (listView1.Items[listView1.CheckedIndices[i]].SubItems[1].Text == Program.user.email)) { dbcomm.DeleteCommentFromDB(listView1.CheckedIndices[i]); dbcomm.CommentsList.RemoveAt(listView1.CheckedIndices[i]); listView1.Items.RemoveAt(listView1.CheckedIndices[i]); } else { MessageBox.Show("Комментарий пользователя "+ listView1.Items[listView1.CheckedIndices[i]].SubItems[0].Text + " не может быть удален", "Внимание", MessageBoxButtons.OK); } } }
public AddEditAgencyFr() { InitializeComponent(); func = new ClFunctions(); }