Пример #1
0
        /// <versions>04-03-2018(GesAMFC-v1.0.0.3)</versions>
        private void Set_Lote_Info_CEDEN()
        {
            try
            {
                if (ComboBoxEdit_Select_Lote_CEDEN.SelectedIndex < 0)
                {
                    return;
                }
                ComboboxItem objItemLote = (ComboBoxEdit_Select_Lote_CEDEN.SelectedItem as ComboboxItem);
                Int64        lLoteId     = Convert.ToInt64(objItemLote.GetValue());
                if (lLoteId < 1)
                {
                    return;
                }
                AMFCMemberLote objLote = this.ListMemberLotes.GetLoteById(lLoteId);
                if (objLote == null || objLote.IDLOTE < 1 || String.IsNullOrEmpty(objLote.NUMLOTE))
                {
                    return;
                }
                TextEdit_Selected_Lote_Number_CEDEN.Text  = objLote.NUMLOTE;
                TextEdit_Selected_Lote_ID_CEDEN.Text      = objLote.IDLOTE.ToString();
                TextEdit_Selected_Lote_Address_CEDEN.Text = objLote.MORLOTE;

                Set_Lote_Payments_CEDEN(objLote);
            }
            catch (Exception ex)
            {
                Program.HandleError(ex.TargetSite.Name, ex.Message, Program.ErroType.EXCEPTION, true, false);
            }
        }
Пример #2
0
 /// <versions>28-02-2018(GesAMFC-v1.0.0.3)</versions>
 private Boolean Set_DBF_AMFC_Member_Lote(AMFCMemberLote objLote)
 {
     try
     {
         using (Library_AMFC_SQL obj_AMFC_SQL = new Library_AMFC_SQL())
             return(obj_AMFC_SQL.Save_Member_DB_Lote(objLote));
     }
     catch (Exception ex)
     {
         Program.HandleError(ex.TargetSite.Name, ex.Message, Program.ErroType.EXCEPTION, true, false);
         return(false);
     }
 }
