Ejemplo n.º 1
0
        private void LoadOption()
        {
            cboTerms.Items.Clear();
            foreach (string str in Enum.GetNames(typeof(ModeOfTerms)))
            {
                cboTerms.Items.Add(str);
            }
            cboTerms.SelectedIndex = 0;

            Data.Salutation clsSalutation = new Data.Salutation();
            System.Data.DataTable dt = clsSalutation.ListAsDataTable();
            clsSalutation.CommitAndDispose();

            cboSalutation.ValueMember = "SalutationCode";
            cboSalutation.DisplayMember = "SalutationName";
            cboSalutation.DataSource = dt.DefaultView;
            cboSalutation.SelectedIndex = 0;
            cboSalutation.SelectedValue = "MR";

            System.Data.DataTable dtSex = new System.Data.DataTable("Sex");
            dtSex.Columns.Add("SexCode"); dtSex.Columns.Add("SexName");

            dtSex.Rows.Add("Male", "Male");
            dtSex.Rows.Add("Female", "Female");

            cboSex.ValueMember = "SexCode";
            cboSex.DisplayMember = "SexName";
            cboSex.DataSource = dtSex.DefaultView;
            cboSex.SelectedIndex = 0;
            cboSex.SelectedValue = "Male";

            if (mContactDetails.ContactID != 0)
            {
                //txtContactCode.Enabled = false;
                txtContactCode.Text = mContactDetails.ContactCode;
                txtAddress.Text = mContactDetails.Address;
                txtTelephoneNo.Text = mContactDetails.TelephoneNo;
                txtRemarks.Text = mContactDetails.Remarks;
                txtTelephoneNo.Tag = mContactDetails.TINNo;
                txtRemarks.Tag = mContactDetails.LTONo;

                // 18Jun2013 : For credit information
                txtCreditLimit.Text = mContactDetails.CreditLimit.ToString("#,##0.#0");
                txtCredit.Text = mContactDetails.Credit.ToString("#,##0.#0");
                txtAvailableCredit.Text = (mContactDetails.CreditLimit - mContactDetails.Credit).ToString("#,##0.#0");
                txtTerms.Text = mContactDetails.Terms.ToString("#,##0");
                cboTerms.SelectedIndex = int.Parse(mContactDetails.ModeOfTerms.ToString("d"));
                chkIsCreditAllowed.Checked = mContactDetails.IsCreditAllowed;

                if (!string.IsNullOrEmpty(mContactDetails.AdditionalDetails.Salutation))
                {
                    cboSalutation.SelectedValue = mContactDetails.AdditionalDetails.Salutation;
                    txtFirstName.Text = mContactDetails.AdditionalDetails.FirstName;
                    txtMiddleName.Text = mContactDetails.AdditionalDetails.MiddleName;
                    txtLastName.Text = mContactDetails.AdditionalDetails.LastName;
                    txtBirthDate.Text = mContactDetails.AdditionalDetails.BirthDate.ToString("yyyy-MM-dd");
                    txtMobileNo.Text = mContactDetails.AdditionalDetails.MobileNo;

                    cboSex.SelectedValue = mContactDetails.AdditionalDetails.Sex.ToString("G");
                    txtAttendingPhysician.Text = mContactDetails.AdditionalDetails.AttendingPhysician;
                }
            }
            else if (mContactDetails.ContactID == 0)
            {
                Data.ERPConfig clsERPConfig = new Data.ERPConfig();
                BarcodeHelper ean13 = new BarcodeHelper(BarcodeHelper.CustomerCode_Country_Code, BarcodeHelper.CustomerCode_ManufacturerCode, clsERPConfig.get_LastCustomerCode());
                txtContactCode.Text = ean13.CountryCode + ean13.ManufacturerCode + ean13.ProductCode + ean13.ChecksumDigit;
                clsERPConfig.CommitAndDispose();

                if (mstCaption == "Please enter customer name for deposit.")
                { txtRemarks.Text = Data.Contacts.DEFAULT_REMARKS_FOR_ADDED_FROM_DEPOSIT; }
                else if (mstCaption == "Quickly add new customer")
                { txtRemarks.Text = Data.Contacts.DEFAULT_REMARKS_FOR_QUICKLY_ADDED_FROM_FE; }
                else if (mContactDetails.ContactID == 0) // means not edit
                { txtRemarks.Text = Data.Contacts.DEFAULT_REMARKS_FOR_ADDED_FROM_CLIENT; }
            }
        }
