Example #1
0
        private void initForm()
        {
            isDeleted = false;
            if (_id > 0)
            {
                InsuranceInfoData data = insuranceInfoBs.getById(_id);
                txtName.Text = data.Tables[InsuranceInfoData.insuranceInfo_TABLE].Rows[0][InsuranceInfoData.name_FIELD].ToString();
                cmbCustomerType.SelectedIndex =
                    (int)data.Tables[InsuranceInfoData.insuranceInfo_TABLE].Rows[0][InsuranceInfoData.CustomerType_FIELD];
                txtFamily.Text      = data.Tables[InsuranceInfoData.insuranceInfo_TABLE].Rows[0][InsuranceInfoData.family_FIELD].ToString();
                txtPhoneNumber.Text = data.Tables[InsuranceInfoData.insuranceInfo_TABLE].Rows[0][InsuranceInfoData.phoneNumber_FIELD].ToString();
                txtMobilePhone.Text = data.Tables[InsuranceInfoData.insuranceInfo_TABLE].Rows[0][InsuranceInfoData.mobileNumber_FIELD].ToString();
                txtBirthDate.Text   = toShamsiString(data, InsuranceInfoData.BirthDate_FIELD);
                txtAddress.Text     = data.Tables[InsuranceInfoData.insuranceInfo_TABLE].Rows[0][InsuranceInfoData.address_FIELD].ToString();

                selectComboItemForInsuraceType(int.Parse(
                                                   data.Tables[InsuranceInfoData.insuranceInfo_TABLE].Rows[0][InsuranceInfoData.insuranceType_FIELD].ToString()));
                txtInsuranceNumber.Text = data.Tables[InsuranceInfoData.insuranceInfo_TABLE].Rows[0][InsuranceInfoData.insuranceNumber_FIELD].ToString();

                txtBeginDate.Text = toShamsiString(data, InsuranceInfoData.beginDate_FIELD);
                txtEndDate.Text   = toShamsiString(data, InsuranceInfoData.endDate_FIELD);

                txtLastUpdateDate.Text = toShamsiString(data, InsuranceInfoData.creationDate_FIELD);
                txtCreationDate.Text   = toShamsiString(data, InsuranceInfoData.lastUpdateDate_FIELD);

                txtDescription.Text = data.Tables[InsuranceInfoData.insuranceInfo_TABLE].Rows[0][InsuranceInfoData.description_FIELD].ToString();
            }
            else
            {
                linkAttachment.Enabled = false;
                txtCreationDate.Text   = getTodayShamsi();
                txtLastUpdateDate.Text = getTodayShamsi();
            }
        }
Example #2
0
        private void checkForLogging(int insuranceInfoId, string endDateStr)
        {
            InsuranceInfoBS   insBS   = new InsuranceInfoBS();
            InsuranceInfoData insData = insBS.getById(insuranceInfoId);

            if (insData.Tables[0].Rows.Count > 0)
            {
                Boolean haveDid = Boolean.Parse(insData.Tables[0].Rows[0][InsuranceInfoData.haveDid_FIELD].ToString());
                if (haveDid == false)
                {
                    addlog(true, insuranceInfoId, endDateStr);
                }
            }
        }