Exemple #1
0
 private void ListTermsAndConditions()
 {
     try
     {
         grdList.Rows.Clear();
         rowid = new List <int>();
         TermsAndConditionsDB      tcdb  = new TermsAndConditionsDB();
         List <termsandconditions> TCond = tcdb.getTermsAndConditions();
         int i = 0;
         foreach (termsandconditions tc in TCond)
         {
             grdList.Rows.Add();
             rowid.Add(tc.RowID);
             grdList.Rows[grdList.RowCount - 1].Cells["LineNo"].Value           = i + 1;
             grdList.Rows[grdList.RowCount - 1].Cells["gRowID"].Value           = tc.RowID;
             grdList.Rows[grdList.RowCount - 1].Cells["ParagraphID"].Value      = tc.ParagraphID;
             grdList.Rows[grdList.RowCount - 1].Cells["ParagraphHeading"].Value = tc.ParagraphHeading;
             grdList.Rows[grdList.RowCount - 1].Cells["Details"].Value          = tc.Details;
             i++;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error in Terms and Condition Listing");
     }
     try
     {
         enableBottomButtons();
         pnlList.Visible = true;
         btnNew.Visible  = false;
     }
     catch (Exception ex)
     {
     }
 }
Exemple #2
0
        private void ListTermsAndConditions(string did)
        {
            try
            {
                ListViewTC.Items.Clear();
                TCmappingDB      tcmdb   = new TCmappingDB();
                List <tcmapping> TCMList = tcmdb.getTCMappingList(did);

                string[]                  str    = new string[TCMList.Count];
                int                       i      = 0;
                TermsAndConditionsDB      tcdb   = new TermsAndConditionsDB();
                List <termsandconditions> TCList = tcdb.getTermsAndConditions();
                foreach (tcmapping tcm in TCMList)
                {
                    str[i] = Convert.ToString(tcm.ReferenceTC);
                    string s = str[i];
                    i++;
                }
                foreach (termsandconditions tcond in TCList)
                {
                    ListViewItem item1 = new ListViewItem();
                    for (int j = 0; j < str.Length; j++)
                    {
                        if (str[j].Equals(tcond.ParagraphID.ToString()))
                        {
                            item1.Checked = true;
                            break;
                        }
                        else
                        {
                            item1.Checked = false;
                        }
                    }

                    item1.SubItems.Add(tcond.ParagraphID.ToString());
                    item1.SubItems.Add(tcond.ParagraphHeading);
                    item1.SubItems.Add(tcond.Details);
                    ListViewTC.Items.Add(item1);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error in Terms and Condition mapping Listing");
            }
            try
            {
                enableButtons();
                pnlList.Visible = true;
                if (getuserPrivilegeStatus() == 1)
                {
                    btnSave.Visible = false;
                }
                else
                {
                    btnSave.Visible = true;
                }
            }
            catch (Exception ex)
            {
            }
        }