Ejemplo n.º 2
0
 private void cmdGenerateCustomerCode_Click(object sender, EventArgs e)
 {
     Data.ERPConfig clsERPConfig = new Data.ERPConfig();
     BarcodeHelper ean13 = new BarcodeHelper(BarcodeHelper.CustomerCode_Country_Code, BarcodeHelper.CustomerCode_ManufacturerCode, clsERPConfig.get_LastCustomerCode());
     txtContactCode.Text = ean13.CountryCode + ean13.ManufacturerCode + ean13.ProductCode + ean13.ChecksumDigit;
     clsERPConfig.CommitAndDispose();
 }
Ejemplo n.º 3
0
        private void LoadOption()
        {
            Data.Salutation clsSalutation = new Data.Salutation();
            System.Data.DataTable dt = clsSalutation.ListAsDataTable();
            clsSalutation.CommitAndDispose();

            cboSalutation.ValueMember = "SalutationCode";
            cboSalutation.DisplayMember = "SalutationName";
            cboSalutation.DataSource = dt.DefaultView;
            cboSalutation.SelectedIndex = 0;
            cboSalutation.SelectedValue = "MR";

            if (mContactDetails.ContactID != 0)
            {
                //txtContactCode.Enabled = false;
                txtContactCode.Text = mContactDetails.ContactCode;
                txtContactName.Text = mContactDetails.ContactName;
                txtAddress.Text = mContactDetails.Address;
                txtBusinessName.Text = mContactDetails.BusinessName;
                txtTelephoneNo.Text = mContactDetails.TelephoneNo;
                txtRemarks.Text = mContactDetails.Remarks;
                txtTelephoneNo.Tag = mContactDetails.TINNo;
                txtRemarks.Tag = mContactDetails.LTONo;

                //txtDebit.Text = mContactDetails.Debit.ToString("###0.#0");
                //chkIsCreditAllowed.Checked = mContactDetails.IsCreditAllowed;
                //cboDepartment.SelectedIndex = cboDepartment.Items.IndexOf(cboDepartment.Items.FindByValue(mContactDetails.DepartmentID.ToString()));
                //cboPosition.SelectedIndex = cboPosition.Items.IndexOf(cboPosition.Items.FindByValue(mContactDetails.PositionID.ToString()));

                //txtCreditCardNo.Text = mContactDetails.CreditDetails.CreditCardNo;
                //cboCreditCardType.SelectedIndex = cboCreditCardType.Items.IndexOf(cboCreditCardType.Items.FindByValue(mContactDetails.CreditDetails.CardTypeDetails.CardTypeID.ToString()));
                //txtCreditAwardDate.Text = mContactDetails.CreditDetails.CreditAwardDate.ToString("yyyy-MMM-dd");
                //txtExpiryDate.Text = mContactDetails.CreditDetails.ExpiryDate.ToString("yyyy-MMM-dd");
                //cboCreditCardStatus.SelectedIndex = cboCreditCardStatus.Items.IndexOf(cboCreditCardStatus.Items.FindByValue(mContactDetails.CreditDetails.CreditCardStatus.ToString("d")));
                //lblCreditCardActive.Text = mContactDetails.CreditDetails.CreditActive ? "Active" : "InActive (Hold/Suspended)";
                //txtCreditLimit.Text = mContactDetails.CreditLimit.ToString("###0.#0");
                //txtCredit.Text = mContactDetails.Credit.ToString("###0.#0");
                //txtPaidAmount.Text = "0.00";
                //txtCurrentBalance.Text = (mContactDetails.CreditLimit - mContactDetails.Credit).ToString("###0.#0");
                //lblLastBillingDate.Text = "Last Billing Date:" + mContactDetails.CreditDetails.LastBillingDate.ToString("yyyy-MMM-dd");

                if (!string.IsNullOrEmpty(mContactDetails.AdditionalDetails.Salutation))
                {
                    cboSalutation.SelectedValue = mContactDetails.AdditionalDetails.Salutation;
                    txtFirstName.Text = mContactDetails.AdditionalDetails.FirstName;
                    txtMiddleName.Text = mContactDetails.AdditionalDetails.MiddleName;
                    txtLastName.Text = mContactDetails.AdditionalDetails.LastName;
                    txtBirthDate.Text = mContactDetails.AdditionalDetails.BirthDate.ToString("yyyy-MM-dd");
                    txtMobileNo.Text = mContactDetails.AdditionalDetails.MobileNo;
                }
            }
            else if (mContactDetails.ContactID == 0)
            {
                Data.ERPConfig clsERPConfig = new Data.ERPConfig();
                BarcodeHelper ean13 = new BarcodeHelper(BarcodeHelper.CustomerCode_Country_Code, BarcodeHelper.CustomerCode_ManufacturerCode, clsERPConfig.get_LastCustomerCode());
                txtContactCode.Text = ean13.CountryCode + ean13.ManufacturerCode + ean13.ProductCode + ean13.ChecksumDigit;
                clsERPConfig.CommitAndDispose();

                if (mstCaption == "Please enter customer name for deposit.")
                { txtRemarks.Text = Data.Contacts.DEFAULT_REMARKS_FOR_ADDED_FROM_DEPOSIT; }
                else if (mstCaption == "Quickly add new customer")
                { txtRemarks.Text = Data.Contacts.DEFAULT_REMARKS_FOR_QUICKLY_ADDED_FROM_FE; }
                else if (mContactDetails.ContactID == 0) // means not edit
                { txtRemarks.Text = Data.Contacts.DEFAULT_REMARKS_FOR_ADDED_FROM_CLIENT; }
            }
        }
