private void AddAllAsapuwaToPanel(Asapuwa asp, int maxNameLength, Color statusColor, Color captionColor) { sinhalaDate = string.Concat(Utility.GetSinhalaDate(FromDate), " දින සිට ", Utility.GetSinhalaDate(ToDate), " දින දක්වා"); ChangeListItemAsapuwa asapuwaClist = new ChangeListItemAsapuwa(asp.ID, asp.AsapuwaName, asp.AsapuwaNameKey, asapuwaListPanel.Controls, false, maxNameLength, new UpdateChangeItemFinalizeAsapuwa(UpdateChangeItemFinalizeAsapuwa), statusColor, captionColor, asp.NumberOfKuti, sinhalaDate); AsapuDict[asp.ID] = asapuwaClist; asapuwaClist.minimizedAsapuwa.CanvasColor = Color.Red; asapuwaClist.minimizedAsapuwa.Location = new Point(3, (allAsapuwaPanel.Controls.Count * 45) + 5); asapuwaClist.minimizedAsapuwa.Visible = true; allAsapuwaPanel.Controls.Add(asapuwaClist.minimizedAsapuwa); asapuwaClist.minimizedAsapuwa.BringToFront(); MenuItem currentBhikkuDetails = new MenuItem("වර්තමානයේ වැඩසිටින ස්වාමින් වහන්සේලා"); currentBhikkuDetails.Click += new EventHandler(asapuwaClist.currentBhikkuDetails_Click); MenuItem newBhikkuDetails = new MenuItem("අලුතින් තෝරාගත් ස්වාමින් වහන්සේලා"); newBhikkuDetails.Click += new EventHandler(asapuwaClist.newBhikkuDetails_Click); MenuItem finalizeDetails = new MenuItem("ස්වාමින් වහන්සේලා තෝරාගෙන අවසන්"); finalizeDetails.Click += new EventHandler(asapuwaClist.finalize_Click); asapuwaClist.minimizedAsapuwa.nameLabel.MouseEnter += new EventHandler(allAsapuwaInnerPanel_MouseEnter); asapuwaClist.minimizedAsapuwa.captionPanel.MouseEnter += new EventHandler(allAsapuwaInnerPanel_MouseEnter); asapuwaClist.minimizedAsapuwa.MouseEnter += new EventHandler(allAsapuwaInnerPanel_MouseEnter); asapuwaClist.minimizedAsapuwa.ContextMenu = new System.Windows.Forms.ContextMenu(new MenuItem[] { currentBhikkuDetails, newBhikkuDetails, finalizeDetails }); }
// add asapuList to RClick menu private void AddAsapuListRclick(int maxNameLength) { bool addedForignSeparator = false; allAsapuwaListPanel.Width = maxNameLength + 30; foreach (string name in asapuwaList.Keys) { Asapuwa asp = asapuwaList[name]; if (asp.Country > 0 && !addedForignSeparator) { addedForignSeparator = true; ChangeListToolstriptItem forignSep = new ChangeListToolstriptItem("---------------"); forignSep.Enabled = false; contextMenuStrip1.Items.Add(forignSep); } contextMenuStrip1.Items.Add(new ChangeListToolstriptItem(asp.AsapuwaNameKey)); try { bgColor = Color.FromArgb(Int32.Parse(ConfigurationManager.AppSettings["bgColor"])); capColor = Color.FromArgb(Int32.Parse(ConfigurationManager.AppSettings["capColor"])); statusColor = Color.FromArgb(Int32.Parse(ConfigurationManager.AppSettings["statusColor"])); } catch { } AddAllAsapuwaToPanel(asp, maxNameLength, statusColor, capColor); } }
private void AddAsapuwa(string text, ChangeListToolstriptItem changeItem, bool visible) { if (changeItem.AddedToChangeList) { changeItem.asapuChangeListItem.Visible = false; changeItem.asapuChangeListItem.Location = new Point(MousePosition.X - splitContainer1.SplitterDistance, MousePosition.Y - 60); changeItem.asapuChangeListItem.BringToFront(); } else { changeItem.AddedToChangeList = true; Asapuwa asp = asapuwaList[text]; changeItem.ForeColor = Color.Gray; changeItem.asapuwa = asp; changeItem.asapuChangeListItem = AsapuDict[asp.ID]; // new ChangeListItemAsapuwa(asp.ID, asp.AsapuwaName, asp.AsapuwaNameKey, asapuwaListPanel.Controls, visible); changeItem.asapuChangeListItem.Visible = false; changeItem.asapuChangeListItem.Location = new Point(MousePosition.X - splitContainer1.SplitterDistance, MousePosition.Y - 60); changeItem.asapuChangeListItem.RClickItem = changeItem; } if (changeItem.asapuChangeListItem.Parent == changeItem.asapuChangeListItem.minimizedAsapuwa.Parent) { asapuwaListPanel.Controls.Add(changeItem.asapuChangeListItem); } changeItem.asapuChangeListItem.Visible = true; }
private void AddAsapuwa(ComboBox combo) { using (Asapuwa ut = new Asapuwa(true)) { ut.BindToCombo(combo); } }
public void currentBhikkuDetails_Click(object sender, EventArgs e) { using (Asapuwa a = new Asapuwa(true)) { a.ID = this.asapuwaID; ChangeListItemAsapuwaDetails cad = new ChangeListItemAsapuwaDetails(this.asapuwaName, a.SelectCurrentBhikkuList(), this.Parent.Controls, new Point(100, 100), false); } }
private void addbtn_Click(object sender, EventArgs e) { try { if (ValidateBeforeAdd()) { using (Asapuwa asapuwa = new Asapuwa(true)) { asapuwa.AsapuwaName = nameTextBoxX.Text; asapuwa.ContactNumber1 = tp1textBox.Text; asapuwa.ContactNumber2 = tp2TextBox.Text; asapuwa.Address = addressTextBox.Text; asapuwa.SangaUpasthayakahimi = 0; // sangaUpastayakaTheroComboBox.SelectedValue != null ? (int)sangaUpastayakaTheroComboBox.SelectedValue : 0; asapuwa.OpeningDate = dateOfOpenDtm.Value.Date; asapuwa.HeldUpasampada = false; // upasampadaCheckBox.Checked; asapuwa.District = districtCombo.SelectedValue == null ? 0 : (int)districtCombo.SelectedValue; asapuwa.PostalCode = postalcodeTextbox.Text; asapuwa.Country = countryCombo.SelectedValue == null ? 0 : countryCombo.Text == "ශ්රී ලංකාව" ? 0 : (int)countryCombo.SelectedValue; asapuwa.NumberOfKuti = (int)numberOfKutiTxt.Value; if (asapuwaID == 0) { if (asapuwa.Add() == 1) { MessageView.ShowMsg("Sucessfully Added"); //errorProvider1.SetError(idTxt, string.Empty); //errorProvider1.SetError(nameTxt, string.Empty); clear(); } } else { asapuwa.ID = asapuwaID; if (MessageView.ShowQuestionMsg("Update '" + nameTextBoxX.Text + "' Asapuwa") == DialogResult.OK) { if (asapuwa.Update() == 1) { MessageView.ShowMsg("Sucessfully Updated"); //errorProvider1.SetError(idTxt, string.Empty); //errorProvider1.SetError(nameTxt, string.Empty); clear(); } } } } } } catch (Exception ex) { MessageView.ShowErrorMsg(ex.Message); } }
private void deleteBtn_Click(object sender, EventArgs e) { using (Asapuwa asapuwa = new Asapuwa(true)) { asapuwa.ID = asapuwaID; if (MessageView.ShowQuestionMsg("Delete Details for '" + nameTextBoxX.Text + "' Asapuwa") == DialogResult.OK) { asapuwa.Delete(); clear(); MessageView.ShowMsg("Sucessfully Deleted"); } } }
private void findButton_Click(object sender, EventArgs e) { try { using (Asapuwa asapuwa = new Asapuwa(true)) { asapuwa.AsapuwaName = nameTextBoxX.Text; asapuwa.District = districtCombo.SelectedValue != null ? (int)districtCombo.SelectedValue : 0; asapuwa.ContactNumber1 = tp1textBox.Text; DataTable ds = asapuwa.SelectFind(); frmSearch frmSub = new frmSearch(ds, this.Text, 4, 300, 200); frmSub.Width = 800; HandleSearch(frmSub); } } catch (Exception ex) { MessageView.ExceptionError(ex); } }
private void frmChangeRequest_Load(object sender, EventArgs e) { using (ChangeList cLIst = new ChangeList(true)) { cLIst.BindToCombo(cmbChangeList); } using (BikkuInfo b = new BikkuInfo(true)) { b.BindToComboNameSeparate(cmbName); cmbName.SelectedIndex = -1; } using (Asapuwa a = new Asapuwa(true)) { a.BindToCombo(new ComboBox[] { requestAsapuwa1, requestAsapuwa2, requestAsapuwa3 }); } finishLoadData = true; refreshData(); }
private void frmChangeList_Load(object sender, EventArgs e) { int maxNameLength = 0; using (BikkuInfo bInfo = new BikkuInfo(true)) { bhikkuList = bInfo.SelectAllDictionary(ref maxNameLength); bInfo.BindToComboNameSeparate(nameOfAssumedAtRobinCombo); } bhikkuNamelistPanel = createBhikkuPanel(); AddBhikkLabels((int)(maxNameLength * 11)); using (Asapuwa asp = new Asapuwa(true)) { asapuwaList = asp.SelectAllDictionary(ref maxNameLength); asp.BindToCombo(asapuHistrAsapu); } AddAsapuListRclick((int)(maxNameLength * 8)); this.WindowState = FormWindowState.Maximized; this.nameOfAssumedAtRobinCombo.SelectedValueChanged += new System.EventHandler(this.nameOfAssumedAtRobinCombo_SelectedValueChanged); label5.BackColor = upasampadaountLb.BackColor = upasampadaChangeCountLbl.BackColor = upasampadaRemainCountLbl.BackColor = Utility.GetBhikkuLabelColor(DBCore.BhikkuType.Upasampada); label6.BackColor = samaneraCountLbl.BackColor = samaneraChangeCountLbl.BackColor = samaneraRemainCountLbl.BackColor = Utility.GetBhikkuLabelColor(DBCore.BhikkuType.Samanera); }
private void RefreshForm() { try { // recidence using (Asapuwa asapuwa = new Asapuwa(true)) { asapuwa.BindToCombo(templaResidenceCombo); asapuwa.BindToCombo(asapuHistrAsapu); } templaResidenceCombo.SelectedIndex = -1; asapuHistrAsapu.SelectedIndex = -1; // robing using (Asapuwa asapuwa = new Asapuwa(true)) { asapuwa.BindToComboHeldUpasampada(templaRobingTookCombo); } templaRobingTookCombo.SelectedIndex = -1; // upasampanna using (Asapuwa asapuwa = new Asapuwa(true)) { asapuwa.BindToComboHeldUpasampada(upasampannaPlaceComboBoxEx); } upasampannaPlaceComboBoxEx.SelectedIndex = -1; // Upadya thero using (BikkuInfo bInfo = new BikkuInfo(true)) { bInfo.BindToComboUpadyaThero(nameofUpadyaComboBoxEx); } nameofUpadyaComboBoxEx.SelectedIndex = -1; // Tutor thero using (BikkuInfo bInfo = new BikkuInfo(true)) { bInfo.BindToComboUpadyaThero(nameOfRobingTutorCombo); } nameOfRobingTutorCombo.SelectedIndex = -1; // viharadhipathi thero using (BikkuInfo bInfo = new BikkuInfo(true)) { bInfo.BindToComboUpadyaThero(nameOfViharadhipathiCombo); } nameOfViharadhipathiCombo.SelectedIndex = -1; // District thero using (District dis = new District(true)) { dis.BindToCombo(districtcomboBox); } districtcomboBox.SelectedIndex = -1; } catch (Exception ex) { MessageView.ShowErrorMsg(ex.Message, this.Location); } }