private void search_Load(object sender, EventArgs e) { log = JsonConvert.DeserializeObject <CatsAndAreasObject>(GlobalVariable.newCatsAndAreas); this.MaximizeBox = true; List <Control> allControls = fontclass.GetAllControls(this); allControls.ForEach(k => k.Font = GlobalVariable.headerlistFONT); Settings1.Default.IsLogedIn = "1"; setcat(); //log = GlobalVariable.catsAndAreas; //Settings1.Default.IsLogedIn = "1"; //setcatforclient(); panel1.PanelElement.Shape = new RoundRectShape(); panel1.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid; panel1.PanelElement.PanelFill.BackColor = Color.White; panel2.PanelElement.Shape = new RoundRectShape(); panel2.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid; panel2.PanelElement.PanelFill.BackColor = Color.White; panel3.PanelElement.Shape = new RoundRectShape(); panel3.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid; panel3.PanelElement.PanelFill.BackColor = Color.White; radPanel38.PanelElement.Shape = new RoundRectShape(); mantagheNameText.Text = ""; mantagheNameText2.Text = ""; }
private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e) { string result = ""; GlobalVariable.token = "9aef7e0f3117d25dc3cdae90b83111d5"; try { using (WebClient client = new WebClient()) { var collection = new System.Collections.Specialized.NameValueCollection(); collection.Add("token", "9aef7e0f3117d25dc3cdae90b83111d5"); byte[] response = client.UploadValues("http://arvandfile.com/api/v1/getCats&Areas.php", collection); result = System.Text.Encoding.UTF8.GetString(response); CatsAndAreasObject CATS = new CatsAndAreasObject(); CATS = JsonConvert.DeserializeObject <CatsAndAreasObject>(result); if (CATS.result != null) { GlobalVariable.newCatsAndAreas = result; GlobalVariable.isadmin = "1"; } } //this.Close(); } catch (Exception) { // loadingIMG.Visible = false; backgroundWorker.CancelAsync(); } }
private void search_Load(object sender, EventArgs e) { this.MaximizeBox = true; initFont(); if (GlobalVariable.isadmin == "1") { log = JsonConvert.DeserializeObject <CatsAndAreasObject>(GlobalVariable.newCatsAndAreas); Settings1.Default.IsLogedIn = "1"; setcat(); } else { log = GlobalVariable.catsAndAreas; Settings1.Default.IsLogedIn = "1"; setcatforclient(); } panel1.PanelElement.Shape = new RoundRectShape(); panel1.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid; panel1.PanelElement.PanelFill.BackColor = Color.White; panel2.PanelElement.Shape = new RoundRectShape(); panel2.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid; panel2.PanelElement.PanelFill.BackColor = Color.White; panel3.PanelElement.Shape = new RoundRectShape(); panel3.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid; panel3.PanelElement.PanelFill.BackColor = Color.White; radPanel38.PanelElement.Shape = new RoundRectShape(); mantagheNameText.Text = ""; mantagheNameText2.Text = ""; }
private void manageFile_Load(object sender, EventArgs e) { List <Control> allControls = fontclass.GetAllControls(this); allControls.ForEach(k => k.Font = GlobalVariable.headerlistFONT); if (GlobalVariable.isadmin == "1") { CATS = JsonConvert.DeserializeObject <CatsAndAreasObject>(GlobalVariable.newCatsAndAreas); } else { CATS = GlobalVariable.catsAndAreas; } if (GlobalVariable.fromwhere6 == "main") { delete.Visible = false; deletepanel.Visible = false; } this.MinimizeBox = false; this.MaximizeBox = false; if (GlobalVariable.selectedOwnObject != null) { obj = GlobalVariable.selectedOwnObject; InitControl(); } else { if (GlobalVariable.isadmin == "1") { setcat(); } else { setcatforclient(); } } }
public ItemDetail(string newItem, string fromwhere) { obj = JsonConvert.DeserializeObject <item>(newItem); CATS = JsonConvert.DeserializeObject <CatsAndAreasObject>(GlobalVariable.newCatsAndAreas); InitializeComponent(); InitControl(); if (fromwhere == "archive") { button1.Visible = false; } else { if (GlobalVariable.role != "admin") { button1.Visible = false; } } }
void getDataBackGroundWorker_do(object sender, DoWorkEventArgs e) { string query = (string)e.Argument; string S = ""; try { CatsAndAreasObject CATS = new CatsAndAreasObject(); CATS = JsonConvert.DeserializeObject <CatsAndAreasObject>(GlobalVariable.newCatsAndAreas); List <gridVM> list = new List <gridVM>(); List <item> Listitem = manager.getList(query); foreach (var item in Listitem) { if (GlobalVariable.searchTabghe == "") { GlobalVariable.searchTabghe = "1"; } string tabaghe = GlobalVariable.searchTabghe; string fullprice = item.tabaghe_1_total_price.ToString(); string metriprice = item.tabaghe_1_metri.ToString(); string rahnprice = item.tabaghe_1_rahn.ToString(); string ejareprice = item.tabaghe_1_ejare.ToString(); string tabagh = item.tabaghe1.ToString(); string kha = item.bed1.ToString(); string zirban = item.zirbana1.ToString(); string tb1 = item.tabaghe1.ToString(); string tb2 = item.tabaghe2.ToString(); string tb3 = item.tabaghe3.ToString(); if (tb1 == tabaghe) { fullprice = item.tabaghe_1_total_price.ToString(); metriprice = item.tabaghe_1_metri.ToString(); rahnprice = item.tabaghe_1_rahn.ToString(); ejareprice = item.tabaghe_1_ejare.ToString(); tabagh = item.tabaghe1.ToString(); kha = item.bed1.ToString(); zirban = item.zirbana1.ToString(); } if (tb2 == tabaghe) { fullprice = item.tabaghe_2_total_price.ToString(); metriprice = item.tabaghe_2_metri.ToString(); rahnprice = item.tabaghe_2_rahn.ToString(); ejareprice = item.tabaghe_2_ejare.ToString(); tabagh = item.tabaghe2.ToString(); kha = item.bed2.ToString(); zirban = item.zirbana2.ToString(); } if (tb3 == tabaghe) { fullprice = item.tabaghe_3_total_price.ToString(); metriprice = item.tabaghe_3_metri.ToString(); rahnprice = item.tabaghe_3_rahn.ToString(); ejareprice = item.tabaghe_3_ejare.ToString(); tabagh = item.tabaghe3.ToString(); kha = item.bed3.ToString(); zirban = item.zirbana3.ToString(); } string serverid = item.ID.ToString(); string date = item.date_updated.ToString(); string address = item.address.ToString(); string owner = item.malek.ToString(); string senn = item.senn == 0 ? "-" : (from q in CATS.data.list.senn where q.ID == item.senn.ToString() select q.title).First(); string melkkind = ""; if (item.maghaze != "0") { melkkind = melkkind + "مغازه،"; } if (item.apartment != "0") { melkkind = melkkind + "آپارتمان،"; } if (item.villa != "0") { melkkind = melkkind + "ویلا،"; } if (item.mostaghellat != "0") { melkkind = melkkind + "مستغلات،"; } if (item.kolangi != "0") { melkkind = melkkind + "کلنگی،"; } if (item.office != "0") { melkkind = melkkind + "دفتر،"; } if (melkkind.Length > 0) { melkkind = melkkind.Remove(melkkind.Length - 1, 1); } string Dealkind = ""; if (Convert.ToInt32(item.isForoosh.ToString()) > 0) { Dealkind = Dealkind + "فروش،"; } if (Convert.ToInt32(item.isRahn.ToString()) > 0) { Dealkind = Dealkind + "رهن،"; } if (Convert.ToInt32(item.isEjare.ToString()) > 0) { Dealkind = Dealkind + "اجاره،"; } if (Dealkind.Length > 0) { Dealkind = Dealkind.Remove(Dealkind.Length - 1, 1); } string totalrahn = item.isForoosh.ToString() == "1" ? fullprice : rahnprice; string metriejare = item.isForoosh.ToString() == "1" ? metriprice : ejareprice; string Rtabaghe = tabagh; string khab = kha; string zirbana = zirban; bool mycheckbox = false; totalrahn = totalrahn.Replace(".", ""); //// جهت بازیابی آیتم های تیک خورده استفاده می شود //if (.Contains(serverid + ",")) //{ // mycheckbox = true; //} gridVM newitem = new gridVM() { phones = item.phones, Address = item.address1 + item.address2 + item.address3, Address1 = item.address1, Address2 = item.address2, Address3 = item.address3, bed = kha, codegrid = item.number.ToString(), dategrid = dateTimeConvert.ToPersianDateString(item.date_updated), datetime = item.date_updated, ejare_metri = Convert.ToInt64(metriejare), floorgrid = tabagh, kindgrid = Dealkind, typegrid = melkkind, ownergrid = item.malek, rahn_total = Convert.ToInt64(totalrahn), zirbana = zirban, checkbox = false, Senn = senn, mantagheName = item.mantaghe_name }; list.Add(newitem); } string FILELIST = JsonConvert.SerializeObject(list); e.Result = FILELIST; } catch (Exception error) { e.Result = "error"; } }
private void ItemDetail_Load(object sender, EventArgs e) { this.KeyPreview = true; CATS = JsonConvert.DeserializeObject <CatsAndAreasObject>(GlobalVariable.newCatsAndAreas); List <Control> allControls = fontclass.GetAllControls(this); allControls.ForEach(k => k.Font = GlobalVariable.headerlistFONT); la7.Font = GlobalVariable.headerlistFONTsmall; la8.Font = GlobalVariable.headerlistFONTsmall; la9.Font = GlobalVariable.headerlistFONTsmall; la10.Font = GlobalVariable.headerlistFONTsmall; la11.Font = GlobalVariable.headerlistFONTsmall; la12.Font = GlobalVariable.headerlistFONTsmall; la13.Font = GlobalVariable.headerlistFONTsmall; la14.Font = GlobalVariable.headerlistFONTsmall; la15.Font = GlobalVariable.headerlistFONTsmall; la09.Font = GlobalVariable.headerlistFONTsmall; la17.Font = GlobalVariable.headerlistFONTsmall; la18.Font = GlobalVariable.headerlistFONTsmall; la19.Font = GlobalVariable.headerlistFONTsmall; //la20.Font = GlobalVariable.headerlistFONTsmall; //la21.Font = GlobalVariable.headerlistFONTsmall; //la22.Font = GlobalVariable.headerlistFONTsmall; //label13.Font = GlobalVariable.headerlistFONTsmall; label12.Font = GlobalVariable.headerlistFONTsmall; la57.Font = GlobalVariable.headerlistFONTsmall; this.MinimizeBox = true; this.MaximizeBox = true; whishon.Visible = false; ListOfAdds.RootObject log = JsonConvert.DeserializeObject <ListOfAdds.RootObject>(GlobalVariable.result); InitControl(); wishoff.Name = "0-" + obj.ID; whishon.Name = "1-" + obj.ID; saveToPrivate.Name = "2-" + obj.ID; next.Name = "3-" + obj.ID; back.Name = "4-" + obj.ID; string ideas = Settings1.Default.ides; if (ideas.Contains("," + obj.ID)) { wishoff.Visible = false; whishon.Visible = true; } else { whishon.Visible = false; wishoff.Visible = true; } }
public void setcatforclient() { CatsAndAreasObject log = GlobalVariable.catsAndAreas; Settings1.Default.IsLogedIn = "1"; BindingSource bs = new BindingSource(); bs.DataSource = new List <string> { "-", "آپارتمان", "دفتر کار", "کلنگی", "مستغلات", "ویلا", "مغازه" }; kind.DataSource = bs; // سه گزینه زیر اینجا داده نمی شود و در بخش لاگین کاربر //GlobalVariable.activezonse = log.result2.active_regions; //GlobalVariable.portlimit = log.result2.max_users; //GlobalVariable.expirationdate = log.result2.expire_date; //// GlobalVariable.token = log.token; //var sourceofApartment = new AutoCompleteStringCollection(); //foreach (var item in log.result.apartment) //{ // sourceofApartment.Add(item); //} //apartment.AutoCompleteCustomSource = sourceofApartment; //apartment.AutoCompleteMode = AutoCompleteMode.Append; //apartment.AutoCompleteSource = AutoCompleteSource.CustomSource; //apartment.MaxDropDownItems = 10; apartment.DisplayMember = "title"; apartment.ValueMember = "ID"; apartment.DataSource = new BindingSource(log.result.apartment, null); ashpazkhane.DisplayMember = "title"; ashpazkhane.ValueMember = "ID"; ashpazkhane.DataSource = new BindingSource(log.result.ashpazkhane, null); //var sourceofOffice = new AutoCompleteStringCollection(); //foreach (var item in log.result.office) //{ // sourceofOffice.Add(item); //} //office.AutoCompleteCustomSource = sourceofOffice; //office.AutoCompleteMode = AutoCompleteMode.Append; //office.AutoCompleteSource = AutoCompleteSource.CustomSource; //office.MaxDropDownItems = 10; office.DisplayMember = "title"; office.ValueMember = "ID"; office.DataSource = new BindingSource(log.result.office, null); //var sourceofKolangi = new AutoCompleteStringCollection(); //foreach (var item in log.result.kolangi) //{ // sourceofKolangi.Add(item); //} //kolangi.AutoCompleteCustomSource = sourceofKolangi; //kolangi.AutoCompleteMode = AutoCompleteMode.SuggestAppend; //kolangi.AutoCompleteSource = AutoCompleteSource.CustomSource; //kolangi.MaxDropDownItems = 10; kolangi.DisplayMember = "title"; kolangi.ValueMember = "ID"; kolangi.DataSource = new BindingSource(log.result.kolangi, null); //var sourceofVilla = new AutoCompleteStringCollection(); //foreach (var item in log.result.villa) //{ // sourceofVilla.Add(item); //} //villa.AutoCompleteCustomSource = sourceofVilla; //villa.AutoCompleteMode = AutoCompleteMode.SuggestAppend; //villa.AutoCompleteSource = AutoCompleteSource.CustomSource; //villa.MaxDropDownItems = 10; villa.DisplayMember = "title"; villa.ValueMember = "ID"; villa.DataSource = new BindingSource(log.result.villa, null); //var sourceofMostaghelat = new AutoCompleteStringCollection(); //foreach (var item in log.result.mostaghellat) //{ // sourceofMostaghelat.Add(item); //} //mostaghellat.AutoCompleteCustomSource = sourceofMostaghelat; //mostaghellat.AutoCompleteMode = AutoCompleteMode.SuggestAppend; //mostaghellat.AutoCompleteSource = AutoCompleteSource.CustomSource; //mostaghellat.MaxDropDownItems = 10; mostaghellat.DisplayMember = "title"; mostaghellat.ValueMember = "ID"; mostaghellat.DataSource = new BindingSource(log.result.mostaghellat, null); //var sourceofSamt = new AutoCompleteStringCollection(); //foreach (var item in log.result.samt) //{ // sourceofSamt.Add(item); //} //samt.AutoCompleteCustomSource = sourceofSamt; //samt.AutoCompleteMode = AutoCompleteMode.SuggestAppend; //samt.AutoCompleteSource = AutoCompleteSource.CustomSource; //samt.MaxDropDownItems = 10; //samt.DataSource = log.result.samt; //var sourceofSenn = new AutoCompleteStringCollection(); //foreach (var item in log.result.senn) //{ // sourceofSenn.Add(item); //} //senn.AutoCompleteCustomSource = sourceofSenn; //senn.AutoCompleteMode = AutoCompleteMode.SuggestAppend; //senn.AutoCompleteSource = AutoCompleteSource.CustomSource; //senn.MaxDropDownItems = 10; // senn.DataSource = log.result.villa; //var sourceofMantaghe = new AutoCompleteStringCollection(); //foreach (var item in log.result.mantaghe) //{ // sourceofMantaghe.Add(item); //} //mantaghe.AutoCompleteCustomSource = sourceofMantaghe; //mantaghe.AutoCompleteMode = AutoCompleteMode.SuggestAppend; //mantaghe.AutoCompleteSource = AutoCompleteSource.CustomSource; //mantaghe.MaxDropDownItems = 10; mantaghe_name.DisplayMember = "title"; mantaghe_name.ValueMember = "ID"; mantaghe_name.DataSource = new BindingSource(log.result.mantaghe, null); mantaghe_id.DisplayMember = "title"; mantaghe_id.ValueMember = "ID"; mantaghe_id.DataSource = new BindingSource(log.result.mantaghe_id, null); //var sourceofMantagheID = new AutoCompleteStringCollection(); //foreach (var item in log.result.mantaghe_id) //{ // sourceofMantagheID.Add(item); //} //mantaghe_id.AutoCompleteCustomSource = sourceofMantagheID; //mantaghe_id.AutoCompleteMode = AutoCompleteMode.SuggestAppend; //mantaghe_id.AutoCompleteSource = AutoCompleteSource.CustomSource; //mantaghe_id.MaxDropDownItems = 10; // m.DataSource = log.result.mantaghe_id; //var sourceofSeraydar = new AutoCompleteStringCollection(); //foreach (var item in log.result.seraydar) //{ // sourceofSeraydar.Add(item); //} //seraydar.AutoCompleteCustomSource = sourceofSeraydar; //seraydar.AutoCompleteMode = AutoCompleteMode.SuggestAppend; //seraydar.AutoCompleteSource = AutoCompleteSource.CustomSource; //seraydar.MaxDropDownItems = 10; // seraydar.DataSource = log.result.seraydar; //var sourceofKatType = new AutoCompleteStringCollection(); //foreach (var item in log.result.kaf_type) //{ // sourceofKatType.Add(item); //} //kaf_type.AutoCompleteCustomSource = sourceofKatType; //kaf_type.AutoCompleteMode = AutoCompleteMode.SuggestAppend; //kaf_type.AutoCompleteSource = AutoCompleteSource.CustomSource; //kaf_type.MaxDropDownItems = 10; // kaf_type.DataSource = log.result.kaf_type; //var sourceofSarmayesh = new AutoCompleteStringCollection(); //foreach (var item in log.result.garmayesh_sarmayesh) //{ // sourceofSarmayesh.Add(item); //} //garmayesh_sarmayesh.AutoCompleteCustomSource = sourceofSarmayesh; //garmayesh_sarmayesh.AutoCompleteMode = AutoCompleteMode.SuggestAppend; //garmayesh_sarmayesh.AutoCompleteSource = AutoCompleteSource.CustomSource; //garmayesh_sarmayesh.MaxDropDownItems = 10; // garmayesh_sarmayesh.DataSource = log.result.garmayesh_sarmayesh; try { } catch (Exception) { MessageBox.Show("خطا در اتصال به سرور"); } }
private void Form6_Load(object sender, EventArgs e) { List <Control> allControls = GetAllControls(this); allControls.ForEach(k => k.Font = GlobalVariable.headerlistFONT); if (GlobalVariable.isadmin == "1") { CATS = JsonConvert.DeserializeObject <CatsAndAreasObject>(GlobalVariable.newCatsAndAreas); } else { CATS = GlobalVariable.catsAndAreas; } if (GlobalVariable.fromwhere6 == "main") { delete.Visible = false; deletepanel.Visible = false; } this.MinimizeBox = false; this.MaximizeBox = false; la12.Font = GlobalVariable.headerlistFONTsmall; la13.Font = GlobalVariable.headerlistFONTsmall; la16.Font = GlobalVariable.headerlistFONTsmall; la17.Font = GlobalVariable.headerlistFONTsmall; la18.Font = GlobalVariable.headerlistFONTsmall; la19.Font = GlobalVariable.headerlistFONTsmall; la09.Font = GlobalVariable.headerlistFONTsmall; la20.Font = GlobalVariable.headerlistFONTsmall; la21.Font = GlobalVariable.headerlistFONTsmall; la22.Font = GlobalVariable.headerlistFONTsmall; if (GlobalVariable.selectedOwnObject != null) { obj = GlobalVariable.selectedOwnObject; InitControl(); } else { if (GlobalVariable.isadmin == "1") { setcat(); } else { setcatforclient(); } } try { } catch (Exception) { throw; } }
public void InitControl() { if (GlobalVariable.isadmin == "1") { CATS = JsonConvert.DeserializeObject <CatsAndAreasObject>(GlobalVariable.newCatsAndAreas); } else { CATS = GlobalVariable.catsAndAreas; } title.Text = obj.title; //phone owner.Text = obj.malek; address.Text = obj.address; date_updated.Text = obj.date_updated; ID.Text = obj.ID; total_vahed.Text = obj.total_vahed; total_floor.Text = obj.total_floor; vahed_per_floor.Text = obj.vahed_per_floor; zirbana1.Text = obj.zirbana1; zirbana2.Text = obj.zirbana2; zirbana3.Text = obj.zirbana3; khab1.Text = obj.bed1; khab2.Text = obj.bed2; khab3.Text = obj.bed3; tabaghe1.Text = obj.tabaghe1; tabaghe2.Text = obj.tabaghe2; tabaghe3.Text = obj.tabaghe3; tabaghe_1_rahn.Text = obj.tabaghe_1_rahn; tabaghe_2_rahn.Text = obj.tabaghe_2_rahn; tabaghe_3_rahn.Text = obj.tabaghe_3_rahn; tabaghe_1_ejare.Text = obj.tabaghe_1_ejare; tabaghe_2_ejare.Text = obj.tabaghe_2_ejare; tabaghe_3_ejare.Text = obj.tabaghe_3_ejare; tabaghe_1_total_price.Text = obj.tabaghe_1_total_price; tabaghe_2_total_price.Text = obj.tabaghe_2_total_price; tabaghe_3_total_price.Text = obj.tabaghe_3_total_price; tabaghe_3_metri.Text = obj.tabaghe_1_metri; tabaghe_2_metri.Text = obj.tabaghe_2_metri; tabaghe_3_metri.Text = obj.tabaghe_3_metri; tarakom.Text = obj.tarakom; toole_bar.Text = obj.toole_bar; masahat_zamin.Text = obj.masahat_zamin; ertefa.Text = obj.ertefa; eslahi.Text = obj.eslahi; zirzamin.Text = obj.zirzamin; desc.Text = obj.desc; if (obj.isForoosh == "1") { isForoosh.Checked = true; } if (obj.isEjare == "1") { isEjare.Checked = true; } if (obj.isRahn == "1") { isRahn.Checked = true; } if (obj.isMosharekat == "1") { isMosharekat.Checked = true; } if (obj.isMoaveze == "1") { isMoaveze.Checked = true; } if (obj.sell2khareji == "1") { sell2khareji.Checked = true; } if (obj.maghaze == "1") { maghaze.Checked = true; } if (obj.hasEstakhr == "1") { hasEstakhr.Checked = true; } if (obj.hasJakoozi == "1") { hasJakoozi.Checked = true; } if (obj.hasSauna == "1") { hasSauna.Checked = true; } if (obj.takhlie == "1") { takhlie.Checked = true; } if (obj.balkon1 == "1") { balkon1.Checked = true; } if (obj.balkon2 == "1") { balkon2.Checked = true; } if (obj.balkon3 == "1") { balkon3.Checked = true; } if (obj.parking1 == "1") { parking1.Checked = true; } if (obj.parking2 == "1") { parking2.Checked = true; } if (obj.parking3 == "1") { parking3.Checked = true; } if (obj.anbari1 == "1") { anbari1.Checked = true; } if (obj.anbari2 == "1") { anbari2.Checked = true; } if (obj.anbari3 == "1") { anbari3.Checked = true; } if (obj.asansor1 == "1") { asansor1.Checked = true; } if (obj.asansor2 == "1") { asansor2.Checked = true; } if (obj.asansor3 == "1") { asansor3.Checked = true; } if (obj.hasGym == "1") { hasGym.Checked = true; } if (obj.hasShooting == "1") { hasShooting.Checked = true; } if (obj.hasHall == "1") { hasHall.Checked = true; } if (obj.hasRoofGarden == "1") { hasRoofGarden.Checked = true; } if (obj.isMoble == "1") { isMoble.Checked = true; } if (obj.hasLobbyMan == "1") { hasLobbyMan.Checked = true; } mantaghe_id.Text = SetDropDownValue(obj.mantaghe_id, "mantaghe_id"); mantaghe_name.Text = SetDropDownValue(obj.mantaghe_name, "mantaghe"); apartment.Text = SetDropDownValue(obj.apartment, "apartment"); office.Text = SetDropDownValue(obj.office, "office"); villa.Text = SetDropDownValue(obj.villa, "villa"); mostaghellat.Text = SetDropDownValue(obj.mostaghellat, "mostaghellat"); kolangi.Text = SetDropDownValue(obj.kolangi, "kolangi"); seraydar.Text = SetDropDownValue(obj.seraydar, "seraydar"); kaf_type.Text = SetDropDownValue(obj.kaf_type, "kaf_type"); garmayesh_sarmayesh.Text = SetDropDownValue(obj.garmayesh_sarmayesh, "garmayesh_sarmayesh"); ashpazkhane1.Text = SetDropDownValue(obj.ashpazkhane1, "ashpazkhane"); ashpazkhane2.Text = SetDropDownValue(obj.ashpazkhane2, "ashpazkhane"); ashpazkhane3.Text = SetDropDownValue(obj.ashpazkhane3, "ashpazkhane"); senn.Text = SetDropDownValue(obj.senn, "senn"); samt.Text = SetDropDownValue(obj.samt, "samt"); sanad.Text = SetDropDownValue(obj.sanad, "sanad"); }
void getDataBackGroundWorkerFileList_do(object sender, DoWorkEventArgs e) { queryModel model = new queryModel(); List <string> addressList = e.Argument.ToString().Split(',').ToList(); model.address1 = addressList[0]; model.address2 = addressList[1]; model.address3 = addressList[2]; string query = JsonConvert.SerializeObject(model); try { CatsAndAreasObject CATS = JsonConvert.DeserializeObject <CatsAndAreasObject>(GlobalVariable.newCatsAndAreas); List <gridVM> list = new List <gridVM>(); foreach (var item in manager.getList(query)) { if (GlobalVariable.searchTabghe == "") { GlobalVariable.searchTabghe = "1"; } string phones = item.phones; string tabaghe = GlobalVariable.searchTabghe; string fullprice = item.tabaghe_1_total_price.ToString(); string metriprice = item.tabaghe_1_metri.ToString(); string rahnprice = item.tabaghe_1_rahn.ToString(); string ejareprice = item.tabaghe_1_ejare.ToString(); string tabagh = item.tabaghe1.ToString(); string kha = item.bed1.ToString(); string zirban = item.zirbana1.ToString(); string tb1 = item.tabaghe1.ToString(); string tb2 = item.tabaghe2.ToString(); string tb3 = item.tabaghe3.ToString(); if (tb1 == tabaghe) { fullprice = item.tabaghe_1_total_price.ToString(); metriprice = item.tabaghe_1_metri.ToString(); rahnprice = item.tabaghe_1_rahn.ToString(); ejareprice = item.tabaghe_1_ejare.ToString(); tabagh = item.tabaghe1.ToString(); kha = item.bed1.ToString(); zirban = item.zirbana1.ToString(); } if (tb2 == tabaghe) { fullprice = item.tabaghe_2_total_price.ToString(); metriprice = item.tabaghe_2_metri.ToString(); rahnprice = item.tabaghe_2_rahn.ToString(); ejareprice = item.tabaghe_2_ejare.ToString(); tabagh = item.tabaghe2.ToString(); kha = item.bed2.ToString(); zirban = item.zirbana2.ToString(); } if (tb3 == tabaghe) { fullprice = item.tabaghe_3_total_price.ToString(); metriprice = item.tabaghe_3_metri.ToString(); rahnprice = item.tabaghe_3_rahn.ToString(); ejareprice = item.tabaghe_3_ejare.ToString(); tabagh = item.tabaghe3.ToString(); kha = item.bed3.ToString(); zirban = item.zirbana3.ToString(); } string serverid = item.ID.ToString(); string date = item.date_updated.ToString(); string address = item.address.ToString(); string owner = item.malek.ToString(); string senn = item.senn == 0 ? "-" : (from q in CATS.data.list.senn where q.ID == item.senn.ToString() select q.title).First(); string melkkind = ""; if (item.maghaze != null && item.maghaze != "0") { melkkind = melkkind + "مغازه،"; } if (item.apartment != null && item.apartment != "0") { melkkind = melkkind + "آپارتمان،"; } if (item.villa != null && item.villa != "0") { melkkind = melkkind + "ویلا،"; } if (item.mostaghellat != null && item.mostaghellat != "0") { melkkind = melkkind + "مستغلات،"; } if (item.kolangi != null && item.kolangi != "0") { melkkind = melkkind + "کلنگی،"; } if (item.office != null && item.office != "0") { melkkind = melkkind + "دفتر،"; } if (melkkind.Length > 0) { melkkind = melkkind.Remove(melkkind.Length - 1, 1); } string Dealkind = ""; if (Convert.ToInt32(item.isForoosh.ToString()) > 0) { Dealkind = Dealkind + "فروش،"; } if (Convert.ToInt32(item.isRahn.ToString()) > 0) { Dealkind = Dealkind + "رهن،"; } if (Convert.ToInt32(item.isEjare.ToString()) > 0) { Dealkind = Dealkind + "اجاره،"; } if (Dealkind.Length > 0) { Dealkind = Dealkind.Remove(Dealkind.Length - 1, 1); } string totalrahn = item.isForoosh.ToString() == "1" ? fullprice : rahnprice; string metriejare = item.isForoosh.ToString() == "1" ? metriprice : ejareprice; string Rtabaghe = tabagh; string khab = kha; string zirbana = zirban; bool mycheckbox = false; totalrahn = totalrahn.Replace(".", ""); if (totalrahn == "0") { totalrahn = "0"; } else if (Convert.ToInt64(totalrahn) > 0) { string mytotal = string.Format(CultureInfo.InvariantCulture, "{0:0,0}", Convert.ToInt64(totalrahn)); totalrahn = mytotal; } //else if (totalrahn == "-1") //{ // totalrahn = "توافقی"; //} //else if (totalrahn == "-2") //{ // totalrahn = "رایگان"; //} metriejare = metriejare.Replace(".", ""); if (Convert.ToInt64(metriejare) == 0) { metriejare = "0"; } else if (Convert.ToInt64(metriejare) > 0) { string mymetriejare = string.Format(CultureInfo.InvariantCulture, "{0:0,0}", Convert.ToInt64(metriejare)); metriejare = mymetriejare; } //else if (metriejare == "-1") //{ // metriejare = "توافقی"; //} //else if (metriejare == "-2") //{ // metriejare = "رایگان"; //} if (GlobalVariable.temporaryOwnList.Contains(serverid + ",")) { mycheckbox = true; } gridVM newitem = new gridVM() { Address = item.address1 + item.address2 + item.address3, Address1 = item.address1, Address2 = item.address2, Address3 = item.address3, bed = kha, codegrid = item.number.ToString(), dategrid = dateTimeConvert.ToPersianDateString(item.date_updated), datetime = item.date_updated, ejare_metri = int.Parse(metriejare.Replace(",", "")), floorgrid = tabagh, kindgrid = Dealkind, typegrid = melkkind, ownergrid = item.malek, rahn_total = int.Parse(totalrahn.Replace(",", "")), zirbana = zirban, checkbox = mycheckbox, Senn = senn, phones = phones }; list.Add(newitem); } string FILELIST = JsonConvert.SerializeObject(list); e.Result = FILELIST; } catch (Exception error) { e.Result = "error"; } }
public override void Synchronize() { base.Synchronize(); this.Text = ""; DataRowView rowView = this.Row.DataBoundItem as DataRowView; string tabaghe = GlobalVariable.searchTabghe; string fullprice = "tabaghe_1_total_price"; string metriprice = "tabaghe_1_metri"; string rahnprice = "tabaghe_1_rahn"; string ejareprice = "tabaghe_1_ejare"; string tabagh = "tabaghe1"; string kha = "bed1"; string zirban = "zirbana1"; string tb1 = rowView.Row["tabaghe1"].ToString(); string tb2 = rowView.Row["tabaghe2"].ToString(); string tb3 = rowView.Row["tabaghe3"].ToString(); if (tb1 == tabaghe) { fullprice = "tabaghe_1_total_price"; metriprice = "tabaghe_1_metri"; rahnprice = "tabaghe_1_rahn"; ejareprice = "tabaghe_1_ejare"; tabagh = "tabaghe1"; kha = "bed1"; zirban = "zirbana1"; } if (tb2 == tabaghe) { fullprice = "tabaghe_2_total_price"; metriprice = "tabaghe_2_metri"; rahnprice = "tabaghe_2_rahn"; ejareprice = "tabaghe_2_ejare"; tabagh = "tabaghe2"; kha = "bed2"; zirban = "zirbana2"; } if (tb3 == tabaghe) { fullprice = "tabaghe_3_total_price"; metriprice = "tabaghe_3_metri"; rahnprice = "tabaghe_3_rahn"; ejareprice = "tabaghe_3_ejare"; tabagh = "tabaghe3"; kha = "bed3"; zirban = "zirbana3"; } CatsAndAreasObject CATS = new CatsAndAreasObject(); try { CATS = JsonConvert.DeserializeObject <CatsAndAreasObject>(GlobalVariable.newCatsAndAreas); } catch { CATS = GlobalVariable.catsAndAreas; } string serverid = rowView.Row["ID"].ToString(); string date = rowView.Row["date_updated"].ToString(); string address = rowView.Row["address"].ToString(); string owner = rowView.Row["malek"].ToString(); string senn = rowView.Row["senn"].ToString() == "0" ? "-" : (from q in CATS.result.senn where q.ID == rowView.Row["senn"].ToString() select q.title).First(); //if (rowView.Row["senn"].ToString() == "1") //{ // senn = "قدیمی"; //} //else if (rowView.Row["senn"].ToString() == "2") //{ // senn = "نوساز"; //} //else //{ // senn =(int.Parse(rowView.Row["senn"].ToString()) - 2).ToString(); //} string melkkind = ""; if (Convert.ToInt32(rowView.Row["maghaze"].ToString()) > 0) { melkkind = melkkind + "مغازه،"; } if (Convert.ToInt32(rowView.Row["apartment"].ToString()) > 0) { melkkind = melkkind + "آپارتمان،"; } if (Convert.ToInt32(rowView.Row["villa"].ToString()) > 0) { melkkind = melkkind + "ویلا،"; } if (Convert.ToInt32(rowView.Row["mostaghellat"].ToString()) > 0) { melkkind = melkkind + "مستغلات،"; } if (Convert.ToInt32(rowView.Row["kolangi"].ToString()) > 0) { melkkind = melkkind + "کلنگی،"; } if (Convert.ToInt32(rowView.Row["office"].ToString()) > 0) { melkkind = melkkind + "دفتر،"; } if (melkkind.Length > 0) { melkkind = melkkind.Remove(melkkind.Length - 1, 1); } string Dealkind = ""; if (Convert.ToInt32(rowView.Row["isForoosh"].ToString()) > 0) { Dealkind = Dealkind + "فروش،"; } if (Convert.ToInt32(rowView.Row["isRahn"].ToString()) > 0) { Dealkind = Dealkind + "رهن،"; } if (Convert.ToInt32(rowView.Row["isEjare"].ToString()) > 0) { Dealkind = Dealkind + "اجاره،"; } if (Dealkind.Length > 0) { Dealkind = Dealkind.Remove(Dealkind.Length - 1, 1); } string totalrahn = rowView.Row["isForoosh"].ToString() == "1" ? rowView.Row[fullprice].ToString() : rowView.Row[rahnprice].ToString(); string metriejare = rowView.Row["isForoosh"].ToString() == "1" ? rowView.Row[metriprice].ToString() : rowView.Row[ejareprice].ToString(); string Rtabaghe = rowView.Row[tabagh].ToString(); string khab = rowView.Row[kha].ToString(); string zirbana = rowView.Row[zirban].ToString(); bool mycheckbox = false; totalrahn = totalrahn.Replace(".", ""); if (totalrahn == "0") { totalrahn = "-"; } else if (Convert.ToInt64(totalrahn) > 0) { string mytotal = string.Format(CultureInfo.InvariantCulture, "{0:0,0}", Convert.ToInt64(totalrahn)); totalrahn = mytotal; } else if (totalrahn == "-1") { totalrahn = "توافقی"; } else if (totalrahn == "-2") { totalrahn = "رایگان"; } metriejare = metriejare.Replace(".", ""); if (Convert.ToInt64(metriejare) == 0) { metriejare = "-"; } else if (Convert.ToInt64(metriejare) > 0) { string mymetriejare = string.Format(CultureInfo.InvariantCulture, "{0:0,0}", Convert.ToInt64(metriejare)); metriejare = mymetriejare; } else if (metriejare == "-1") { metriejare = "توافقی"; } else if (metriejare == "-2") { metriejare = "رایگان"; } if (GlobalVariable.temporaryOwnList.Contains(serverid + ",")) { mycheckbox = true; } obj.setTitle(serverid, date, owner, melkkind, Dealkind, totalrahn, metriejare, Rtabaghe, khab, zirbana, mycheckbox, address, senn); // DataRowView rowView = this.Row.DataBoundItem as DataRowView; //this.button.Text = "ddd"; }
public void setcatforclient() { CatsAndAreasObject log = GlobalVariable.catsAndAreas; Settings1.Default.IsLogedIn = "1"; apartment.DisplayMember = "title"; apartment.ValueMember = "ID"; apartment.DataSource = new BindingSource(log.result.apartment, null); ashpazkhane1.DisplayMember = "title"; ashpazkhane1.ValueMember = "ID"; ashpazkhane1.DataSource = new BindingSource(log.result.ashpazkhane, null); ashpazkhane2.DisplayMember = "title"; ashpazkhane2.ValueMember = "ID"; ashpazkhane2.DataSource = new BindingSource(log.result.ashpazkhane, null); ashpazkhane3.DisplayMember = "title"; ashpazkhane3.ValueMember = "ID"; ashpazkhane3.DataSource = new BindingSource(log.result.ashpazkhane, null); office.DisplayMember = "title"; office.ValueMember = "ID"; office.DataSource = new BindingSource(log.result.office, null); kolangi.DisplayMember = "title"; kolangi.ValueMember = "ID"; kolangi.DataSource = new BindingSource(log.result.kolangi, null); villa.DisplayMember = "title"; villa.ValueMember = "ID"; villa.DataSource = new BindingSource(log.result.villa, null); mostaghellat.DisplayMember = "title"; mostaghellat.ValueMember = "ID"; mostaghellat.DataSource = new BindingSource(log.result.mostaghellat, null); samt.DisplayMember = "title"; samt.ValueMember = "ID"; samt.DataSource = new BindingSource(log.result.samt, null); senn.DisplayMember = "title"; senn.ValueMember = "ID"; senn.DataSource = new BindingSource(log.result.senn, null); mantaghe_name.DisplayMember = "title"; mantaghe_name.ValueMember = "ID"; mantaghe_name.DataSource = new BindingSource(log.result.mantaghe, null); mantaghe_id.DisplayMember = "title"; mantaghe_id.ValueMember = "ID"; mantaghe_id.DataSource = new BindingSource(log.result.mantaghe_id, null); seraydar.DisplayMember = "title"; seraydar.ValueMember = "ID"; seraydar.DataSource = new BindingSource(log.result.seraydar, null); kaf_type.DisplayMember = "title"; kaf_type.ValueMember = "ID"; kaf_type.DataSource = new BindingSource(log.result.kaf_type, null); garmayesh_sarmayesh.DisplayMember = "title"; garmayesh_sarmayesh.ValueMember = "ID"; garmayesh_sarmayesh.DataSource = new BindingSource(log.result.garmayesh_sarmayesh, null); }
public void InitControl() { try { CATS = JsonConvert.DeserializeObject <CatsAndAreasObject>(GlobalVariable.newCatsAndAreas); } catch { CATS = GlobalVariable.catsAndAreas; } title.Text = obj.title; if (obj.phones != null) { try { phone1.Text = obj.phones[0]; } catch (Exception) { phone1.Text = ""; } try { phone2.Text = obj.phones[1]; } catch (Exception) { phone2.Text = ""; } try { phone3.Text = obj.phones[2]; } catch (Exception) { phone3.Text = ""; } } owner.Text = obj.malek; address.Text = obj.address; date_updated.Text = obj.date_updated; ID.Text = obj.ID; total_vahed.Text = obj.total_vahed; total_floor.Text = obj.total_floor; vahed_per_floor.Text = obj.vahed_per_floor; zirbana1.Text = obj.zirbana1; zirbana2.Text = obj.zirbana2; zirbana3.Text = obj.zirbana3; khab1.Text = obj.bed1; khab2.Text = obj.bed2; khab3.Text = obj.bed3; tabaghe1.Text = obj.tabaghe1; tabaghe2.Text = obj.tabaghe2; tabaghe3.Text = obj.tabaghe3; tabaghe_1_rahn.Text = getChangedValue(obj.tabaghe_1_rahn); tabaghe_2_rahn.Text = getChangedValue(obj.tabaghe_2_rahn); // == "-2" ? "رایگان" : string.Format(CultureInfo.InvariantCulture, "{0:0,0}", Convert.ToInt64(obj.tabaghe_2_rahn)); tabaghe_3_rahn.Text = getChangedValue(obj.tabaghe_3_rahn); // == "-2" ? "رایگان" : string.Format(CultureInfo.InvariantCulture, "{0:0,0}", Convert.ToInt64(obj.tabaghe_3_rahn)); tabaghe_1_ejare.Text = getChangedValue(obj.tabaghe_1_ejare); // == "-2" ? "رایگان" : string.Format(CultureInfo.InvariantCulture, "{0:0,0}", Convert.ToInt64(obj.tabaghe_1_ejare)); tabaghe_2_ejare.Text = getChangedValue(obj.tabaghe_2_ejare); // == "-2" ? "رایگان" : string.Format(CultureInfo.InvariantCulture, "{0:0,0}", Convert.ToInt64(obj.tabaghe_2_ejare)); tabaghe_3_ejare.Text = getChangedValue(obj.tabaghe_3_ejare); // == "-2" ? "رایگان" : string.Format(CultureInfo.InvariantCulture, "{0:0,0}", Convert.ToInt64(obj.tabaghe_3_ejare)); tabaghe_1_total_price.Text = getChangedValue(obj.tabaghe_1_total_price); //== "-2" ? "رایگان" : string.Format(CultureInfo.InvariantCulture, "{0:0,0}", Convert.ToInt64(obj.tabaghe_1_total_price)); tabaghe_2_total_price.Text = getChangedValue(obj.tabaghe_2_total_price); // == "-2" ? "رایگان" : string.Format(CultureInfo.InvariantCulture, "{0:0,0}", Convert.ToInt64(obj.tabaghe_2_total_price)); tabaghe_3_total_price.Text = getChangedValue(obj.tabaghe_3_total_price); // == "-2" ? "رایگان" : string.Format(CultureInfo.InvariantCulture, "{0:0,0}", Convert.ToInt64(obj.tabaghe_3_total_price)); tabaghe_1_metri.Text = getChangedValue(obj.tabaghe_1_metri); // string.Format(CultureInfo.InvariantCulture, "{0:0,0}", Convert.ToInt64(); tabaghe_2_metri.Text = getChangedValue(obj.tabaghe_2_metri); // string.Format(CultureInfo.InvariantCulture, "{0:0,0}", Convert.ToInt64(); tabaghe_3_metri.Text = getChangedValue(obj.tabaghe_3_metri); // string.Format(CultureInfo.InvariantCulture, "{0:0,0}", Convert.ToInt64(); tarakom.Text = obj.tarakom; toole_bar.Text = obj.toole_bar; masahat_zamin.Text = obj.masahat_zamin; ertefa.Text = obj.ertefa; eslahi.Text = obj.eslahi; zirzamin.Text = obj.zirzamin; desc.Text = obj.desc; isForoosh.Checked = obj.isForoosh == "1" ? true : false; isEjare.Checked = obj.isEjare == "1" ? true : false; isMosharekat.Checked = obj.isMosharekat == "1" ? true : false; isRahn.Checked = obj.isRahn == "1" ? true : false; isMoaveze.Checked = obj.isMoaveze == "1" ? true : false; sell2khareji.Checked = obj.sell2khareji == "1" ? true : false; hasEstakhr.Checked = obj.hasEstakhr == "1" ? true : false; hasJakoozi.Checked = obj.hasJakoozi == "1" ? true : false; hasSauna.Checked = obj.hasSauna == "1" ? true : false; takhlie.Checked = obj.takhlie == "1" ? true : false; balkon1.Checked = obj.balkon1 == "1" ? true : false; balkon2.Checked = obj.balkon2 == "1" ? true : false; balkon3.Checked = obj.balkon3 == "1" ? true : false; parking1.Checked = obj.parking1 == "1" ? true : false; parking2.Checked = obj.parking2 == "1" ? true : false; parking3.Checked = obj.parking3 == "1" ? true : false; anbari1.Checked = obj.anbari1 == "1" ? true : false; anbari2.Checked = obj.anbari2 == "1" ? true : false; anbari3.Checked = obj.anbari3 == "1" ? true : false; asansor1.Checked = obj.asansor1 == "1" ? true : false; asansor2.Checked = obj.asansor2 == "1" ? true : false; asansor3.Checked = obj.asansor3 == "1" ? true : false; hasGym.Checked = obj.hasGym == "1" ? true : false; hasShooting.Checked = obj.hasShooting == "1" ? true : false; hasHall.Checked = obj.hasHall == "1" ? true : false; hasRoofGarden.Checked = obj.hasRoofGarden == "1" ? true : false; isMoble.Checked = obj.isMoble == "1" ? true : false; hasLobbyMan.Checked = obj.hasLobbyMan == "1" ? true : false; maghaze.Checked = obj.maghaze == "1" ? true : false; mantaghe_id.Text = obj.mantaghe_id == "0" ? "-" : (from q in CATS.result.mantaghe_id where q.ID == obj.mantaghe_id select q.title).First(); mantaghe_name.Text = obj.mantaghe_name == "0" ? "-" : (from q in CATS.result.mantaghe where q.ID == obj.mantaghe_name select q.title).First(); apartment.Text = obj.apartment == "0" ? "-" : (from q in CATS.result.apartment where q.ID == obj.apartment select q.title).First(); office.Text = obj.office == "0" ? "-" : (from q in CATS.result.office where q.ID == obj.office select q.title).First(); villa.Text = obj.villa == "0" ? "-" : (from q in CATS.result.villa where q.ID == obj.villa select q.title).First(); mostaghellat.Text = obj.mostaghellat == "0" ? "-" : (from q in CATS.result.mostaghellat where q.ID == obj.mostaghellat select q.title).First(); kolangi.Text = obj.kolangi == "0" ? "-" : (from q in CATS.result.kolangi where q.ID == obj.kolangi select q.title).First(); seraydar.Text = obj.seraydar == "0" ? "-" : (from q in CATS.result.seraydar where q.ID == obj.seraydar select q.title).First(); kaf_type.Text = obj.kaf_type == "0" ? "-" : (from q in CATS.result.kaf_type where q.ID == obj.kaf_type select q.title).First(); if (obj.garmayesh_sarmayesh.Length > 1) { string final = ""; string srt = obj.garmayesh_sarmayesh.Remove(obj.garmayesh_sarmayesh.Length - 1, 1); srt = srt.Remove(0, 1); if (srt.Contains(',')) { List <string> lstsg3 = srt.Split(',').ToList(); foreach (var itemm in lstsg3) { final = final + (from q in CATS.result.garmayesh_sarmayesh where q.ID == itemm select q.title).First() + ","; } } else { final = (from q in CATS.result.garmayesh_sarmayesh where q.ID == srt select q.title).First(); } //final = final.Remove(final.Length - 1, 1); garmayesh_sarmayesh.Text = final; } else if (obj.garmayesh_sarmayesh.Length == 1) { if (obj.garmayesh_sarmayesh == "0") { garmayesh_sarmayesh.Text = "-"; } else { garmayesh_sarmayesh.Text = (from q in CATS.result.garmayesh_sarmayesh where q.ID == obj.garmayesh_sarmayesh select q.title).First(); } } else { garmayesh_sarmayesh.Text = "-"; } if (obj.ashpazkhane1.Length > 1) { string final = ""; string srt = obj.ashpazkhane1.Remove(obj.ashpazkhane1.Length - 1, 1); srt = srt.Remove(0, 1); if (srt.Contains(',')) { List <string> lstsg3 = srt.Split(',').ToList(); foreach (var itemm in lstsg3) { final = final + (from q in CATS.result.ashpazkhane where q.ID == itemm select q.title).First() + ","; } } else { final = (from q in CATS.result.ashpazkhane where q.ID == srt select q.title).First(); } // final = final.Remove(final.Length - 1, 1); ashpazkhane1.Text = final; } else if (obj.ashpazkhane1.Length == 1) { if (obj.ashpazkhane1 == "0") { ashpazkhane1.Text = "-"; } else { ashpazkhane1.Text = (from q in CATS.result.ashpazkhane where q.ID == obj.ashpazkhane1 select q.title).First(); } } else { ashpazkhane1.Text = "-"; } if (obj.ashpazkhane2.Length > 0) { string final = ""; string srt = obj.ashpazkhane2.Remove(obj.ashpazkhane2.Length - 1, 1); srt = srt.Remove(0, 1); if (srt.Contains(',')) { List <string> lstsg3 = srt.Split(',').ToList(); foreach (var itemm in lstsg3) { final = final + (from q in CATS.result.ashpazkhane where q.ID == itemm select q.title).First() + ","; } } else { final = (from q in CATS.result.ashpazkhane where q.ID == srt select q.title).First(); } //final = final.Remove(final.Length - 1, 1); ashpazkhane2.Text = final; } else if (obj.ashpazkhane2.Length == 1) { if (obj.ashpazkhane2 == "0") { ashpazkhane2.Text = "-"; } else { ashpazkhane2.Text = (from q in CATS.result.ashpazkhane where q.ID == obj.ashpazkhane2 select q.title).First(); } } else { ashpazkhane2.Text = "-"; } if (obj.ashpazkhane3.Length > 0) { string final = ""; string srt = obj.ashpazkhane3.Remove(obj.ashpazkhane3.Length - 1, 1); srt = srt.Remove(0, 1); if (srt.Contains(',')) { List <string> lstsg3 = srt.Split(',').ToList(); foreach (var itemm in lstsg3) { final = final + (from q in CATS.result.ashpazkhane where q.ID == itemm select q.title).First() + ","; } } else { final = (from q in CATS.result.ashpazkhane where q.ID == srt select q.title).First(); } //final = final.Remove(final.Length - 1, 1); ashpazkhane3.Text = final; } else if (obj.ashpazkhane3.Length == 1) { if (obj.ashpazkhane3 == "0") { ashpazkhane3.Text = "-"; } else { ashpazkhane3.Text = (from q in CATS.result.ashpazkhane where q.ID == obj.ashpazkhane3 select q.title).First(); } } else { ashpazkhane3.Text = "-"; } senn.Text = obj.senn == "0" ? "-" : (from q in CATS.result.senn where q.ID == obj.senn select q.title).First(); samt.Text = obj.samt == "0" ? "-" : (from q in CATS.result.samt where q.ID == obj.samt select q.title).First(); sanad.Text = obj.sanad == "0" ? "-" : (from q in CATS.result.sanad where q.ID == obj.sanad select q.title).First(); }