Ejemplo n.º 4
0
        private void cmdGenerateCustomerCode_Click(object sender, EventArgs e)
        {
            Data.ERPConfig clsERPConfig = new Data.ERPConfig();
            BarcodeHelper  ean13        = new BarcodeHelper(BarcodeHelper.CustomerCode_Country_Code, BarcodeHelper.CustomerCode_ManufacturerCode, clsERPConfig.get_LastCustomerCode());

            txtContactCode.Text = ean13.CountryCode + ean13.ManufacturerCode + ean13.ProductCode + ean13.ChecksumDigit;
            clsERPConfig.CommitAndDispose();
        }
Ejemplo n.º 5
0
        private void LoadOption()
        {
            Data.Salutation       clsSalutation = new Data.Salutation();
            System.Data.DataTable dt            = clsSalutation.ListAsDataTable();
            clsSalutation.CommitAndDispose();

            cboSalutation.ValueMember   = "SalutationCode";
            cboSalutation.DisplayMember = "SalutationName";
            cboSalutation.DataSource    = dt.DefaultView;
            cboSalutation.SelectedIndex = 0;
            cboSalutation.SelectedValue = "MR";

            if (mContactDetails.ContactID != 0)
            {
                //txtContactCode.Enabled = false;
                txtContactCode.Text  = mContactDetails.ContactCode;
                txtContactName.Text  = mContactDetails.ContactName;
                txtAddress.Text      = mContactDetails.Address;
                txtBusinessName.Text = mContactDetails.BusinessName;
                txtTelephoneNo.Text  = mContactDetails.TelephoneNo;
                txtRemarks.Text      = mContactDetails.Remarks;
                txtTelephoneNo.Tag   = mContactDetails.TINNo;
                txtRemarks.Tag       = mContactDetails.LTONo;

                //txtDebit.Text = mContactDetails.Debit.ToString("###0.#0");
                //chkIsCreditAllowed.Checked = mContactDetails.IsCreditAllowed;
                //cboDepartment.SelectedIndex = cboDepartment.Items.IndexOf(cboDepartment.Items.FindByValue(mContactDetails.DepartmentID.ToString()));
                //cboPosition.SelectedIndex = cboPosition.Items.IndexOf(cboPosition.Items.FindByValue(mContactDetails.PositionID.ToString()));

                //txtCreditCardNo.Text = mContactDetails.CreditDetails.CreditCardNo;
                //cboCreditCardType.SelectedIndex = cboCreditCardType.Items.IndexOf(cboCreditCardType.Items.FindByValue(mContactDetails.CreditDetails.CardTypeDetails.CardTypeID.ToString()));
                //txtCreditAwardDate.Text = mContactDetails.CreditDetails.CreditAwardDate.ToString("yyyy-MMM-dd");
                //txtExpiryDate.Text = mContactDetails.CreditDetails.ExpiryDate.ToString("yyyy-MMM-dd");
                //cboCreditCardStatus.SelectedIndex = cboCreditCardStatus.Items.IndexOf(cboCreditCardStatus.Items.FindByValue(mContactDetails.CreditDetails.CreditCardStatus.ToString("d")));
                //lblCreditCardActive.Text = mContactDetails.CreditDetails.CreditActive ? "Active" : "InActive (Hold/Suspended)";
                //txtCreditLimit.Text = mContactDetails.CreditLimit.ToString("###0.#0");
                //txtCredit.Text = mContactDetails.Credit.ToString("###0.#0");
                //txtPaidAmount.Text = "0.00";
                //txtCurrentBalance.Text = (mContactDetails.CreditLimit - mContactDetails.Credit).ToString("###0.#0");
                //lblLastBillingDate.Text = "Last Billing Date:" + mContactDetails.CreditDetails.LastBillingDate.ToString("yyyy-MMM-dd");

                if (!string.IsNullOrEmpty(mContactDetails.AdditionalDetails.Salutation))
                {
                    cboSalutation.SelectedValue = mContactDetails.AdditionalDetails.Salutation;
                    txtFirstName.Text           = mContactDetails.AdditionalDetails.FirstName;
                    txtMiddleName.Text          = mContactDetails.AdditionalDetails.MiddleName;
                    txtLastName.Text            = mContactDetails.AdditionalDetails.LastName;
                    txtBirthDate.Text           = mContactDetails.AdditionalDetails.BirthDate.ToString("yyyy-MM-dd");
                    txtMobileNo.Text            = mContactDetails.AdditionalDetails.MobileNo;
                }
            }
            else if (mContactDetails.ContactID == 0)
            {
                Data.ERPConfig clsERPConfig = new Data.ERPConfig();
                BarcodeHelper  ean13        = new BarcodeHelper(BarcodeHelper.CustomerCode_Country_Code, BarcodeHelper.CustomerCode_ManufacturerCode, clsERPConfig.get_LastCustomerCode());
                txtContactCode.Text = ean13.CountryCode + ean13.ManufacturerCode + ean13.ProductCode + ean13.ChecksumDigit;
                clsERPConfig.CommitAndDispose();

                if (mstCaption == "Please enter customer name for deposit.")
                {
                    txtRemarks.Text = Data.Contacts.DEFAULT_REMARKS_FOR_ADDED_FROM_DEPOSIT;
                }
                else if (mstCaption == "Quickly add new customer")
                {
                    txtRemarks.Text = Data.Contacts.DEFAULT_REMARKS_FOR_QUICKLY_ADDED_FROM_FE;
                }
                else if (mContactDetails.ContactID == 0) // means not edit
                {
                    txtRemarks.Text = Data.Contacts.DEFAULT_REMARKS_FOR_ADDED_FROM_CLIENT;
                }
            }
        }
