Ejemplo n.º 1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (ePublicVariable.eVariable.IsFieldEmpty(pnlBody))
            {
                oFrmMsgBox = new frmMessageBox(eVariable.TransactionMessage.ALL_FIELDS_ARE_REQUIRED.ToString().Replace("_", " "));
                oFrmMsgBox.m_MessageType = frmMessageBox.MESSAGE_TYPE.INFO;
                oFrmMsgBox.ShowDialog();
                return;
            }
            else
            {
                oMPolicy = new Model.Policy();
                oPolicy  = new DataAccess.Policy();
                oMPolicy.DUE_INTEREST         = txtDueRate.Text;
                oMPolicy.LOST_DAMAGE_INTEREST = txtLDRate.Text;
                oMPolicy.DAYS_LIMIT           = txtMaxDays.Text;
                oMPolicy.BOOK_LIMIT           = txtMaxBooks.Text;

                if (!oPolicy.IsPolicyExist())
                {
                    oPolicy.InsertPolicy(oMPolicy);
                }
                else
                {
                    oPolicy.UpdatePolicy(oMPolicy);
                }

                oFrmMsgBox = new frmMessageBox(eVariable.TransactionMessage.RECORD_HAS_BEEN_SUCESSFULLY_SAVED.ToString().Replace("_", " "));
                oFrmMsgBox.m_MessageType = frmMessageBox.MESSAGE_TYPE.INFO;
                oFrmMsgBox.ShowDialog();
            }
        }
Ejemplo n.º 2
0
 private void LoadPolicy()
 {
     oPolicy = new DataAccess.Policy();
     foreach (DataRow row in oPolicy.GetPolicy("", "").Rows)
     {
         eVariable.iDaysLimit = Convert.ToInt32(row["Days_Limit"]);
         eVariable.iBookLimit = Convert.ToInt32(row["Book_Limit"]);
     }
 }
Ejemplo n.º 3
0
 void GetPolicy()
 {
     oPolicy = new DataAccess.Policy();
     foreach (DataRow row in oPolicy.GetPolicy("", "").Rows)
     {
         lblDueInterest.Text = row[0].ToString() + " %";
         lblLDInterest.Text  = row[1].ToString() + " %";
         lblMaxDays.Text     = row[2].ToString();
         lblMaxBook.Text     = row[3].ToString();
     }
 }
Ejemplo n.º 4
0
 void GetPolicy()
 {
     oPolicy = new DataAccess.Policy();
     foreach (DataRow row in oPolicy.GetPolicy("", "").Rows)
     {
         iDueInterest = Convert.ToDouble(row[0]);
         iLDInterest  = Convert.ToDouble(row[1]);
         iMaxDays     = Convert.ToInt32(row[2]);
         iMaxBook     = Convert.ToInt32(row[3]);
     }
 }
Ejemplo n.º 5
0
 void LoadRecords()
 {
     oPolicy = new DataAccess.Policy();
     foreach (DataRow row in oPolicy.GetPolicy("", "").Rows)
     {
         txtDueRate.Text  = row[0] == null ? "0" : row[0].ToString();
         txtLDRate.Text   = row[1] == null ? "0" : row[1].ToString();
         txtMaxDays.Text  = row[2] == null ? "0" : row[2].ToString();
         txtMaxBooks.Text = row[3] == null ? "0" : row[3].ToString();
     }
 }