Пример #3
0
        /// <versions>08-03-2018(GesAMFC-v1.0.0.3)</versions>
        private Boolean Save_Member_Lote_ESGOT()
        {
            try
            {
                if (this.Member == null || this.Member.NUMERO < this.Member.MinNumber || this.Member.NUMERO > this.Member.MaxNumber)
                    return false;

                ComboboxItem objItemLote = (ComboBoxEdit_Select_Lote_ESGOT.SelectedItem as ComboboxItem);
                Int64 lLoteId = Convert.ToInt64(objItemLote.GetValue());
                if (lLoteId < 1)
                    return false;
                AMFCMemberLote objLote = this.ListMemberLotes.GetLoteById(lLoteId);
                if (objLote == null || objLote.IDLOTE < 1 || String.IsNullOrEmpty(objLote.NUMLOTE) )
                    return false;

                AMFC_ContaCorrente_ESGOT objCCESGOT = new AMFC_ContaCorrente_ESGOT();

                objCCESGOT.SOCNUM = this.Member.NUMERO;
                objCCESGOT.SOCNOME = this.Member.NOME;
                objCCESGOT.IDLOTE = objLote.IDLOTE;
                objCCESGOT.NUMLOTE = objLote.NUMLOTE;

                objCCESGOT.AREAPAGAN = objLote.AREALOTES;
                objCCESGOT.AREAPAGAR = Program.SetAreaDoubleValue(TextEdit_Selected_Lote_Area_Pagar_ESGOT.Text);
                objCCESGOT.VALORPAGAR = Program.SetPayCurrencyEuroDoubleValue(TextEdit_Selected_Lote_Area_Pagar_ESGOT.Text);

                objCCESGOT.DATA = DateEdit_Total_Pago_Data_ESGOT.DateTime;
                objCCESGOT.VALORESCUD = Convert.ToDouble(TextEdit_Total_Pago_Valor_Escudos_ESGOT.Text);
                objCCESGOT.VALORPAGO = Program.SetPayCurrencyEuroDoubleValue(TextEdit_Total_Pago_Valor_ESGOT.Text);
                objCCESGOT.NOTASPAGO = TextEdit_Total_Pago_Notas_ESGOT.Text.Trim();

                objCCESGOT.VALORFALTA = Program.SetPayCurrencyEuroDoubleValue(TextEdit_Falta_Pagar_Valor_ESGOT.Text);
                objCCESGOT.NOTASFALTA = TextEdit_Falta_Pagar_Notas_ESGOT.Text.Trim();

                if (ComboBoxEdit_Estado_Liquidacao_ESGOT.SelectedIndex > -1)
                    objCCESGOT.ESTADOLIQ = ComboBoxEdit_Estado_Liquidacao_ESGOT.SelectedText;
                objCCESGOT.NOTASLIQ = TextEdit_Liquidacao_Notas_ESGOT.Text.Trim();

                if (!Set_DBF_Member_Lote_ESGOT(objCCESGOT))
                    return false;

                String sMessageOK = "Pagamentos de " + "Esgotos" + " guardados para o Lote Nº: " + objCCESGOT.NUMLOTE + " (ID=" + objCCESGOT.IDLOTE + ")" + " do Sócio: " + objCCESGOT.SOCNOME + " Nº: " + objCCESGOT.SOCNUM;
                MessageBox.Show(sMessageOK, "Esgotos" + " Salvas", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return true;
            }
            catch (Exception ex)
            {
                Program.HandleError(ex.TargetSite.Name, ex.Message, Program.ErroType.EXCEPTION, true, false);
                return false;
            }
        }
Пример #4
0
        /// <versions>08-03-2018(GesAMFC-v1.0.0.3)</versions>
        private void Set_Lote_Payments_ESGOT(AMFCMemberLote objLote)
        {
            try
            {
                AMFC_ContaCorrente_ESGOT objCCESGOT = Get_DBF_Member_Lote_ESGOT(this.Member.NUMERO, objLote.IDLOTE);
                if (objCCESGOT == null)
                    return;

                Double dbAREAPAGAR = (objCCESGOT.AREAPAGAR > 0) ? objCCESGOT.AREAPAGAR : objLote.AREAPAGAR;
                TextEdit_Selected_Lote_Area_Pagar_ESGOT.Text = Program.SetAreaDoubleStringValue(dbAREAPAGAR);
                
                Int32 i_Lote_Total_Pays_Reg = Get_DBF_Member_Lote_Total_Payments_Reg_ESGOT(this.Member.NUMERO, objLote.IDLOTE);
                SpinEdit_Pag_Reg_Num_Pagamentos_ESGOT.Value = (i_Lote_Total_Pays_Reg > 0) ? i_Lote_Total_Pays_Reg : 0;
                Double db_Lote_Total_Valor_Reg = Get_DBF_Member_Lote_Total_Valor_Reg_ESGOT(this.Member.NUMERO, objLote.IDLOTE);
                TextEdit_Pag_Reg_Valor_ESGOT.Text = (db_Lote_Total_Valor_Reg > 0) ? Program.SetPayDoubleStringValue(db_Lote_Total_Valor_Reg) : Program.Default_Pay_Double_String;
                
                DateEdit_Total_Pago_Data_ESGOT.DateTime = Program.SetDateTimeValue(objCCESGOT.DATA, -1, -1);
                TextEdit_Selected_Lote_Total_Pagar_ESGOT.Text = (objCCESGOT.VALORPAGAR > 0) ? Program.SetPayCurrencyEuroStringValue(objCCESGOT.VALORPAGAR) : Program.Default_Pay_Double_String;
                TextEdit_Total_Pago_Valor_Escudos_ESGOT.Text = String.Format(Program.FormatString_Double3_DecimalPlaces, objCCESGOT.VALORESCUD);
                TextEdit_Total_Pago_Valor_ESGOT.Text = Program.SetPayDoubleStringValue(objCCESGOT.VALORPAGO);
                TextEdit_Total_Pago_Notas_ESGOT.Text = objCCESGOT.NOTASPAGO;

                TextEdit_Falta_Pagar_Valor_ESGOT.Text = Program.SetPayDoubleStringValue(objCCESGOT.VALORFALTA);
                TextEdit_Falta_Pagar_Notas_ESGOT.Text = objCCESGOT.NOTASFALTA;

                if (!String.IsNullOrEmpty(objCCESGOT.ESTADOLIQ.Trim()))
                {
                    switch (objCCESGOT.ESTADOLIQ.Trim())
                    {
                        default:
                        case "Totalidade em Dívida":
                            ComboBoxEdit_Estado_Liquidacao_ESGOT.SelectedIndex = 0;
                            break;
                        case "Pagamento Parcial":
                            ComboBoxEdit_Estado_Liquidacao_ESGOT.SelectedIndex = 1;
                            break;
                        case "Totalalidade Pago":
                            ComboBoxEdit_Estado_Liquidacao_ESGOT.SelectedIndex = 2;
                            break;
                    }
                }
                else
                    ComboBoxEdit_Estado_Liquidacao_ESGOT.SelectedIndex = 0;
                TextEdit_Liquidacao_Notas_ESGOT.Text = objCCESGOT.NOTASLIQ.Trim();
            }
            catch (Exception ex)
            {
                Program.HandleError(ex.TargetSite.Name, ex.Message, Program.ErroType.EXCEPTION, true, false);
            }
        }
Пример #5
0
        /// <versions>04-03-2018(GesAMFC-v1.0.0.3)</versions>
        private Boolean Save_Member_Lote_CEDEN()
        {
            try
            {
                if (this.Member == null || this.Member.NUMERO < this.Member.MinNumber || this.Member.NUMERO > this.Member.MaxNumber)
                {
                    return(false);
                }
                if (ComboBoxEdit_Select_Lote_CEDEN.SelectedIndex < 0)
                {
                    return(false);
                }
                ComboboxItem objItemLote = (ComboBoxEdit_Select_Lote_CEDEN.SelectedItem as ComboboxItem);
                Int64        lLoteId     = Convert.ToInt64(objItemLote.GetValue());
                if (lLoteId < 1)
                {
                    return(false);
                }
                AMFCMemberLote objLote = this.ListMemberLotes.GetLoteById(lLoteId);
                if (objLote == null || objLote.IDLOTE < 1 || String.IsNullOrEmpty(objLote.NUMLOTE))
                {
                    return(false);
                }

                AMFC_ContaCorrente_CEDEN objCCCEDEN = new AMFC_ContaCorrente_CEDEN();

                objCCCEDEN.SOCNUM  = this.Member.NUMERO;
                objCCCEDEN.SOCNOME = this.Member.NOME;
                objCCCEDEN.IDLOTE  = objLote.IDLOTE;
                objCCCEDEN.NUMLOTE = objLote.NUMLOTE;

                objCCCEDEN.AREA = objLote.AREALOTES;
                Double dbCEDEN_CederPercentagem_Text    = Program.SetAreaDoubleValue(TextEdit_Selected_Lote_Percentagem_Ceder_CEDEN.Text);
                Double dbCEDEN_CederPercentagem_Decimal = Convert.ToDouble(Decimal.Divide(Convert.ToDecimal(dbCEDEN_CederPercentagem_Text), 100));
                objCCCEDEN.CEDERPERC  = dbCEDEN_CederPercentagem_Decimal;
                objCCCEDEN.AREAPAGAR  = Program.SetAreaDoubleValue(TextEdit_Selected_Lote_Area_Pagar_CEDEN.Text);
                objCCCEDEN.PRECOM2    = Program.SetPayCurrencyEuroDoubleValue(TextEdit_Selected_Lote_Preco_M2_CEDEN.Text);
                objCCCEDEN.VALORPAGAR = Program.SetPayCurrencyEuroDoubleValue(TextEdit_Selected_Lote_Total_Pagar_CEDEN.Text);

                objCCCEDEN.DATA       = DateEdit_Total_Pago_Data_CEDEN.DateTime;
                objCCCEDEN.PRECOM2P   = Program.SetPayCurrencyEuroDoubleValue(TextEdit_Total_Pago_Preco_Metro_CEDEN.Text);
                objCCCEDEN.AREAPAGO   = Program.SetAreaDoubleValue(TextEdit_Total_Pago_Metros_CEDEN.Text);
                objCCCEDEN.VALORESCUD = Convert.ToDouble(TextEdit_Total_Pago_Valor_Escudos_CEDEN.Text);
                objCCCEDEN.VALORPAGO  = Program.SetPayCurrencyEuroDoubleValue(TextEdit_Total_Pago_Valor_CEDEN.Text);
                objCCCEDEN.NOTASPAGO  = TextEdit_Total_Pago_Notas_CEDEN.Text.Trim();

                objCCCEDEN.PRECOM2F   = Program.SetPayCurrencyEuroDoubleValue(TextEdit_Falta_Pagar_Preco_Metro_CEDEN.Text);
                objCCCEDEN.AREAFALTA  = Program.SetAreaDoubleValue(TextEdit_Falta_Pagar_Metros_CEDEN.Text);
                objCCCEDEN.VALORFALTA = Program.SetPayCurrencyEuroDoubleValue(TextEdit_Falta_Pagar_Valor_CEDEN.Text);
                objCCCEDEN.NOTASFALTA = TextEdit_Falta_Pagar_Notas_CEDEN.Text.Trim();

                if (ComboBoxEdit_Estado_Liquidacao_CEDEN.SelectedIndex > -1)
                {
                    objCCCEDEN.ESTADOLIQ = ComboBoxEdit_Estado_Liquidacao_CEDEN.SelectedText;
                }
                objCCCEDEN.NOTASLIQ = TextEdit_Liquidacao_Notas_CEDEN.Text.Trim();

                if (!Set_DBF_Member_Lote_CEDEN(objCCCEDEN))
                {
                    return(false);
                }

                String sMessageOK = "Pagamentos de " + "Cedências" + " guardados para o Lote Nº: " + objCCCEDEN.NUMLOTE + " (ID=" + objCCCEDEN.IDLOTE + ")" + " do Sócio: " + objCCCEDEN.SOCNOME + " Nº: " + objCCCEDEN.SOCNUM;
                MessageBox.Show(sMessageOK, "Cedências" + " Salvas", MessageBoxButtons.OK, MessageBoxIcon.Information);

                return(true);
            }
            catch (Exception ex)
            {
                Program.HandleError(ex.TargetSite.Name, ex.Message, Program.ErroType.EXCEPTION, true, false);
                return(false);
            }
        }
Пример #6
0
        /// <versions>04-03-2018(GesAMFC-v1.0.0.3)</versions>
        private void Set_Lote_Payments_CEDEN(AMFCMemberLote objLote)
        {
            try
            {
                AMFC_ContaCorrente_CEDEN objCCCEDEN = Get_DBF_Member_Lote_CEDEN(this.Member.NUMERO, objLote.IDLOTE);
                if (objCCCEDEN == null)
                {
                    return;
                }

                Double dbAREA = (objCCCEDEN.AREA > 0) ? objCCCEDEN.AREA : objLote.AREAPAGAR;
                Double dbCEDEN_Valor_Metro      = 0;
                Double dbCEDEN_CederPercentagem = 0;
                Double dbCEDEN_CederArea        = 0;
                Double dbTotal_Pagar_CEDEN      = 0;
                if (objCCCEDEN.CEDERPERC > 0 && objCCCEDEN.AREAPAGAR > 0)
                {
                    dbCEDEN_CederPercentagem = objCCCEDEN.CEDERPERC;
                    dbCEDEN_CederArea        = objCCCEDEN.AREAPAGAR;
                }
                else
                {
                    dbCEDEN_CederPercentagem = objCCCEDEN.GetCederPercentagem(dbAREA);
                    dbCEDEN_CederArea        = objCCCEDEN.GetCederTotalAreaCeder(dbAREA);
                }
                if (objCCCEDEN.PRECOM2 > 0)
                {
                    dbCEDEN_Valor_Metro = objCCCEDEN.PRECOM2;
                }
                else
                {
                    dbCEDEN_Valor_Metro = Program.Get_Current_Parameter_CEDENC_Valor_Metro();
                }

                if (objCCCEDEN.VALORPAGAR > 0)
                {
                    dbTotal_Pagar_CEDEN = objCCCEDEN.VALORPAGAR;
                }
                else
                {
                    dbTotal_Pagar_CEDEN = Convert.ToDouble(Decimal.Multiply(Convert.ToDecimal(dbCEDEN_CederArea), Convert.ToDecimal(dbCEDEN_Valor_Metro)));
                }

                Double dbCEDEN_CederPercentagem_Text = Convert.ToDouble(Decimal.Multiply(Convert.ToDecimal(dbCEDEN_CederPercentagem), 100));

                TextEdit_Selected_Lote_Percentagem_Ceder_CEDEN.Text = Convert.ToInt32(dbCEDEN_CederPercentagem_Text).ToString();
                TextEdit_Selected_Lote_Area_Pagar_CEDEN.Text        = Program.SetAreaDoubleStringValue(dbCEDEN_CederArea);
                TextEdit_Selected_Lote_Preco_M2_CEDEN.Text          = Program.SetPayDoubleStringValue(dbCEDEN_Valor_Metro);
                TextEdit_Selected_Lote_Total_Pagar_CEDEN.Text       = Program.SetPayDoubleStringValue(dbTotal_Pagar_CEDEN);

                Int32 i_Lote_Total_Pays_Reg = Get_DBF_Member_Lote_Total_Payments_Reg_CEDEN(this.Member.NUMERO, objLote.IDLOTE);
                SpinEdit_Pag_Reg_Num_Pagamentos_CEDEN.Value = (i_Lote_Total_Pays_Reg > 0) ? i_Lote_Total_Pays_Reg : 0;
                Double db_Lote_Total_Area_Reg = Get_DBF_Member_Lote_Total_Area_Reg_CEDEN(this.Member.NUMERO, objLote.IDLOTE);
                TextEdit_Pag_Reg_Metros_CEDEN.Text = (db_Lote_Total_Area_Reg > 0) ? Program.SetAreaDoubleStringValue(db_Lote_Total_Area_Reg) : Program.Default_Area_Double_String;
                Double db_Lote_Total_Valor_Reg = Get_DBF_Member_Lote_Total_Valor_Reg_CEDEN(this.Member.NUMERO, objLote.IDLOTE);
                TextEdit_Pag_Reg_Valor_CEDEN.Text = (db_Lote_Total_Valor_Reg > 0) ? Program.SetPayDoubleStringValue(db_Lote_Total_Valor_Reg) : Program.Default_Pay_Double_String;

                DateEdit_Total_Pago_Data_CEDEN.DateTime      = Program.SetDateTimeValue(objCCCEDEN.DATA, -1, -1);
                TextEdit_Total_Pago_Preco_Metro_CEDEN.Text   = Program.SetPayDoubleStringValue(objCCCEDEN.PRECOM2P);
                TextEdit_Total_Pago_Metros_CEDEN.Text        = Program.SetAreaDoubleStringValue(objCCCEDEN.AREAPAGO);
                TextEdit_Total_Pago_Valor_Escudos_CEDEN.Text = (objCCCEDEN.VALORESCUD > 0) ? String.Format(Program.FormatString_Double3_DecimalPlaces, objCCCEDEN.VALORESCUD) : Program.Default_Pay_Double_String;
                TextEdit_Total_Pago_Valor_CEDEN.Text         = Program.SetPayDoubleStringValue(objCCCEDEN.VALORPAGO);
                TextEdit_Total_Pago_Notas_CEDEN.Text         = objCCCEDEN.NOTASPAGO;

                TextEdit_Falta_Pagar_Preco_Metro_CEDEN.Text = Program.SetPayDoubleStringValue(objCCCEDEN.PRECOM2F);
                TextEdit_Falta_Pagar_Metros_CEDEN.Text      = Program.SetAreaDoubleStringValue(objCCCEDEN.AREAFALTA);
                TextEdit_Falta_Pagar_Valor_CEDEN.Text       = Program.SetPayDoubleStringValue(objCCCEDEN.VALORFALTA);
                TextEdit_Falta_Pagar_Notas_CEDEN.Text       = objCCCEDEN.NOTASFALTA;

                if (!String.IsNullOrEmpty(objCCCEDEN.ESTADOLIQ.Trim()))
                {
                    switch (objCCCEDEN.ESTADOLIQ.Trim())
                    {
                    default:
                    case "Totalidade em Dívida":
                        ComboBoxEdit_Estado_Liquidacao_CEDEN.SelectedIndex = 0;
                        break;

                    case "Pagamento Parcial":
                        ComboBoxEdit_Estado_Liquidacao_CEDEN.SelectedIndex = 1;
                        break;

                    case "Totalalidade Pago":
                        ComboBoxEdit_Estado_Liquidacao_CEDEN.SelectedIndex = 2;
                        break;
                    }
                }
                else
                {
                    ComboBoxEdit_Estado_Liquidacao_CEDEN.SelectedIndex = 0;
                }
                TextEdit_Liquidacao_Notas_CEDEN.Text = objCCCEDEN.NOTASLIQ.Trim();
            }
            catch (Exception ex)
            {
                Program.HandleError(ex.TargetSite.Name, ex.Message, Program.ErroType.EXCEPTION, true, false);
            }
        }
Пример #7
0
        private Boolean Save_Member_Lote_Info(Int32 iLoteIdx)
        {
            try
            {
                if (this.Member == null || this.Member.NUMERO < this.Member.MinNumber || this.Member.NUMERO > this.Member.MaxNumber)
                {
                    return(false);
                }

                Int64 lLoteID = -1;
                switch (iLoteIdx)
                {
                case 1:
                    if (!String.IsNullOrEmpty(TextEdit_TS_Lote01_Id.Text.Trim()))
                    {
                        lLoteID = Convert.ToInt64(TextEdit_TS_Lote01_Id.Text.Trim());
                    }
                    break;

                case 2:
                    if (!String.IsNullOrEmpty(TextEdit_TS_Lote02_Id.Text.Trim()))
                    {
                        lLoteID = Convert.ToInt64(TextEdit_TS_Lote02_Id.Text.Trim());
                    }
                    break;

                case 3:
                    if (!String.IsNullOrEmpty(TextEdit_TS_Lote03_Id.Text.Trim()))
                    {
                        lLoteID = Convert.ToInt64(TextEdit_TS_Lote03_Id.Text.Trim());
                    }
                    break;

                case 4:
                    if (!String.IsNullOrEmpty(TextEdit_TS_Lote04_Id.Text.Trim()))
                    {
                        lLoteID = Convert.ToInt64(TextEdit_TS_Lote04_Id.Text.Trim());
                    }
                    break;

                case 5:
                    if (!String.IsNullOrEmpty(TextEdit_TS_Lote05_Id.Text.Trim()))
                    {
                        lLoteID = Convert.ToInt64(TextEdit_TS_Lote05_Id.Text.Trim());
                    }
                    break;
                }

                AMFCMemberLote objLote = this.ListMemberLotes.GetLoteById(lLoteID);
                if (lLoteID < 1 || objLote == null)
                {
                    objLote = new AMFCMemberLote();
                }

                #region     Member Info
                if (objLote.SOCNUM < 1)
                {
                    objLote.SOCNUM = this.Member.NUMERO;
                }
                if (String.IsNullOrEmpty(objLote.SOCNOME))
                {
                    objLote.SOCNOME = this.Member.NOME;
                }
                #endregion  Member Info

                #region     Set Lote Info to Add/Update
                switch (iLoteIdx)
                {
                case 1:
                    objLote.INDEXLOTE  = 1;
                    objLote.NUMLOTE    = TextEdit_TS_Lote01_Numero.Text.Trim();
                    objLote.MORLOTE    = TextEdit_TS_Lote01_Morada.Text.Trim();
                    objLote.TOTALLOTES = Convert.ToInt32(SpinEdit_TS_Lote01_Lotes_Total.Value);
                    objLote.TOTALFOGOS = Convert.ToInt32(SpinEdit_TS_Lote01_Fogos_Total.Value);
                    objLote.AREALOTES  = Program.SetAreaDoubleValue(TextEdit_TS_Lote01_Area_Real.Text.Trim());
                    objLote.AREAPAGAR  = Program.SetAreaDoubleValue(TextEdit_TS_Lote01_Area_Pagar.Text.Trim());
                    objLote.GAVETO     = CheckEdit_TS_Lote01_Gaveto.Checked;
                    objLote.QUINTINHA  = CheckEdit_TS_Lote01_Quintinha.Checked;
                    objLote.OBSERVACAO = TextEdit_TS_Lote01_Notas.Text;
                    break;

                case 2:
                    objLote.INDEXLOTE  = 2;
                    objLote.NUMLOTE    = TextEdit_TS_Lote02_Numero.Text.Trim();
                    objLote.MORLOTE    = TextEdit_TS_Lote02_Morada.Text.Trim();
                    objLote.TOTALLOTES = Convert.ToInt32(SpinEdit_TS_Lote02_Lotes_Total.Value);
                    objLote.TOTALFOGOS = Convert.ToInt32(SpinEdit_TS_Lote02_Fogos_Total.Value);
                    objLote.AREALOTES  = Program.SetAreaDoubleValue(TextEdit_TS_Lote02_Area_Real.Text.Trim());
                    objLote.AREAPAGAR  = Program.SetAreaDoubleValue(TextEdit_TS_Lote02_Area_Pagar.Text.Trim());
                    objLote.GAVETO     = CheckEdit_TS_Lote02_Gaveto.Checked;
                    objLote.QUINTINHA  = CheckEdit_TS_Lote02_Quintinha.Checked;
                    objLote.OBSERVACAO = TextEdit_TS_Lote02_Notas.Text;
                    break;

                case 3:
                    objLote.INDEXLOTE  = 3;
                    objLote.NUMLOTE    = TextEdit_TS_Lote03_Numero.Text.Trim();
                    objLote.MORLOTE    = TextEdit_TS_Lote03_Morada.Text.Trim();
                    objLote.TOTALLOTES = Convert.ToInt32(SpinEdit_TS_Lote03_Lotes_Total.Value);
                    objLote.TOTALFOGOS = Convert.ToInt32(SpinEdit_TS_Lote03_Fogos_Total.Value);
                    objLote.AREALOTES  = Program.SetAreaDoubleValue(TextEdit_TS_Lote03_Area_Real.Text.Trim());
                    objLote.AREAPAGAR  = Program.SetAreaDoubleValue(TextEdit_TS_Lote03_Area_Pagar.Text.Trim());
                    objLote.GAVETO     = CheckEdit_TS_Lote03_Gaveto.Checked;
                    objLote.QUINTINHA  = CheckEdit_TS_Lote03_Quintinha.Checked;
                    objLote.OBSERVACAO = TextEdit_TS_Lote03_Notas.Text;
                    break;

                case 4:
                    objLote.INDEXLOTE  = 4;
                    objLote.NUMLOTE    = TextEdit_TS_Lote04_Numero.Text.Trim();
                    objLote.MORLOTE    = TextEdit_TS_Lote04_Morada.Text.Trim();
                    objLote.TOTALLOTES = Convert.ToInt32(SpinEdit_TS_Lote04_Lotes_Total.Value);
                    objLote.TOTALFOGOS = Convert.ToInt32(SpinEdit_TS_Lote04_Fogos_Total.Value);
                    objLote.AREALOTES  = Program.SetAreaDoubleValue(TextEdit_TS_Lote04_Area_Real.Text.Trim());
                    objLote.AREAPAGAR  = Program.SetAreaDoubleValue(TextEdit_TS_Lote04_Area_Pagar.Text.Trim());
                    objLote.GAVETO     = CheckEdit_TS_Lote04_Gaveto.Checked;
                    objLote.QUINTINHA  = CheckEdit_TS_Lote04_Quintinha.Checked;
                    objLote.OBSERVACAO = TextEdit_TS_Lote04_Notas.Text;
                    break;

                case 5:
                    objLote.INDEXLOTE  = 5;
                    objLote.NUMLOTE    = TextEdit_TS_Lote05_Numero.Text.Trim();
                    objLote.MORLOTE    = TextEdit_TS_Lote05_Morada.Text.Trim();
                    objLote.TOTALLOTES = Convert.ToInt32(SpinEdit_TS_Lote05_Lotes_Total.Value);
                    objLote.TOTALFOGOS = Convert.ToInt32(SpinEdit_TS_Lote05_Fogos_Total.Value);
                    objLote.AREALOTES  = Program.SetAreaDoubleValue(TextEdit_TS_Lote05_Area_Real.Text.Trim());
                    objLote.AREAPAGAR  = Program.SetAreaDoubleValue(TextEdit_TS_Lote05_Area_Pagar.Text.Trim());
                    objLote.GAVETO     = CheckEdit_TS_Lote05_Gaveto.Checked;
                    objLote.QUINTINHA  = CheckEdit_TS_Lote05_Quintinha.Checked;
                    objLote.OBSERVACAO = TextEdit_TS_Lote05_Notas.Text;
                    break;
                }
                #endregion  Set Lote Info to Add/Update

                #region     Add Lote SQL Info
                if (Set_DBF_AMFC_Member_Lote(objLote))
                {
                    String sMessageOK = "Informação guardada com sucesso relativamente ao Lote Nº: " + objLote.NUMLOTE + " (ID=" + objLote.IDLOTE + ")" + " do Sócio: " + objLote.SOCNOME + " Nº: " + objLote.SOCNUM;
                    MessageBox.Show(sMessageOK, "Lote" + " Guardado", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    String sMessageERROR = "Não foi possível guardar a informação relativamente ao Lote Nº: " + objLote.NUMLOTE + " (ID=" + objLote.IDLOTE + ")" + " do Sócio: " + objLote.SOCNOME + " Nº: " + objLote.SOCNUM;
                    MessageBox.Show(sMessageERROR, "Lote" + " Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                #endregion

                #region     Update Member Lotes
                Get_Member_Lotes();
                #endregion

                return(true);
            }
            catch (Exception ex)
            {
                Program.HandleError(ex.TargetSite.Name, ex.Message, Program.ErroType.EXCEPTION, true, false);
                return(false);
            }
        }
Пример #8
0
        /// <versions>01-03-2018(GesAMFC-v1.0.0.3)</versions>
        private void Set_Member_Lotes_Info()
        {
            try
            {
                if (ListMemberLotes == null || ListMemberLotes.Lotes.Count == 0)
                {
                    return;
                }

                LayoutControl_Global_Lotes.Visible = true;

                LayoutControlGroup_TS_Lote01.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                LayoutControlGroup_TS_Lote02.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                LayoutControlGroup_TS_Lote03.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                LayoutControlGroup_TS_Lote04.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                LayoutControlGroup_TS_Lote05.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;

                Int32 iMaxTerrenos = 5;
                if (ListMemberLotes.Lotes.Count > iMaxTerrenos)
                {
                    return;
                }
                SpinEdit_Total_Lotes.Value = ListMemberLotes.Lotes.Count;

                for (Int32 iLote = 1; iLote <= ListMemberLotes.Lotes.Count; iLote++)
                {
                    if (iLote > iMaxTerrenos)
                    {
                        break;
                    }
                    AMFCMemberLote objLote = ListMemberLotes.Lotes[iLote - 1];

                    switch (iLote)
                    {
                    case 1:
                        LayoutControlGroup_TS_Lote01.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
                        LayoutControlGroup_TS_Lote01.Expanded   = true;
                        TextEdit_TS_Lote01_Numero.Text          = objLote.NUMLOTE;
                        TextEdit_TS_Lote01_Id.Text           = objLote.IDLOTE.ToString();
                        TextEdit_TS_Lote01_Morada.Text       = objLote.MORLOTE;
                        SpinEdit_TS_Lote01_Lotes_Total.Value = objLote.TOTALLOTES > 0 ? objLote.TOTALLOTES : 1;
                        SpinEdit_TS_Lote01_Fogos_Total.Value = objLote.TOTALFOGOS > 0 ? objLote.TOTALFOGOS : 1;
                        TextEdit_TS_Lote01_Area_Real.Text    = objLote.AREALOTES > 0 ? Program.SetAreaDoubleStringValue(objLote.AREALOTES) : "0";
                        if (objLote.AREAPAGAR <= 0)
                        {
                            objLote.AREAPAGAR = objLote.AREALOTES;
                        }
                        TextEdit_TS_Lote01_Area_Pagar.Text    = objLote.AREAPAGAR > 0 ? Program.SetAreaDoubleStringValue(objLote.AREAPAGAR) : "0";
                        CheckEdit_TS_Lote01_Gaveto.Checked    = objLote.GAVETO;
                        CheckEdit_TS_Lote01_Quintinha.Checked = objLote.QUINTINHA;
                        TextEdit_TS_Lote01_Notas.Text         = objLote.OBSERVACAO + " " + objLote.OBSERV2 + " " + objLote.OBSERV3;
                        break;

                    case 2:
                        LayoutControlGroup_TS_Lote02.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
                        LayoutControlGroup_TS_Lote02.Expanded   = true;
                        TextEdit_TS_Lote02_Numero.Text          = objLote.NUMLOTE;
                        TextEdit_TS_Lote02_Id.Text           = objLote.IDLOTE.ToString();
                        TextEdit_TS_Lote02_Morada.Text       = objLote.MORLOTE;
                        SpinEdit_TS_Lote02_Lotes_Total.Value = objLote.TOTALLOTES > 0 ? objLote.TOTALLOTES : 1;
                        SpinEdit_TS_Lote02_Fogos_Total.Value = objLote.TOTALFOGOS > 0 ? objLote.TOTALFOGOS : 1;
                        TextEdit_TS_Lote02_Area_Real.Text    = objLote.AREALOTES > 0 ? Program.SetAreaDoubleStringValue(objLote.AREALOTES) : "0";
                        if (objLote.AREAPAGAR <= 0)
                        {
                            objLote.AREAPAGAR = objLote.AREALOTES;
                        }
                        TextEdit_TS_Lote02_Area_Pagar.Text    = objLote.AREAPAGAR > 0 ? Program.SetAreaDoubleStringValue(objLote.AREAPAGAR) : "0";
                        CheckEdit_TS_Lote02_Gaveto.Checked    = objLote.GAVETO;
                        CheckEdit_TS_Lote02_Quintinha.Checked = objLote.QUINTINHA;
                        TextEdit_TS_Lote02_Notas.Text         = objLote.OBSERVACAO + " " + objLote.OBSERV2 + " " + objLote.OBSERV3;
                        break;

                    case 3:
                        LayoutControlGroup_TS_Lote03.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
                        LayoutControlGroup_TS_Lote03.Expanded   = true;
                        TextEdit_TS_Lote03_Numero.Text          = objLote.NUMLOTE;
                        TextEdit_TS_Lote03_Id.Text           = objLote.IDLOTE.ToString();
                        TextEdit_TS_Lote03_Morada.Text       = objLote.MORLOTE;
                        SpinEdit_TS_Lote03_Lotes_Total.Value = objLote.TOTALLOTES > 0 ? objLote.TOTALLOTES : 1;
                        SpinEdit_TS_Lote03_Fogos_Total.Value = objLote.TOTALFOGOS > 0 ? objLote.TOTALFOGOS : 1;
                        TextEdit_TS_Lote03_Area_Real.Text    = objLote.AREALOTES > 0 ? Program.SetAreaDoubleStringValue(objLote.AREALOTES) : "0";
                        if (objLote.AREAPAGAR <= 0)
                        {
                            objLote.AREAPAGAR = objLote.AREALOTES;
                        }
                        TextEdit_TS_Lote03_Area_Pagar.Text    = objLote.AREAPAGAR > 0 ? Program.SetAreaDoubleStringValue(objLote.AREAPAGAR) : "0";
                        CheckEdit_TS_Lote03_Gaveto.Checked    = objLote.GAVETO;
                        CheckEdit_TS_Lote03_Quintinha.Checked = objLote.QUINTINHA;
                        TextEdit_TS_Lote03_Notas.Text         = objLote.OBSERVACAO + " " + objLote.OBSERV2 + " " + objLote.OBSERV3;
                        break;

                    case 4:
                        LayoutControlGroup_TS_Lote04.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
                        LayoutControlGroup_TS_Lote04.Expanded   = true;
                        TextEdit_TS_Lote04_Numero.Text          = objLote.NUMLOTE;
                        TextEdit_TS_Lote04_Id.Text           = objLote.IDLOTE.ToString();
                        TextEdit_TS_Lote04_Morada.Text       = objLote.MORLOTE;
                        SpinEdit_TS_Lote04_Lotes_Total.Value = objLote.TOTALLOTES > 0 ? objLote.TOTALLOTES : 1;
                        SpinEdit_TS_Lote04_Fogos_Total.Value = objLote.TOTALFOGOS > 0 ? objLote.TOTALFOGOS : 1;
                        TextEdit_TS_Lote04_Area_Real.Text    = objLote.AREALOTES > 0 ? Program.SetAreaDoubleStringValue(objLote.AREALOTES) : "0";
                        if (objLote.AREAPAGAR <= 0)
                        {
                            objLote.AREAPAGAR = objLote.AREALOTES;
                        }
                        TextEdit_TS_Lote04_Area_Pagar.Text    = objLote.AREAPAGAR > 0 ? Program.SetAreaDoubleStringValue(objLote.AREAPAGAR) : "0";
                        CheckEdit_TS_Lote04_Gaveto.Checked    = objLote.GAVETO;
                        CheckEdit_TS_Lote04_Quintinha.Checked = objLote.QUINTINHA;
                        TextEdit_TS_Lote04_Notas.Text         = objLote.OBSERVACAO + " " + objLote.OBSERV2 + " " + objLote.OBSERV3;
                        break;

                    case 5:
                        LayoutControlGroup_TS_Lote05.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
                        LayoutControlGroup_TS_Lote05.Expanded   = true;
                        TextEdit_TS_Lote05_Numero.Text          = objLote.NUMLOTE;
                        TextEdit_TS_Lote05_Id.Text           = objLote.IDLOTE.ToString();
                        TextEdit_TS_Lote05_Morada.Text       = objLote.MORLOTE;
                        SpinEdit_TS_Lote05_Lotes_Total.Value = objLote.TOTALLOTES > 0 ? objLote.TOTALLOTES : 1;
                        SpinEdit_TS_Lote05_Fogos_Total.Value = objLote.TOTALFOGOS > 0 ? objLote.TOTALFOGOS : 1;
                        TextEdit_TS_Lote05_Area_Real.Text    = objLote.AREALOTES > 0 ? Program.SetAreaDoubleStringValue(objLote.AREALOTES) : "0";
                        if (objLote.AREAPAGAR <= 0)
                        {
                            objLote.AREAPAGAR = objLote.AREALOTES;
                        }
                        TextEdit_TS_Lote05_Area_Pagar.Text    = objLote.AREAPAGAR > 0 ? Program.SetAreaDoubleStringValue(objLote.AREAPAGAR) : "0";
                        CheckEdit_TS_Lote05_Gaveto.Checked    = objLote.GAVETO;
                        CheckEdit_TS_Lote05_Quintinha.Checked = objLote.QUINTINHA;
                        TextEdit_TS_Lote05_Notas.Text         = objLote.OBSERVACAO + " " + objLote.OBSERV2 + " " + objLote.OBSERV3;
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                Program.HandleError(ex.TargetSite.Name, ex.Message, Program.ErroType.EXCEPTION, true, false);
            }
        }