Ejemplo n.º 6
0
        private void LoadOption()
        {
            cboTerms.Items.Clear();
            foreach (string str in Enum.GetNames(typeof(ModeOfTerms)))
            {
                cboTerms.Items.Add(str);
            }
            cboTerms.SelectedIndex = 0;

            Data.ContactGroups clsContactGroups = new Data.ContactGroups();
            System.Data.DataTable dtContactGroups = clsContactGroups.ListAsDataTable(Data.ContactGroupCategory.CUSTOMER);
            clsContactGroups.CommitAndDispose();

            bool boContactGroup = false;
            cboGroup.Items.Clear();
            foreach (System.Data.DataRow dr in dtContactGroups.Rows)
            {
                cboGroup.Items.Add(dr["ContactGroupName"].ToString());
                if (mContactDetails.ContactGroupName == dr["ContactGroupName"].ToString())
                {
                    cboGroup.SelectedIndex = cboGroup.Items.Count - 1; boContactGroup = true;
                }
            }

            if (!boContactGroup) cboGroup.SelectedIndex = 0;

            if (mContactDetails.ContactID != 0)
            {
                txtContactCode.Text = mContactDetails.ContactCode;
                txtCustomerName.Text = mContactDetails.ContactName;
                txtBusinessName.Text = mContactDetails.BusinessName;
                txtTelNo.Text = mContactDetails.TelephoneNo;
                txtRemarks.Text = mContactDetails.Remarks;
                txtAddress.Text = mContactDetails.Address;
                txtTINNo.Text = mContactDetails.TINNo;
                txtLTONo.Text = mContactDetails.LTONo;
                txtPriceLevel.Text = mContactDetails.PriceLevel.ToString("G").ToUpper();

                // 18Jun2013 : For credit information
                txtCreditLimit.Text = mContactDetails.CreditLimit.ToString("#,##0.#0");
                txtCredit.Text = mContactDetails.Credit.ToString("#,##0.#0");
                txtAvailableCredit.Text = (mContactDetails.CreditLimit - mContactDetails.Credit).ToString("#,##0.#0");
                txtTerms.Text = mContactDetails.Terms.ToString("#,##0");
                cboTerms.SelectedIndex = int.Parse(mContactDetails.ModeOfTerms.ToString("d"));
                chkIsCreditAllowed.Checked = mContactDetails.IsCreditAllowed;
            }
            else if (mContactDetails.ContactID == 0)
            {
                Data.ERPConfig clsERPConfig = new Data.ERPConfig();
                BarcodeHelper ean13 = new BarcodeHelper(BarcodeHelper.CustomerCode_Country_Code, BarcodeHelper.CustomerCode_ManufacturerCode, clsERPConfig.get_LastCustomerCode());
                txtContactCode.Text = ean13.CountryCode + ean13.ManufacturerCode + ean13.ProductCode + ean13.ChecksumDigit;
                clsERPConfig.CommitAndDispose();

                if (mstCaption == "Please enter customer name for deposit.")
                { txtRemarks.Text = Data.Contacts.DEFAULT_REMARKS_FOR_ADDED_FROM_DEPOSIT; }
                else if (mstCaption == "Quickly add new customer")
                { txtRemarks.Text = Data.Contacts.DEFAULT_REMARKS_FOR_QUICKLY_ADDED_FROM_FE; }
                else if (mContactDetails.ContactID == 0) // means not edit
                { txtRemarks.Text = Data.Contacts.DEFAULT_REMARKS_FOR_ADDED_FROM_CLIENT; }
            }

            if (SysConfigDetails.ContactAddWndType == ContactAddWndType.ContactAddNoLTOWnd)
            {
                labelLTONo.Text = "Additional Info";
            }
            else
                labelLTONo.Text = "LTO No (BFAD No)";
        }