Пример #1
0
        public int GetPostFixIndex(WordAmount amount, WordCase aCase)
        {
            switch (amount)
            {
            case WordAmount.Plural:
            {
                if (pluralPostfixSelector.ContainsKey(aCase))
                {
                    return(pluralPostfixSelector[aCase]);
                }
                break;
            }

            case WordAmount.Singular:
            {
                if (singularPostfixSelector.ContainsKey(aCase))
                {
                    return(singularPostfixSelector[aCase]);
                }
                break;
            }
            }

            return(0);
        }
Пример #2
0
        public string GetForm(WordGenre genre, WordCase aCase, WordAmount amount,
            AdjectiveLevel level)
        {
            AdjectiveWordToken token = new AdjectiveWordToken(null, aCase, genre, amount, level);
            foreach (AdjectiveWordToken tok in irregulars)
                if (tok.Is(token))
                    return tok.Text;

            return null;
        }
Пример #3
0
        public string GetForm(WordCase aCase, WordAmount amount)
        {
            WordToken token = new WordToken(null, aCase, amount);

            foreach (WordToken tok in irregulars)
            {
                if (tok.Is(token))
                {
                    return(tok.Text);
                }
            }

            return(null);
        }
Пример #4
0
        public void SetPostIndex(WordCase aCase, WordAmount amount, int postFixIndex)
        {
            switch (amount)
            {
            case WordAmount.Plural:
            {
                if (postFixIndex > 0)
                {
                    if (pluralPostfixSelector.ContainsKey(aCase))
                    {
                        pluralPostfixSelector[aCase] = postFixIndex;
                    }
                    else
                    {
                        pluralPostfixSelector.Add(aCase, postFixIndex);
                    }
                }
                else
                if (pluralPostfixSelector.ContainsKey(aCase))
                {
                    pluralPostfixSelector.Remove(aCase);
                }

                break;
            }

            case WordAmount.Singular:
            {
                if (postFixIndex > 0)
                {
                    if (singularPostfixSelector.ContainsKey(aCase))
                    {
                        singularPostfixSelector[aCase] = postFixIndex;
                    }
                    else
                    {
                        singularPostfixSelector.Add(aCase, postFixIndex);
                    }
                }
                else
                if (singularPostfixSelector.ContainsKey(aCase))
                {
                    singularPostfixSelector.Remove(aCase);
                }

                break;
            }
            }
        }
Пример #5
0
        public string GetForm(WordGenre genre, WordCase aCase, WordAmount amount,
                              AdjectiveLevel level)
        {
            AdjectiveWordToken token = new AdjectiveWordToken(null, aCase, genre, amount, level);

            foreach (AdjectiveWordToken tok in irregulars)
            {
                if (tok.Is(token))
                {
                    return(tok.Text);
                }
            }

            return(null);
        }
Пример #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        arr = Request.QueryString["Id"].ToString().Split(',');

        try
        {
            if (arr[6].ToString() == "Bank Of Maharashtra")
            {
                ReportDocument cryRpt = new ReportDocument();
                cryRpt.Load(Server.MapPath("MaharashtraBank.rpt"));


                // For Pay
                ParameterFieldDefinitions crParameterFieldDefinitions;
                ParameterFieldDefinition  crParameterFieldDefinition;
                ParameterValues           crParameterValues        = new ParameterValues();
                ParameterDiscreteValue    crParameterDiscreteValue = new ParameterDiscreteValue();

                crParameterDiscreteValue.Value = arr[0];
                crParameterFieldDefinitions    = cryRpt.DataDefinition.ParameterFields;
                crParameterFieldDefinition     = crParameterFieldDefinitions["Pay"];
                crParameterValues = crParameterFieldDefinition.CurrentValues;

                crParameterValues.Clear();
                crParameterValues.Add(crParameterDiscreteValue);
                crParameterFieldDefinition.ApplyCurrentValues(crParameterValues);

                CRPt.ReportSource = cryRpt;

                // For date



                ParameterFieldDefinitions crParameterFieldDefinitions1;
                ParameterFieldDefinition  crParameterFieldDefinition1;
                ParameterValues           crParameterValues1        = new ParameterValues();
                ParameterDiscreteValue    crParameterDiscreteValue1 = new ParameterDiscreteValue();

                crParameterDiscreteValue1.Value = arr[1];
                crParameterFieldDefinitions1    = cryRpt.DataDefinition.ParameterFields;
                crParameterFieldDefinition1     = crParameterFieldDefinitions["Date"];
                crParameterValues1 = crParameterFieldDefinition.CurrentValues;

                crParameterValues1.Clear();
                crParameterValues1.Add(crParameterDiscreteValue1);
                crParameterFieldDefinition1.ApplyCurrentValues(crParameterValues1);

                CRPt.ReportSource = cryRpt;


                // For A/c Pay



                ParameterFieldDefinitions crParameterFieldDefinitions2;
                ParameterFieldDefinition  crParameterFieldDefinition2;
                ParameterValues           crParameterValues2        = new ParameterValues();
                ParameterDiscreteValue    crParameterDiscreteValue2 = new ParameterDiscreteValue();

                crParameterDiscreteValue2.Value = arr[2];
                crParameterFieldDefinitions2    = cryRpt.DataDefinition.ParameterFields;
                crParameterFieldDefinition2     = crParameterFieldDefinitions["A/C Payee"];
                crParameterValues2 = crParameterFieldDefinition.CurrentValues;

                crParameterValues2.Clear();
                crParameterValues2.Add(crParameterDiscreteValue2);
                crParameterFieldDefinition2.ApplyCurrentValues(crParameterValues2);

                CRPt.ReportSource = cryRpt;

                // Amount
                ParameterFieldDefinitions crParameterFieldDefinitions3;
                ParameterFieldDefinition  crParameterFieldDefinition3;
                ParameterValues           crParameterValues3        = new ParameterValues();
                ParameterDiscreteValue    crParameterDiscreteValue3 = new ParameterDiscreteValue();


                crParameterDiscreteValue3.Value = "** " + arr[3] + "/-";
                decimal amt = (decimal)0.00;
                amt = Convert.ToDecimal(arr[3]);
                string w_amt = WordAmount.convertcurrency(amt);
                w_amt = w_amt.Replace("Rupees", "");
                crParameterFieldDefinitions3 = cryRpt.DataDefinition.ParameterFields;
                crParameterFieldDefinition3  = crParameterFieldDefinitions["Amount"];
                crParameterValues3           = crParameterFieldDefinition.CurrentValues;

                crParameterValues3.Clear();
                crParameterValues3.Add(crParameterDiscreteValue3);
                crParameterFieldDefinition3.ApplyCurrentValues(crParameterValues3);

                CRPt.ReportSource = cryRpt;

                // ----- Rupee Symbol ------
                //ParameterFieldDefinitions crParameterFieldDefinitions_Symbol;
                //ParameterFieldDefinition crParameterFieldDefinition_Symbol;
                //ParameterValues crParameterValues_Symbol = new ParameterValues();
                //ParameterDiscreteValue crParameterDiscreteValue_Symbol = new ParameterDiscreteValue();


                //crParameterDiscreteValue3.Value =arr[7];
                //crParameterFieldDefinitions_Symbol = cryRpt.DataDefinition.ParameterFields;
                //crParameterFieldDefinition_Symbol = crParameterFieldDefinitions["R_Symbol"];
                //crParameterValues_Symbol = crParameterFieldDefinition.CurrentValues;

                //crParameterValues_Symbol.Clear();
                //crParameterValues_Symbol.Add(crParameterDiscreteValue_Symbol);
                //crParameterFieldDefinition_Symbol.ApplyCurrentValues(crParameterValues_Symbol);

                //CRPt.ReportSource = cryRpt;

                // End


                ParameterFieldDefinitions crParameterFieldDefinitionsamt;
                ParameterFieldDefinition  crParameterFieldDefinitionamt;
                ParameterValues           crParameterValuesamt        = new ParameterValues();
                ParameterDiscreteValue    crParameterDiscreteValueamt = new ParameterDiscreteValue();

                crParameterDiscreteValueamt.Value = w_amt;

                crParameterFieldDefinitionsamt = cryRpt.DataDefinition.ParameterFields;
                crParameterFieldDefinitionamt  = crParameterFieldDefinitions["WordAmt"];
                crParameterValuesamt           = crParameterFieldDefinition.CurrentValues;

                crParameterValuesamt.Clear();
                crParameterValuesamt.Add(crParameterDiscreteValueamt);
                crParameterFieldDefinitionamt.ApplyCurrentValues(crParameterValuesamt);

                CRPt.ReportSource = cryRpt;



                //  Firm

                ParameterFieldDefinitions crParameterFieldDefinitions4;
                ParameterFieldDefinition  crParameterFieldDefinition4;
                ParameterValues           crParameterValues4        = new ParameterValues();
                ParameterDiscreteValue    crParameterDiscreteValue4 = new ParameterDiscreteValue();

                crParameterDiscreteValue4.Value = arr[4];
                crParameterFieldDefinitions4    = cryRpt.DataDefinition.ParameterFields;
                crParameterFieldDefinition4     = crParameterFieldDefinitions["Firm"];
                crParameterValues4 = crParameterFieldDefinition.CurrentValues;

                crParameterValues4.Clear();
                crParameterValues4.Add(crParameterDiscreteValue4);
                crParameterFieldDefinition4.ApplyCurrentValues(crParameterValues4);

                CRPt.ReportSource = cryRpt;


                // Authotiry


                ParameterFieldDefinitions crParameterFieldDefinitions5;
                ParameterFieldDefinition  crParameterFieldDefinition5;
                ParameterValues           crParameterValues5        = new ParameterValues();
                ParameterDiscreteValue    crParameterDiscreteValue5 = new ParameterDiscreteValue();

                crParameterDiscreteValue5.Value = arr[5];
                crParameterFieldDefinitions5    = cryRpt.DataDefinition.ParameterFields;
                crParameterFieldDefinition5     = crParameterFieldDefinitions["Authority"];
                crParameterValues5 = crParameterFieldDefinition.CurrentValues;

                crParameterValues5.Clear();
                crParameterValues5.Add(crParameterDiscreteValue5);
                crParameterFieldDefinition5.ApplyCurrentValues(crParameterValues5);

                CRPt.ReportSource = cryRpt;
            }

            if (arr[6].ToString() == "Hdfc Bank")
            {
                ReportDocument cryRpt = new ReportDocument();
                cryRpt.Load(Server.MapPath("HDFCBank.rpt"));


                // For Pay
                ParameterFieldDefinitions crParameterFieldDefinitions;
                ParameterFieldDefinition  crParameterFieldDefinition;
                ParameterValues           crParameterValues        = new ParameterValues();
                ParameterDiscreteValue    crParameterDiscreteValue = new ParameterDiscreteValue();

                crParameterDiscreteValue.Value = arr[0];
                crParameterFieldDefinitions    = cryRpt.DataDefinition.ParameterFields;
                crParameterFieldDefinition     = crParameterFieldDefinitions["Pay"];
                crParameterValues = crParameterFieldDefinition.CurrentValues;

                crParameterValues.Clear();
                crParameterValues.Add(crParameterDiscreteValue);
                crParameterFieldDefinition.ApplyCurrentValues(crParameterValues);

                CRPt.ReportSource = cryRpt;

                // For date



                ParameterFieldDefinitions crParameterFieldDefinitions1;
                ParameterFieldDefinition  crParameterFieldDefinition1;
                ParameterValues           crParameterValues1        = new ParameterValues();
                ParameterDiscreteValue    crParameterDiscreteValue1 = new ParameterDiscreteValue();

                crParameterDiscreteValue1.Value = arr[1];
                crParameterFieldDefinitions1    = cryRpt.DataDefinition.ParameterFields;
                crParameterFieldDefinition1     = crParameterFieldDefinitions["Date"];
                crParameterValues1 = crParameterFieldDefinition.CurrentValues;

                crParameterValues1.Clear();
                crParameterValues1.Add(crParameterDiscreteValue1);
                crParameterFieldDefinition1.ApplyCurrentValues(crParameterValues1);

                CRPt.ReportSource = cryRpt;


                // For A/c Pay



                ParameterFieldDefinitions crParameterFieldDefinitions2;
                ParameterFieldDefinition  crParameterFieldDefinition2;
                ParameterValues           crParameterValues2        = new ParameterValues();
                ParameterDiscreteValue    crParameterDiscreteValue2 = new ParameterDiscreteValue();

                crParameterDiscreteValue2.Value = arr[2];
                crParameterFieldDefinitions2    = cryRpt.DataDefinition.ParameterFields;
                crParameterFieldDefinition2     = crParameterFieldDefinitions["A/C Payee"];
                crParameterValues2 = crParameterFieldDefinition.CurrentValues;

                crParameterValues2.Clear();
                crParameterValues2.Add(crParameterDiscreteValue2);
                crParameterFieldDefinition2.ApplyCurrentValues(crParameterValues2);

                CRPt.ReportSource = cryRpt;

                // Amount



                ParameterFieldDefinitions crParameterFieldDefinitions3;
                ParameterFieldDefinition  crParameterFieldDefinition3;
                ParameterValues           crParameterValues3        = new ParameterValues();
                ParameterDiscreteValue    crParameterDiscreteValue3 = new ParameterDiscreteValue();


                crParameterDiscreteValue3.Value = "** " + arr[3] + "/-";
                decimal amt = (decimal)0.00;
                amt = Convert.ToDecimal(arr[3]);
                string w_amt = WordAmount.convertcurrency(amt);
                w_amt = w_amt.Replace("Rupees", "");
                crParameterFieldDefinitions3 = cryRpt.DataDefinition.ParameterFields;
                crParameterFieldDefinition3  = crParameterFieldDefinitions["Amount"];
                crParameterValues3           = crParameterFieldDefinition.CurrentValues;

                crParameterValues3.Clear();
                crParameterValues3.Add(crParameterDiscreteValue3);
                crParameterFieldDefinition3.ApplyCurrentValues(crParameterValues3);

                CRPt.ReportSource = cryRpt;

                // ------- Rupee Symbol ----------
                //ParameterFieldDefinitions crParameterFieldDefinitions_Symbol;
                //ParameterFieldDefinition crParameterFieldDefinition_Symbol;
                //ParameterValues crParameterValues_Symbol = new ParameterValues();
                //ParameterDiscreteValue crParameterDiscreteValue_Symbol = new ParameterDiscreteValue();


                //crParameterDiscreteValue_Symbol.Value = arr[7];

                //crParameterFieldDefinitions_Symbol = cryRpt.DataDefinition.ParameterFields;
                //crParameterFieldDefinition_Symbol = crParameterFieldDefinitions["R_Symbol"];
                //crParameterValues_Symbol = crParameterFieldDefinition.CurrentValues;

                //crParameterValues_Symbol.Clear();
                //crParameterValues_Symbol.Add(crParameterDiscreteValue3);
                //crParameterFieldDefinition_Symbol.ApplyCurrentValues(crParameterValues3);

                //CRPt.ReportSource = cryRpt;

                // Number To word


                ParameterFieldDefinitions crParameterFieldDefinitionsamt;
                ParameterFieldDefinition  crParameterFieldDefinitionamt;
                ParameterValues           crParameterValuesamt        = new ParameterValues();
                ParameterDiscreteValue    crParameterDiscreteValueamt = new ParameterDiscreteValue();

                crParameterDiscreteValueamt.Value = w_amt;

                crParameterFieldDefinitionsamt = cryRpt.DataDefinition.ParameterFields;
                crParameterFieldDefinitionamt  = crParameterFieldDefinitions["WordAmt"];
                crParameterValuesamt           = crParameterFieldDefinition.CurrentValues;

                crParameterValuesamt.Clear();
                crParameterValuesamt.Add(crParameterDiscreteValueamt);
                crParameterFieldDefinitionamt.ApplyCurrentValues(crParameterValuesamt);

                CRPt.ReportSource = cryRpt;



                //  Firm

                ParameterFieldDefinitions crParameterFieldDefinitions4;
                ParameterFieldDefinition  crParameterFieldDefinition4;
                ParameterValues           crParameterValues4        = new ParameterValues();
                ParameterDiscreteValue    crParameterDiscreteValue4 = new ParameterDiscreteValue();

                crParameterDiscreteValue4.Value = arr[4];
                crParameterFieldDefinitions4    = cryRpt.DataDefinition.ParameterFields;
                crParameterFieldDefinition4     = crParameterFieldDefinitions["Firm"];
                crParameterValues4 = crParameterFieldDefinition.CurrentValues;

                crParameterValues4.Clear();
                crParameterValues4.Add(crParameterDiscreteValue4);
                crParameterFieldDefinition4.ApplyCurrentValues(crParameterValues4);

                CRPt.ReportSource = cryRpt;


                // Authotiry


                ParameterFieldDefinitions crParameterFieldDefinitions5;
                ParameterFieldDefinition  crParameterFieldDefinition5;
                ParameterValues           crParameterValues5        = new ParameterValues();
                ParameterDiscreteValue    crParameterDiscreteValue5 = new ParameterDiscreteValue();

                crParameterDiscreteValue5.Value = arr[5];
                crParameterFieldDefinitions5    = cryRpt.DataDefinition.ParameterFields;
                crParameterFieldDefinition5     = crParameterFieldDefinitions["Authority"];
                crParameterValues5 = crParameterFieldDefinition.CurrentValues;

                crParameterValues5.Clear();
                crParameterValues5.Add(crParameterDiscreteValue5);
                crParameterFieldDefinition5.ApplyCurrentValues(crParameterValues5);

                CRPt.ReportSource = cryRpt;
            }

            if (arr[6].ToString() == "Saraswat Bank")
            {
                ReportDocument cryRpt = new ReportDocument();
                cryRpt.Load(Server.MapPath("SaraswatBank.rpt"));


                // For Pay
                ParameterFieldDefinitions crParameterFieldDefinitions;
                ParameterFieldDefinition  crParameterFieldDefinition;
                ParameterValues           crParameterValues        = new ParameterValues();
                ParameterDiscreteValue    crParameterDiscreteValue = new ParameterDiscreteValue();

                crParameterDiscreteValue.Value = arr[0];
                crParameterFieldDefinitions    = cryRpt.DataDefinition.ParameterFields;
                crParameterFieldDefinition     = crParameterFieldDefinitions["Pay"];
                crParameterValues = crParameterFieldDefinition.CurrentValues;

                crParameterValues.Clear();
                crParameterValues.Add(crParameterDiscreteValue);
                crParameterFieldDefinition.ApplyCurrentValues(crParameterValues);

                CRPt.ReportSource = cryRpt;

                // For date



                ParameterFieldDefinitions crParameterFieldDefinitions1;
                ParameterFieldDefinition  crParameterFieldDefinition1;
                ParameterValues           crParameterValues1        = new ParameterValues();
                ParameterDiscreteValue    crParameterDiscreteValue1 = new ParameterDiscreteValue();

                crParameterDiscreteValue1.Value = arr[1];
                crParameterFieldDefinitions1    = cryRpt.DataDefinition.ParameterFields;
                crParameterFieldDefinition1     = crParameterFieldDefinitions["Date"];
                crParameterValues1 = crParameterFieldDefinition.CurrentValues;

                crParameterValues1.Clear();
                crParameterValues1.Add(crParameterDiscreteValue1);
                crParameterFieldDefinition1.ApplyCurrentValues(crParameterValues1);

                CRPt.ReportSource = cryRpt;


                // For A/c Pay



                ParameterFieldDefinitions crParameterFieldDefinitions2;
                ParameterFieldDefinition  crParameterFieldDefinition2;
                ParameterValues           crParameterValues2        = new ParameterValues();
                ParameterDiscreteValue    crParameterDiscreteValue2 = new ParameterDiscreteValue();

                crParameterDiscreteValue2.Value = arr[2];
                crParameterFieldDefinitions2    = cryRpt.DataDefinition.ParameterFields;
                crParameterFieldDefinition2     = crParameterFieldDefinitions["A/C Payee"];
                crParameterValues2 = crParameterFieldDefinition.CurrentValues;

                crParameterValues2.Clear();
                crParameterValues2.Add(crParameterDiscreteValue2);
                crParameterFieldDefinition2.ApplyCurrentValues(crParameterValues2);

                CRPt.ReportSource = cryRpt;

                // Amount



                ParameterFieldDefinitions crParameterFieldDefinitions3;
                ParameterFieldDefinition  crParameterFieldDefinition3;
                ParameterValues           crParameterValues3        = new ParameterValues();
                ParameterDiscreteValue    crParameterDiscreteValue3 = new ParameterDiscreteValue();


                crParameterDiscreteValue3.Value = "** " + arr[3] + "/-";
                decimal amt = (decimal)0.00;
                amt = Convert.ToDecimal(arr[3]);
                string w_amt = WordAmount.convertcurrency(amt);
                w_amt = w_amt.Replace("Rupees", "");
                crParameterFieldDefinitions3 = cryRpt.DataDefinition.ParameterFields;
                crParameterFieldDefinition3  = crParameterFieldDefinitions["Amount"];
                crParameterValues3           = crParameterFieldDefinition.CurrentValues;

                crParameterValues3.Clear();
                crParameterValues3.Add(crParameterDiscreteValue3);
                crParameterFieldDefinition3.ApplyCurrentValues(crParameterValues3);

                CRPt.ReportSource = cryRpt;

                ////// ------- Rupee Symbol ----------



                //ParameterFieldDefinitions crParameterFieldDefinitions_Symbol;
                //ParameterFieldDefinition crParameterFieldDefinition_Symbol;
                //ParameterValues crParameterValues_Symbol = new ParameterValues();
                //ParameterDiscreteValue crParameterDiscreteValue_Symbol = new ParameterDiscreteValue();


                //crParameterDiscreteValue_Symbol.Value = arr[7];
                //crParameterFieldDefinitions_Symbol = cryRpt.DataDefinition.ParameterFields;
                //crParameterFieldDefinition_Symbol = crParameterFieldDefinitions["R_Symbol"];
                //crParameterValues_Symbol = crParameterFieldDefinition.CurrentValues;

                //crParameterValues_Symbol.Clear();
                //crParameterValues_Symbol.Add(crParameterDiscreteValue_Symbol);
                //crParameterFieldDefinition_Symbol.ApplyCurrentValues(crParameterValues_Symbol);

                //CRPt.ReportSource = cryRpt;

                // Number To word


                ParameterFieldDefinitions crParameterFieldDefinitionsamt;
                ParameterFieldDefinition  crParameterFieldDefinitionamt;
                ParameterValues           crParameterValuesamt        = new ParameterValues();
                ParameterDiscreteValue    crParameterDiscreteValueamt = new ParameterDiscreteValue();

                crParameterDiscreteValueamt.Value = w_amt;

                crParameterFieldDefinitionsamt = cryRpt.DataDefinition.ParameterFields;
                crParameterFieldDefinitionamt  = crParameterFieldDefinitions["WordAmt"];
                crParameterValuesamt           = crParameterFieldDefinition.CurrentValues;

                crParameterValuesamt.Clear();
                crParameterValuesamt.Add(crParameterDiscreteValueamt);
                crParameterFieldDefinitionamt.ApplyCurrentValues(crParameterValuesamt);

                CRPt.ReportSource = cryRpt;



                //  Firm

                ParameterFieldDefinitions crParameterFieldDefinitions4;
                ParameterFieldDefinition  crParameterFieldDefinition4;
                ParameterValues           crParameterValues4        = new ParameterValues();
                ParameterDiscreteValue    crParameterDiscreteValue4 = new ParameterDiscreteValue();

                crParameterDiscreteValue4.Value = arr[4];
                crParameterFieldDefinitions4    = cryRpt.DataDefinition.ParameterFields;
                crParameterFieldDefinition4     = crParameterFieldDefinitions["Firm"];
                crParameterValues4 = crParameterFieldDefinition.CurrentValues;

                crParameterValues4.Clear();
                crParameterValues4.Add(crParameterDiscreteValue4);
                crParameterFieldDefinition4.ApplyCurrentValues(crParameterValues4);

                CRPt.ReportSource = cryRpt;


                // Authotiry


                ParameterFieldDefinitions crParameterFieldDefinitions5;
                ParameterFieldDefinition  crParameterFieldDefinition5;
                ParameterValues           crParameterValues5        = new ParameterValues();
                ParameterDiscreteValue    crParameterDiscreteValue5 = new ParameterDiscreteValue();

                crParameterDiscreteValue5.Value = arr[5];
                crParameterFieldDefinitions5    = cryRpt.DataDefinition.ParameterFields;
                crParameterFieldDefinition5     = crParameterFieldDefinitions["Authority"];
                crParameterValues5 = crParameterFieldDefinition.CurrentValues;

                crParameterValues5.Clear();
                crParameterValues5.Add(crParameterDiscreteValue5);
                crParameterFieldDefinition5.ApplyCurrentValues(crParameterValues5);

                CRPt.ReportSource = cryRpt;
            }



            if (arr[6].ToString() == "Bank of India")
            {
                ReportDocument cryRpt = new ReportDocument();
                cryRpt.Load(Server.MapPath("BankofIndia.rpt"));


                // For Pay
                ParameterFieldDefinitions crParameterFieldDefinitions;
                ParameterFieldDefinition  crParameterFieldDefinition;
                ParameterValues           crParameterValues        = new ParameterValues();
                ParameterDiscreteValue    crParameterDiscreteValue = new ParameterDiscreteValue();

                crParameterDiscreteValue.Value = arr[0];
                crParameterFieldDefinitions    = cryRpt.DataDefinition.ParameterFields;
                crParameterFieldDefinition     = crParameterFieldDefinitions["Pay"];
                crParameterValues = crParameterFieldDefinition.CurrentValues;

                crParameterValues.Clear();
                crParameterValues.Add(crParameterDiscreteValue);
                crParameterFieldDefinition.ApplyCurrentValues(crParameterValues);

                CRPt.ReportSource = cryRpt;

                // For date



                ParameterFieldDefinitions crParameterFieldDefinitions1;
                ParameterFieldDefinition  crParameterFieldDefinition1;
                ParameterValues           crParameterValues1        = new ParameterValues();
                ParameterDiscreteValue    crParameterDiscreteValue1 = new ParameterDiscreteValue();

                crParameterDiscreteValue1.Value = arr[1];
                crParameterFieldDefinitions1    = cryRpt.DataDefinition.ParameterFields;
                crParameterFieldDefinition1     = crParameterFieldDefinitions["Date"];
                crParameterValues1 = crParameterFieldDefinition.CurrentValues;

                crParameterValues1.Clear();
                crParameterValues1.Add(crParameterDiscreteValue1);
                crParameterFieldDefinition1.ApplyCurrentValues(crParameterValues1);

                CRPt.ReportSource = cryRpt;


                // For A/c Pay



                ParameterFieldDefinitions crParameterFieldDefinitions2;
                ParameterFieldDefinition  crParameterFieldDefinition2;
                ParameterValues           crParameterValues2        = new ParameterValues();
                ParameterDiscreteValue    crParameterDiscreteValue2 = new ParameterDiscreteValue();

                crParameterDiscreteValue2.Value = arr[2];
                crParameterFieldDefinitions2    = cryRpt.DataDefinition.ParameterFields;
                crParameterFieldDefinition2     = crParameterFieldDefinitions["A/C Payee"];
                crParameterValues2 = crParameterFieldDefinition.CurrentValues;

                crParameterValues2.Clear();
                crParameterValues2.Add(crParameterDiscreteValue2);
                crParameterFieldDefinition2.ApplyCurrentValues(crParameterValues2);

                CRPt.ReportSource = cryRpt;

                // Amount



                ParameterFieldDefinitions crParameterFieldDefinitions3;
                ParameterFieldDefinition  crParameterFieldDefinition3;
                ParameterValues           crParameterValues3        = new ParameterValues();
                ParameterDiscreteValue    crParameterDiscreteValue3 = new ParameterDiscreteValue();


                crParameterDiscreteValue3.Value = "** " + arr[3] + "/-";
                decimal amt = (decimal)0.00;
                amt = Convert.ToDecimal(arr[3]);
                string w_amt = WordAmount.convertcurrency(amt);
                w_amt = w_amt.Replace("Rupees", "");
                crParameterFieldDefinitions3 = cryRpt.DataDefinition.ParameterFields;
                crParameterFieldDefinition3  = crParameterFieldDefinitions["Amount"];
                crParameterValues3           = crParameterFieldDefinition.CurrentValues;

                crParameterValues3.Clear();
                crParameterValues3.Add(crParameterDiscreteValue3);
                crParameterFieldDefinition3.ApplyCurrentValues(crParameterValues3);

                CRPt.ReportSource = cryRpt;

                // Number To word


                ParameterFieldDefinitions crParameterFieldDefinitionsamt;
                ParameterFieldDefinition  crParameterFieldDefinitionamt;
                ParameterValues           crParameterValuesamt        = new ParameterValues();
                ParameterDiscreteValue    crParameterDiscreteValueamt = new ParameterDiscreteValue();

                crParameterDiscreteValueamt.Value = w_amt;

                crParameterFieldDefinitionsamt = cryRpt.DataDefinition.ParameterFields;
                crParameterFieldDefinitionamt  = crParameterFieldDefinitions["WordAmt"];
                crParameterValuesamt           = crParameterFieldDefinition.CurrentValues;

                crParameterValuesamt.Clear();
                crParameterValuesamt.Add(crParameterDiscreteValueamt);
                crParameterFieldDefinitionamt.ApplyCurrentValues(crParameterValuesamt);

                CRPt.ReportSource = cryRpt;



                //  Firm

                ParameterFieldDefinitions crParameterFieldDefinitions4;
                ParameterFieldDefinition  crParameterFieldDefinition4;
                ParameterValues           crParameterValues4        = new ParameterValues();
                ParameterDiscreteValue    crParameterDiscreteValue4 = new ParameterDiscreteValue();

                crParameterDiscreteValue4.Value = arr[4];
                crParameterFieldDefinitions4    = cryRpt.DataDefinition.ParameterFields;
                crParameterFieldDefinition4     = crParameterFieldDefinitions["Firm"];
                crParameterValues4 = crParameterFieldDefinition.CurrentValues;

                crParameterValues4.Clear();
                crParameterValues4.Add(crParameterDiscreteValue4);
                crParameterFieldDefinition4.ApplyCurrentValues(crParameterValues4);

                CRPt.ReportSource = cryRpt;


                // Authotiry


                ParameterFieldDefinitions crParameterFieldDefinitions5;
                ParameterFieldDefinition  crParameterFieldDefinition5;
                ParameterValues           crParameterValues5        = new ParameterValues();
                ParameterDiscreteValue    crParameterDiscreteValue5 = new ParameterDiscreteValue();

                crParameterDiscreteValue5.Value = arr[5];
                crParameterFieldDefinitions5    = cryRpt.DataDefinition.ParameterFields;
                crParameterFieldDefinition5     = crParameterFieldDefinitions["Authority"];
                crParameterValues5 = crParameterFieldDefinition.CurrentValues;

                crParameterValues5.Clear();
                crParameterValues5.Add(crParameterDiscreteValue5);
                crParameterFieldDefinition5.ApplyCurrentValues(crParameterValues5);

                CRPt.ReportSource = cryRpt;
            }
        }

        catch { }
    }
Пример #7
0
        public bool AnalyzeLine(string line)
        {
            this.irregulars.Clear();
            this.categories.Clear();
            this.singularPostfixSelector.Clear();
            this.pluralPostfixSelector.Clear();

            if (!string.IsNullOrEmpty(line))
            {
                string[] elements = line.Split('|');
                this.root = elements[0];    // always will be at last one element in nonempty string

                if (elements.Length > 1)
                {
                    for (int i = 1; i < elements.Length; i++)
                    {
                        string str = elements[i];
                        if (string.IsNullOrEmpty(str))
                        {
                            continue;
                        }

                        switch (str[0])
                        {
                            #region Nondeclinative item

                        case '#':
                        {
                            this.IsConstant = true;
                            break;
                        }

                            #endregion

                            #region Main Data

                        case '!':
                        {
                            if (str.Length > 1)
                            {
                                this.genre = EnumHelper.GetWordGenre(str[1]);
                                // TODO: read more details
                                if (str.Length > 3)
                                {
                                    this.declinationType = str.Substring(2, 2);
                                }
                            }
                            else
                            {
                                // err
                                return(false);
                            }

                            break;
                        }

                        case '*':
                        {
                            if (str.Length > 1)
                            {
                                this.IrregularGenre = EnumHelper.GetWordGenre(str[1]);
                                // TODO: read more details
                                this.HasIrregularGenre = this.irrGenre != WordGenre._Unknown;
                            }
                            else
                            {
                                // err
                                return(false);
                            }

                            break;
                        }


                        case '@':
                        {
                            if (str.Length > 1)
                            {
                                // take root for other cases then Nominative
                                this.rootOther = str.Substring(1);
                            }
                            else
                            {
                                // err
                                return(false);
                            }

                            break;
                        }

                        case '+':
                        {
                            if (str.Length > 2)
                            {
                                // Specifies other than first index is used
                                WordAmount amount       = EnumHelper.GetWordAmount(str[1]);
                                WordCase   aCase        = EnumHelper.GetWordCase(str[2]);
                                int        postFixIndex = int.Parse(str.Substring(3));

                                switch (amount)
                                {
                                case WordAmount.Singular:
                                {
                                    if (!singularPostfixSelector.ContainsKey(aCase))
                                    {
                                        singularPostfixSelector.Add(aCase, postFixIndex);
                                    }
                                    else
                                    {
                                        singularPostfixSelector[aCase] = postFixIndex;
                                    }
                                    break;
                                }

                                case WordAmount.Plural:
                                {
                                    if (!pluralPostfixSelector.ContainsKey(aCase))
                                    {
                                        pluralPostfixSelector.Add(aCase, postFixIndex);
                                    }
                                    else
                                    {
                                        pluralPostfixSelector[aCase] = postFixIndex;
                                    }
                                    break;
                                }
                                }
                            }
                            else
                            {
                                // err
                                return(false);
                            }

                            break;
                        }
                            #endregion

                            #region Exception Cases

                        case '%':
                        {
                            if (str.Length > 3)
                            {
                                this.IsException = true;
                                WordCase   aCase  = EnumHelper.GetWordCase(str[1]);
                                WordAmount amount = EnumHelper.GetWordAmount(str[2]);
                                string     txt    = str.Substring(3);

                                WordToken token = new
                                                  WordToken(txt, aCase, amount);
                                this.irregulars.Add(token);
                            }
                            else
                            {
                                // err
                                return(false);
                            }

                            break;
                        }

                        case '^':
                        {
                            if (str.Length == 2)
                            {
                                // only singular/plural word - no sense meaning or grammar
                                WordAmount amount = EnumHelper.GetWordAmount(str[1]);
                                if (amount == WordAmount.Plural)
                                {
                                    this.canBePlural = false;
                                }
                                else if (amount == WordAmount.Singular)
                                {
                                    this.canBeSingular = false;
                                }
                            }
                            else
                            {
                                // err
                                return(false);
                            }

                            break;
                        }

                            #endregion

                            #region Categories

                        case '$':
                        {
                            string cats = str.Substring(1);
                            categories.Clear();
                            if (!string.IsNullOrEmpty(cats))
                            {
                                string[] arr = cats.Split(',');
                                foreach (string catId in arr)
                                {
                                    int id = int.Parse(catId);

                                    if (!categories.Contains(id))
                                    {
                                        categories.Add(id);
                                    }
                                }
                            }

                            break;
                        }

                            #endregion
                        }
                    }
                }

                // check all data is specified
                if (this.genre == WordGenre._Unknown)
                {
                    return(false);
                }

                return(true);
            }

            return(false);
        }
Пример #8
0
 private void AmtInWrd()
 {
     Amt               = Convert.ToDecimal(txtDrAmt.Text);
     TotalAmt          = WordAmount.convertcurrency(Amt);
     txtAmtInWrds.Text = TotalAmt.ToString();
 }
Пример #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            EditModeId = Convert.ToInt32(Request.QueryString["ID"]);
            OpenForm   = Convert.ToString(Request.QueryString["Flag"]);

            switch (OpenForm)
            {
            //Purchase Order details
            case "PS":
            {
                DMPurchaseOrder oDMPurchaseOrder = new DMPurchaseOrder();
                dsLogin = oDMPurchaseOrder.PrintPOReport_SupplierWise(EditModeId, out strError);
                dsLogin.Tables[0].TableName = "PurchaseOrder_Master";
                //dsLogin.Tables[1].TableName = "PurchaseOrder_Details";
                //-------------------------------------------
                if (dsLogin.Tables.Count > 0)
                {
                    for (int i = 0; i < dsLogin.Tables[0].Rows.Count; i++)
                    {
                        pric += Convert.ToDecimal(dsLogin.Tables[0].Rows[i]["NetAmount"].ToString());
                    }
                }
                TotAmt = WordAmount.convertcurrency(pric);
                DataColumn column = new DataColumn("Number2Word");
                column.DataType = typeof(string);
                dsLogin.Tables[0].Columns.Add("Number2Word");

                dsLogin.Tables[0].Rows[dsLogin.Tables[0].Rows.Count - 1]["Number2Word"] = TotAmt.ToString();
                //-------------------------------------------
                CRpt.Load(Server.MapPath("~/PrintReport/PurchaseOrder/PurchaseOrder_SupplierWise.rpt"));
                CRpt.SetDataSource(dsLogin);
                break;
            }

            //Authorised Purchase Order
            case "PO":
            {
                DMPurchaseOrder oDMPurchaseOrder = new DMPurchaseOrder();
                dsLogin = oDMPurchaseOrder.PrintPOReport_SupplierWise(EditModeId, out strError);
                dsLogin.Tables[0].TableName = "PurchaseOrder_Master";
                //dsLogin.Tables[1].TableName = "PurchaseOrder_Details";
                //-------------------------------------------
                if (dsLogin.Tables.Count > 0)
                {
                    for (int i = 0; i < dsLogin.Tables[0].Rows.Count; i++)
                    {
                        pric += Convert.ToDecimal(dsLogin.Tables[0].Rows[i]["NetAmount"].ToString());
                    }
                }
                TotAmt = WordAmount.convertcurrency(pric);
                DataColumn column = new DataColumn("Number2Word");
                column.DataType = typeof(string);
                dsLogin.Tables[0].Columns.Add("Number2Word");

                dsLogin.Tables[0].Rows[dsLogin.Tables[0].Rows.Count - 1]["Number2Word"] = TotAmt.ToString();
                //-------------------------------------------
                CRpt.Load(Server.MapPath("~/PrintReport/PurchaseOrder/Authorized PurchaseOrder.rpt"));
                CRpt.SetDataSource(dsLogin);
                break;
            }
            }

            CrystalReportViewer1.ReportSource = CRpt;
            CrystalReportViewer1.DataBind();
            CrystalReportViewer1.DisplayToolbar = true;
        }
        catch (Exception ex)
        {
        }
    }
Пример #10
0
    private void PrintReport()
    {
        try
        {
            Flag                 = Convert.ToString(Request.QueryString["Flag"]).Trim();
            CheckCondition       = Convert.ToString(Request.QueryString["Cond"]);
            CheckConditionFilter = string.IsNullOrEmpty(Convert.ToString(Request.QueryString["CondFilter"])) ? "" : Convert.ToString(Request.QueryString["CondFilter"]);

            switch (Flag)
            {
                //Enquiry Details
                #region [Payment Voucher]
            case "PaymentVoucher":
            {
                ID  = Convert.ToInt32(Request.QueryString["ID"]);
                DS  = Obj_payment.GetPaymentVoucher(ID, out strError);
                PDF = Request.QueryString["Flag"].ToString();

                if (DS.Tables.Count > 0 && DS.Tables[0].Rows.Count > 0)
                {
                    //----------------
                    DataColumn column = new DataColumn("PrintCondition");
                    column.DataType = typeof(string);
                    DS.Tables[0].Columns.Add("PrintCondition");

                    //Add Flag in Each Row
                    for (int i = 0; i < DS.Tables[0].Rows.Count; i++)
                    {
                        DS.Tables[0].Rows[i]["PrintCondition"] = Flag.ToString();
                        string     TotAmt  = WordAmount.convertcurrency(Convert.ToDecimal(DS.Tables[0].Rows[0]["VoucherAmount"].ToString()));
                        DataColumn column1 = new DataColumn("Number2Word");
                        column1.DataType = typeof(string);
                        DS.Tables[0].Columns.Add("Number2Word");
                        DS.Tables[0].Rows[DS.Tables[0].Rows.Count - 1]["Number2Word"] = TotAmt.ToString();
                    }

                    DS.Tables[0].TableName = "PaymentVoucher";
                    DS.Tables[1].TableName = "CompanyDetails";
                    DS.Tables[2].TableName = "PaymentDetail";


                    if (Convert.ToBoolean(DS.Tables[0].Rows[0]["IsReference"]))
                    {
                        if ((Request.QueryString["PDFFlag"].ToString()) == "NOPDF")
                        {
                            CRpt.Load(Server.MapPath("~/PrintAccReport/CryRptPaymentVoucher.rpt"));
                            CRpt.SetDataSource(DS);
                            CRPrint.ReportSource = CRpt;
                            CRPrint.DataBind();
                            CRPrint.DisplayToolbar = true;
                            DS = null;
                        }
                        else
                        {
                            CRpt.Load(Server.MapPath("~/PrintAccReport/CryRptPaymentVoucher.rpt"));
                            CRpt.SetDataSource(DS);
                            PDFMaster = Server.MapPath(@"~/TempFiles/" + "PaymentVoucher - " + (DateTime.Now).ToString("dd-MMM-yyyy") + ".pdf");
                            CRpt.ExportToDisk(ExportFormatType.PortableDocFormat, PDFMaster);
                            Response.Redirect("../CrystalPrint/ShowPDF.aspx?Id=" + PDFMaster);
                        }
                    }
                    else
                    {
                        if ((Request.QueryString["PDFFlag"].ToString()) == "NOPDF")
                        {
                            CRpt.Load(Server.MapPath("~/PrintAccReport/CryRptPaymentVoucherWithoutDetail.rpt"));
                            CRpt.SetDataSource(DS);
                            CRPrint.ReportSource = CRpt;
                            CRPrint.DataBind();
                            CRPrint.DisplayToolbar = true;
                            DS = null;
                        }
                        else
                        {
                            CRpt.Load(Server.MapPath("~/PrintAccReport/CryRptPaymentVoucherWithoutDetail.rpt"));
                            CRpt.SetDataSource(DS);
                            PDFMaster = Server.MapPath(@"~/TempFiles/" + "PaymentVoucher - " + (DateTime.Now).ToString("dd-MMM-yyyy") + ".pdf");
                            CRpt.ExportToDisk(ExportFormatType.PortableDocFormat, PDFMaster);
                            Response.Redirect("../CrystalPrint/ShowPDF.aspx?Id=" + PDFMaster);
                        }
                    }
                    //------- Add New Code For Print-----
                    if (Print_Flag != 0)
                    {
                        //CRpt.PrintOptions.PrinterName = "Send To OneNote 2007";
                        //  CRpt.PrintToPrinter(1, false, 0, 0);
                    }
                    //------- Add New Code For Print-----
                }
                break;
            }
                #endregion

                #region [1st Grid for Creditors]
            case "SundryCreditorsGroupSummary":
            {
                LedgerCond = Convert.ToString(Request.QueryString["LedgerId"]).Trim();
                if (LedgerCond == "25")
                {
                    DS = obj_SundryLedger.Getdetails(LedgerCond, CheckCondition, out strError);
                    this.Page.Title = "Print-SundryCreditors";
                }
                else
                {
                    //DS = obj_SundryLedger.GetdetailsD(LedgerCond, CheckCondition, out strError);
                    //this.Page.Title = "Print-SundryDebtors";
                }

                if (DS.Tables.Count > 0 && DS.Tables[0].Rows.Count > 0)
                {
                    //New DataColumn(FilterCondition)By Gayatri 13 June 2013----------------
                    DataColumn column = new DataColumn("FilterCondition");
                    column.DataType = typeof(string);
                    DS.Tables[0].Columns.Add("FilterCondition");
                    //DS.Tables[0].Rows[0]["FilterCondition"] = CheckConditionFilter.ToString();

                    //New DataColumn(RowCount)By Gayatri 26 June 2013----------------

                    DataColumn columnR = new DataColumn("RowCount");
                    columnR.DataType = typeof(string);
                    DS.Tables[0].Columns.Add("RowCount");

                    //End DataColumn(RowCount)-----------------

                    for (int i = 0; i < DS.Tables[0].Rows.Count; i++)
                    {
                        DS.Tables[0].Rows[i]["FilterCondition"] = CheckConditionFilter.ToString();
                        DS.Tables[0].Rows[i]["RowCount"]        = DS.Tables[0].Rows.Count + " Record(s) Found!!";
                    }

                    DS.Tables[0].TableName = "SundryCreditorsGroupSummary";
                    DataColumn column1 = new DataColumn("ForName", typeof(string));
                    DS.Tables[0].Columns.Add("ForName");
                    DataColumn column2 = new DataColumn("Name", typeof(string));
                    DS.Tables[0].Columns.Add("Name");
                    DataColumn column3 = new DataColumn("FromDate", typeof(string));
                    DS.Tables[0].Columns.Add("FromDate");
                    DataColumn column4 = new DataColumn("ToDate", typeof(string));
                    DS.Tables[0].Columns.Add("ToDate");
                    if (Convert.ToInt32(LedgerCond) == 25)
                    {
                        DS.Tables[0].Rows[0]["ForName"] = "Sundry Creditors";
                    }
                    else
                    {
                        DS.Tables[0].Rows[0]["ForName"] = "Sundry Debtors";
                    }

                    string[] d = Convert.ToString((Session["LedgerDate"])).Split('*');
                    DS.Tables[0].Rows[0]["FromDate"] = Convert.ToDateTime(d[0]).ToString("dd-MMM-yyyy");
                    DS.Tables[0].Rows[0]["ToDate"]   = Convert.ToDateTime(d[1]).ToString("dd-MMM-yyyy");

                    DS.Tables[0].Rows[0]["Name"] = "KARIA " + Convert.ToString(Request.QueryString["FY"]).Trim() + " - " + Convert.ToString(Request.QueryString["EY"]).Trim();
                    DS.Tables[0].TableName       = "SundryCreditorsGroupSummary";
                    DS.Tables[1].TableName       = "CompanyDetails";
                    CRpt.Load(Server.MapPath("~/PrintAccReport/CryRptSundryCreditors.rpt"));
                    CRpt.SetDataSource(DS);
                    CRPrint.ReportSource = CRpt;
                    CRPrint.DataBind();
                    CRPrint.DisplayToolbar = true;
                }
                break;
            }
                #endregion

                #region [2nd Grid For Creditors]
            case "SundryCreditorsLedgerMonthlySummary":
            {
                //StrCondition = string.Empty;
                string  StDate  = string.Empty;
                string  EdDate  = string.Empty;
                string  RepCond = string.Empty;
                int     NoOfMonths;
                DataSet DSOpeningBal = new DataSet();
                RepCond      = Convert.ToString(Request.QueryString["LedgerId"]).Trim();
                StrCondition = StrCondition + "AND VoucherDate<= '" + Convert.ToDateTime(Session["FromDate"]).ToString("MM-dd-yyyy") + "' ";
                DataTable DTLedger = new DataTable();
                DataRow   dr       = null;
                DTLedger.Columns.Add(new DataColumn("#", typeof(int)));
                DTLedger.Columns.Add(new DataColumn("Particulars", typeof(string)));
                DTLedger.Columns.Add(new DataColumn("Debit", typeof(string)));
                DTLedger.Columns.Add(new DataColumn("Credit", typeof(string)));
                DTLedger.Columns.Add(new DataColumn("Closing1", typeof(string)));
                DTLedger.Columns.Add(new DataColumn("Closing", typeof(string)));
                DTLedger.Columns.Add(new DataColumn("ForMonth", typeof(string)));
                DTLedger.Columns.Add(new DataColumn("LedgerID", typeof(string)));
                dr = DTLedger.NewRow();
                //if (Convert.ToString(Request.QueryString["ID"]).Trim() == "25")
                //{
                DSOpeningBal = obj_SundryLedger.FindOpeningBal(RepCond, StrCondition, out strError);
                //}
                //else
                //{
                //     DSOpeningBal = obj_SundryLedger.FindOpeningBalDebtor(RepCond, StrCondition, out strError);
                //}
                //-----Set Opening Balance-----
                if (DSOpeningBal.Tables.Count > 0 && DSOpeningBal.Tables[0].Rows.Count > 0)
                {
                    dr["#"]           = 0;
                    dr["Particulars"] = "Opening balance";
                    dr["Debit"]       = Convert.ToDecimal(DSOpeningBal.Tables[0].Rows[0]["Debit"].ToString()).ToString("#0.00");
                    dr["Credit"]      = Convert.ToDecimal(DSOpeningBal.Tables[0].Rows[0]["Credit"].ToString()).ToString("#0.00");
                    dr["Closing1"]    = DSOpeningBal.Tables[0].Rows[0]["Closing1"].ToString();
                    dr["Closing"]     = DSOpeningBal.Tables[0].Rows[0]["Closing"].ToString();
                    dr["ForMonth"]    = DSOpeningBal.Tables[0].Rows[0]["ForMonth"].ToString();
                    dr["LedgerID"]    = DSOpeningBal.Tables[0].Rows[0]["LedgerID"].ToString();
                    DTLedger.Rows.Add(dr);
                }
                //-----For No. Of Months-----
                NoOfMonths = 12 * ((Convert.ToDateTime(Session["ToDate"])).Year - (Convert.ToDateTime(Session["FromDate"])).Year) + (Convert.ToDateTime(Session["ToDate"])).Month - (Convert.ToDateTime(Session["FromDate"])).Month;
                for (int i = 0; i <= NoOfMonths; i++)
                {
                    string Condition = string.Empty;
                    StDate    = Convert.ToDateTime(Session["FromDate"]).AddMonths(i).ToString("dd-MM-yyyy");
                    EdDate    = (Convert.ToDateTime(Session["FromDate"]).AddMonths(i + 1)).AddDays(-1).ToString("dd-MM-yyyy");
                    Condition = Condition + "AND VoucherDate >= '" + Convert.ToDateTime(StDate).ToString("MM-dd-yyyy") + "' And VoucherDate <= '" + Convert.ToDateTime(EdDate).ToString("MM-dd-yyyy") + "' ";

                    //if (Convert.ToString(Request.QueryString["ID"]).Trim() == "25")
                    //{
                    DSOpeningBal = obj_SundryLedger.DisplayMonthDetails(RepCond, Condition, out strError);
                    //}
                    //else
                    //{
                    //    DSOpeningBal = obj_SundryLedger.DisplayMonthDetailsDebitor(RepCond, StDate, EdDate, out strError);
                    //}
                    dr = DTLedger.NewRow();
                    if (DSOpeningBal.Tables.Count > 0 && DSOpeningBal.Tables[0].Rows.Count > 0)
                    {
                        dr["#"]           = Convert.ToInt32(Request.QueryString["LedgerId"]);
                        dr["Particulars"] = Convert.ToDateTime(StDate).ToString("MMM");
                        dr["Debit"]       = DSOpeningBal.Tables[0].Rows[0]["Debit"].ToString();
                        dr["Credit"]      = DSOpeningBal.Tables[0].Rows[0]["Credit"].ToString();
                        dr["Closing1"]    = DSOpeningBal.Tables[0].Rows[0]["Closing1"].ToString();
                        dr["Closing"]     = DSOpeningBal.Tables[0].Rows[0]["Closing"].ToString();
                        dr["ForMonth"]    = Convert.ToDateTime(StDate).ToString("dd-MM-yyyy");
                        dr["LedgerID"]    = DSOpeningBal.Tables[0].Rows[0]["LedgerID"].ToString();
                    }
                    else
                    {
                        dr["#"]           = Convert.ToInt32(Request.QueryString["LedgerId"]);
                        dr["Particulars"] = Convert.ToDateTime(StDate).ToString("MMM");
                        dr["Debit"]       = "0.00";
                        dr["Credit"]      = "0.00";
                        dr["Closing"]     = "0.00";
                        dr["Closing1"]    = "0.00";
                        dr["ForMonth"]    = Convert.ToDateTime(StDate).ToString("dd-MM-yyyy");
                        dr["LedgerID"]    = "0";
                    }

                    DTLedger.Rows.Add(dr);

                    //----Calculation of Debit,Credit n Closing for each Month in 2nd grid--
                    int    PreviousRow = DTLedger.Rows.Count - 2;
                    int    CurrentRow  = DTLedger.Rows.Count - 1;
                    string temp;
                    string Debit   = DTLedger.Rows[DTLedger.Rows.Count - 1]["Debit"].ToString();
                    string Credit  = DTLedger.Rows[DTLedger.Rows.Count - 1]["Credit"].ToString();
                    string closing = DTLedger.Rows[DTLedger.Rows.Count - 2]["Closing1"].ToString();
                    temp = closing.Substring(closing.Length - 2, 2);
                    string closingAmnt = closing.Substring(0, closing.Length - 3);
                    //string debitAmnt = Debit.Substring(0, Debit.Length - 2);
                    //string creditAmnt = Credit.Substring(0, Credit.Length - 2);
                    if (temp.Equals("Cr"))
                    {
                        DTLedger.Rows[DTLedger.Rows.Count - 1]["Closing1"] = ((Convert.ToDecimal(Debit) - Convert.ToDecimal(Credit)) - Convert.ToDecimal(closingAmnt)).ToString("0.00");
                        if (Convert.ToDecimal(DTLedger.Rows[DTLedger.Rows.Count - 1]["Closing1"]) > 0)
                        {
                            DTLedger.Rows[DTLedger.Rows.Count - 1]["Closing"] = Convert.ToDecimal(DTLedger.Rows[DTLedger.Rows.Count - 1]["Closing1"]) + " Dr";
                        }
                        else if (Convert.ToDecimal(DTLedger.Rows[DTLedger.Rows.Count - 1]["Closing1"]) < 0)
                        {
                            DTLedger.Rows[DTLedger.Rows.Count - 1]["Closing"] = Math.Abs(Convert.ToDecimal(DTLedger.Rows[DTLedger.Rows.Count - 1]["Closing1"])) + " Cr";
                        }
                        else
                        {
                            DTLedger.Rows[DTLedger.Rows.Count - 1]["Closing"] = "0.00" + " Cr";
                        }
                    }
                    else
                    {
                        DTLedger.Rows[DTLedger.Rows.Count - 1]["Closing1"] = ((Convert.ToDecimal(closingAmnt) + (Convert.ToDecimal(Debit) - Convert.ToDecimal(Credit)))).ToString("0.00");
                        if (Convert.ToDecimal(DTLedger.Rows[DTLedger.Rows.Count - 1]["Closing1"]) > 0)
                        {
                            DTLedger.Rows[DTLedger.Rows.Count - 1]["Closing"] = Convert.ToDecimal(DTLedger.Rows[DTLedger.Rows.Count - 1]["Closing1"]) + " Dr";
                        }
                        else if (Convert.ToDecimal(DTLedger.Rows[DTLedger.Rows.Count - 1]["Closing1"]) < 0)
                        {
                            DTLedger.Rows[DTLedger.Rows.Count - 1]["Closing"] = Math.Abs(Convert.ToDecimal(DTLedger.Rows[DTLedger.Rows.Count - 1]["Closing1"])) + " Cr";
                        }
                        else
                        {
                            DTLedger.Rows[DTLedger.Rows.Count - 1]["Closing"] = "0.00" + " Cr";
                        }
                    }
                }
                DS.Tables.Add(DTLedger);
                this.Page.Title        = "Print-SundryCreditorLedgerMonthlySummary";
                DS.Tables[0].TableName = "SundryCreditorsLedgerMonthlySummary";
                DataColumn column1 = new DataColumn("ForName", typeof(string));
                DS.Tables[0].Columns.Add("ForName");
                DataColumn column2 = new DataColumn("Name", typeof(string));
                DS.Tables[0].Columns.Add("Name");
                DataColumn column3 = new DataColumn("TotalClosing", typeof(string));
                DS.Tables[0].Columns.Add("TotalClosing");
                DataColumn column4 = new DataColumn("TotalCredit", typeof(decimal));
                DS.Tables[0].Columns.Add("TotalCredit");
                DataColumn column5 = new DataColumn("TotalDebit", typeof(decimal));
                DS.Tables[0].Columns.Add("TotalDebit");
                DataColumn column6 = new DataColumn("FromDate", typeof(string));
                DS.Tables[0].Columns.Add("FromDate");
                DataColumn column7 = new DataColumn("ToDate", typeof(string));
                DS.Tables[0].Columns.Add("ToDate");
                decimal sd = 0; decimal sc = 0;
                if (DS.Tables[0].Rows.Count > 0)
                {
                    //New DataColumn(RowCount)By Gayatri 26 June 2013----------------

                    DataColumn columnR = new DataColumn("RowCount");
                    columnR.DataType = typeof(string);
                    DS.Tables[0].Columns.Add("RowCount");

                    //End DataColumn(RowCount)-----------------

                    for (int q = 0; q < DS.Tables[0].Rows.Count; q++)
                    {
                        sd += Convert.ToDecimal(DS.Tables[0].Rows[q]["Debit"].ToString());
                        sc += Convert.ToDecimal(DS.Tables[0].Rows[q]["Credit"].ToString());
                        DS.Tables[0].Rows[q]["RowCount"] = DS.Tables[0].Rows.Count + " Record(s) Found!!";
                    }
                }
                DS.Tables[0].Rows[0]["TotalDebit"] = sd;
                DS.Tables[0].Rows[DS.Tables[0].Rows.Count - 1]["TotalDebit"] = sd;
                DS.Tables[0].Rows[0]["TotalCredit"] = sc;
                DS.Tables[0].Rows[DS.Tables[0].Rows.Count - 1]["TotalCredit"] = sc;
                DS.Tables[0].Rows[0]["ForName"]      = "Ledger Monthly Summary :- " + Convert.ToString(Session["LedgerName"]).Replace("&amp;", "&");;
                DS.Tables[0].Rows[0]["Name"]         = "KARIA " + Convert.ToString(Request.QueryString["FY"]).Trim() + " - " + Convert.ToString(Request.QueryString["EY"]).Trim();
                DS.Tables[0].Rows[0]["TotalClosing"] = DS.Tables[0].Rows[DS.Tables[0].Rows.Count - 1]["Closing"];
                DS.Tables[0].Rows[DS.Tables[0].Rows.Count - 1]["TotalClosing"] = DS.Tables[0].Rows[DS.Tables[0].Rows.Count - 1]["Closing"];
                string[] d = Convert.ToString((Session["LedgerDate"])).Split('*');
                DS.Tables[0].Rows[0]["FromDate"] = Convert.ToDateTime(d[0]).ToString("dd-MMM-yyyy");
                DS.Tables[0].Rows[0]["ToDate"]   = Convert.ToDateTime(d[1]).ToString("dd-MMM-yyyy");
                DS.Tables[0].TableName           = "SundryCreditorsLedgerMonthlySummary";
                DS.Tables[1].TableName           = "CompanyDetails";
                CRpt.Load(Server.MapPath("~/PrintAccReport/CryRptSundryLedgerMonthly.rpt"));
                CRpt.SetDataSource(DS);
                CRPrint.ReportSource = CRpt;
                CRPrint.DataBind();
                CRPrint.DisplayToolbar = true;

                break;
            }
                #endregion

                #region [3rd Grid For Creditors]
            case "SundryCreditorsLedgerVouchers":
            {
                LedgerCond = Convert.ToString(Request.QueryString["LedgerId"]).Trim();
                int Month = Convert.ToInt32(Request.QueryString["Month"]);
                int Year  = Convert.ToInt32(Request.QueryString["Year"]);
                if (Convert.ToString(Request.QueryString["ID"]).Trim() == "25")
                {
                    DS = obj_SundryLedger.LedgerEntry(LedgerCond, Month, Year, out strError);
                    this.Page.Title = "Print-SundryCreditorLedgerVoucher";
                }
                else
                {
                    //DS = obj_SundryLedger.LedgerEntryDebitor(LedgerCond, Month, Year, out strError);
                    //this.Page.Title = "Print-SundryDebitorLedgerVoucher";
                }
                if (DS.Tables.Count > 0 && DS.Tables[0].Rows.Count > 0)
                {
                    //New DataColumn(FilterCondition)By Gayatri 13 June 2013----------------
                    DataColumn column = new DataColumn("FilterCondition");
                    column.DataType = typeof(string);
                    DS.Tables[0].Columns.Add("FilterCondition");
                    //DS.Tables[0].Rows[0]["FilterCondition"] = CheckConditionFilter.ToString();

                    //New DataColumn(RowCount)By Gayatri 26 June 2013----------------

                    DataColumn columnR = new DataColumn("RowCount");
                    columnR.DataType = typeof(string);
                    DS.Tables[0].Columns.Add("RowCount");

                    //End DataColumn(RowCount)-----------------

                    for (int i = 0; i < DS.Tables[0].Rows.Count; i++)
                    {
                        DS.Tables[0].Rows[i]["FilterCondition"] = CheckConditionFilter.ToString();
                        DS.Tables[0].Rows[i]["RowCount"]        = DS.Tables[0].Rows.Count + " Record(s) Found!!";
                    }

                    DS.Tables[0].TableName = "SundryCreditorsGroupSummary";
                    DataColumn column1 = new DataColumn("ForName", typeof(string));
                    DS.Tables[0].Columns.Add("ForName");
                    DataColumn column2 = new DataColumn("Name", typeof(string));
                    DS.Tables[0].Columns.Add("Name");
                    DataColumn column3 = new DataColumn("MonthName", typeof(string));
                    DS.Tables[0].Columns.Add("MonthName");
                    DataColumn column4 = new DataColumn("OpeningBal", typeof(Decimal));
                    DS.Tables[0].Columns.Add("OpeningBal");
                    DataColumn column5 = new DataColumn("OpeningBalCRDR", typeof(string));
                    DS.Tables[0].Columns.Add("OpeningBalCRDR");
                    DataColumn column6 = new DataColumn("CLOSINGBAL", typeof(string));
                    DS.Tables[0].Columns.Add("CLOSINGBAL");

                    DS.Tables[0].Rows[0]["ForName"] = "Ledger :- " + Convert.ToString(Session["LedgerName"]).Replace("&amp;", "&");

                    DS.Tables[0].Rows[0]["Name"]       = "KARIA " + Convert.ToString(Session["FromDate"]) + " - " + Convert.ToString(Session["ToDate"]);
                    DS.Tables[0].Rows[0]["MonthName"]  = "For The Month Of " + Convert.ToString(Session["MonthName"]);
                    DS.Tables[0].Rows[0]["OpeningBal"] = Convert.ToDecimal(Session["OpeningBal"]);
                    decimal sd = 0; decimal sc = 0;
                    if (DS.Tables[0].Rows.Count > 0)
                    {
                        for (int q = 0; q < DS.Tables[0].Rows.Count; q++)
                        {
                            sd += Convert.ToDecimal(DS.Tables[0].Rows[q]["Debit"].ToString());
                            sc += Convert.ToDecimal(DS.Tables[0].Rows[q]["Credit"].ToString());
                        }
                    }
                    if (Convert.ToDecimal(Session["OpeningBal"]) >= 0)
                    {
                        DS.Tables[0].Rows[0]["OpeningBalCRDR"] = Math.Abs(Convert.ToDecimal(DS.Tables[0].Rows[0]["OpeningBal"].ToString())).ToString() + " Dr";
                        DS.Tables[0].Rows[DS.Tables[0].Rows.Count - 1]["OpeningBalCRDR"] = Math.Abs(Convert.ToDecimal(DS.Tables[0].Rows[0]["OpeningBal"].ToString())).ToString() + " Dr";
                    }
                    else
                    {
                        DS.Tables[0].Rows[0]["OpeningBalCRDR"] = Math.Abs(Convert.ToDecimal(DS.Tables[0].Rows[0]["OpeningBal"].ToString())).ToString() + " Cr";
                        DS.Tables[0].Rows[DS.Tables[0].Rows.Count - 1]["OpeningBalCRDR"] = Math.Abs(Convert.ToDecimal(DS.Tables[0].Rows[0]["OpeningBal"].ToString())).ToString() + " Cr";
                    }

                    if (((sd - sc) + Convert.ToDecimal(DS.Tables[0].Rows[0]["OpeningBal"].ToString())) >= 0)
                    {
                        DS.Tables[0].Rows[0]["CLOSINGBAL"] = Math.Abs((sd - sc) + Convert.ToDecimal(DS.Tables[0].Rows[0]["OpeningBal"].ToString())).ToString() + " Dr";
                        DS.Tables[0].Rows[DS.Tables[0].Rows.Count - 1]["CLOSINGBAL"] = Math.Abs((sd - sc) + Convert.ToDecimal(DS.Tables[0].Rows[0]["OpeningBal"].ToString())).ToString() + " Dr";
                    }
                    else
                    {
                        DS.Tables[0].Rows[0]["CLOSINGBAL"] = Math.Abs((sd - sc) + Convert.ToDecimal(DS.Tables[0].Rows[0]["OpeningBal"].ToString())).ToString() + " Cr";
                        DS.Tables[0].Rows[DS.Tables[0].Rows.Count - 1]["CLOSINGBAL"] = Math.Abs((sd - sc) + Convert.ToDecimal(DS.Tables[0].Rows[0]["OpeningBal"].ToString())).ToString() + " Cr";
                    }

                    DS.Tables[0].TableName = "SundryCreditorsLedgerVoucher";
                    DS.Tables[1].TableName = "CompanyDetails";
                    CRpt.Load(Server.MapPath("~/PrintAccReport/CryRptSundryLedgerVoucher.rpt"));
                    CRpt.SetDataSource(DS);
                    CRPrint.ReportSource = CRpt;
                    CRPrint.DataBind();
                    CRPrint.DisplayToolbar = true;
                }
                break;
            }
                #endregion
            }
        }
        catch (ThreadAbortException thex)
        {
        }
        catch (Exception ex)
        {
        }
    }
    protected void GrdReport_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        try
        {
            switch (e.CommandName)
            {
            case ("Select"):
            {
                if (Convert.ToInt32(e.CommandArgument) != 0)
                {
                    ViewState["EditID"] = Convert.ToInt32(e.CommandArgument);

                    DS = Obj_Receipt.GetReceiptToEdit(Convert.ToInt32(e.CommandArgument), out StrError);

                    if (DS.Tables.Count > 0 && DS.Tables[0].Rows.Count > 0)
                    {
                        txtVoucherNo.Text = DS.Tables[0].Rows[0]["ReceiptNo"].ToString();
                        txtDate.Text      = DS.Tables[0].Rows[0]["ReceiptDate"].ToString();
                        txtNarration.Text = DS.Tables[0].Rows[0]["Narration"].ToString();

                        ddlPROPERTYTo.SelectedValue   = DS.Tables[0].Rows[0]["PropertyId"].ToString();
                        ddlReceivedFrom.SelectedValue = DS.Tables[0].Rows[0]["PartyId"].ToString();
                        ddlReceivedFrom_SelectedIndexChanged(sender, e);
                        ddlExpenseName.SelectedValue = DS.Tables[0].Rows[0]["ExpenseHdId"].ToString();

                        txtUnitNO.Text    = DS.Tables[0].Rows[0]["UnitNo"].ToString();
                        txtMonthDate.Text = DS.Tables[0].Rows[0]["ForTheMonth"].ToString();
                        txtAmount.Text    = DS.Tables[0].Rows[0]["VoucherAmt"].ToString();

                        if (!FlagEdit)
                        {
                            BtnUpdate.Visible = true;
                        }
                        BtnSave.Visible = false;
                    }
                    else
                    {
                        MakeEmptyForm();
                    }
                }

                break;
            }

                //case ("MailPO"):
                //    {
                //        //TRLOADING.Visible = false;
                //        //ViewState["MailID"] = Convert.ToInt32(e.CommandArgument);
                //        //GETDATAFORMAIL(1, 1);
                //        //MDPopUpYesNoMail.Show();
                //        //BtnPopMail.Focus();
                //    }
                //    break;

                #region Email
            case ("Email"):
            {
                if (Convert.ToInt32(e.CommandArgument) != 0)
                {
                    ViewState["EditID"] = Convert.ToInt32(e.CommandArgument);
                    GridViewRow gv = (GridViewRow)(((ImageButton)e.CommandSource).NamingContainer);



                    //ID = Convert.ToInt32(Request.QueryString["ID"]);
                    DS = obj_PO.GetReceiptForPrint(Convert.ToInt32(ViewState["EditID"]), out StrError);

                    if (DS.Tables.Count > 0)
                    {
                        if (DS.Tables[0].Rows.Count > 0)
                        {
                            DataColumn column = new DataColumn("AmountInWords");
                            column.DataType = typeof(string);
                            DS.Tables[0].Columns.Add("AmountInWords");
                            for (int i = 0; i < DS.Tables[0].Rows.Count; i++)
                            {
                                DS.Tables[0].Rows[i]["AmountInWords"] = WordAmount.convertcurrency(Convert.ToDecimal(DS.Tables[0].Rows[i]["VoucherAmt"]));
                            }

                            //DS.Tables[1].Columns.Add("LogoImg1", System.Type.GetType("System.Byte[]"));
                            ////DS.Tables[1].Columns.Add("LogoImg2", System.Type.GetType("System.Byte[]"));
                            ////DS.Tables[1].Columns.Add("LogoImg3", System.Type.GetType("System.Byte[]"));
                            //if (DS.Tables[1].Rows.Count - 1 >= 0)
                            //{
                            //    if (System.IO.File.Exists(Server.MapPath(DS.Tables[1].Rows[0]["LogoImg"].ToString())))
                            //    {
                            //        FileStream fs;
                            //        BinaryReader br;
                            //        fs = new FileStream(Server.MapPath(DS.Tables[1].Rows[0]["LogoImg"].ToString()), FileMode.Open);
                            //        br = new BinaryReader(fs);
                            //        byte[] imgbyteLogo = new byte[fs.Length + 1];
                            //        imgbyteLogo = br.ReadBytes(Convert.ToInt32((fs.Length)));
                            //        DS.Tables[1].Rows[0]["LogoImg1"] = imgbyteLogo;
                            //        br.Close();
                            //        fs.Close();
                            //    }
                            //}

                            //for (int i = 0; i < DS.Tables[1].Rows.Count; i++)
                            //{
                            //    DS.Tables[1].Rows[i]["LogoImg1"] = DS.Tables[1].Rows[0]["LogoImg1"];
                            //    //DS.Tables[1].Rows[i]["LogoImg2"] = DS.Tables[1].Rows[0]["LogoImg2"];
                            //    //DS.Tables[1].Rows[i]["LogoImg3"] = DS.Tables[1].Rows[0]["LogoImg3"];
                            //    DS.Tables[1].Rows[i]["CompanyAddress"] = DS.Tables[1].Rows[0]["CompanyAddress"];

                            //}

                            DS.Tables[0].TableName = "ReceiptMaster";
                            //DS.Tables[1].TableName = "ReceiptCompany";
                            //DS.Tables[2].TableName = "ChargeDetails";
                            ////DS.Tables[3].TableName = "TaxDetails";
                            ////DS.Tables[4].TableName = "AgreementValueDetails";
                            CRpt.Load(Server.MapPath("~/PrintReport/CryRptReceiptWithoutDetails.rpt"));
                            //CRpt.Load(Server.MapPath("~/PrintReport/CryRptGaganReceiptEmail.rpt"));
                            CRpt.SetDataSource(DS);
                            ////CRpt.SetParameterValue(0, int.Parse(DS.Tables[0].Rows[0]["PrintCnt"].ToString()));
                            ////CRpt.SetParameterValue(1, DS.Tables[1].Rows[0]["Company"].ToString());
                            //////CRPrint.ReportSource = CRpt;
                            //////CRPrint.DataBind();
                            //////CRPrint.DisplayToolbar = true;



                            //------- Add New Code For Print-----
                            //if (Print_Flag != 0)
                            //{
                            //    //CRpt.PrintOptions.PrinterName = "Send To OneNote 2007";
                            //    //  CRpt.PrintToPrinter(1, false, 0, 0);
                            //}

                            #region Email
                            DataSet   grdDataset = (DataSet)Session["dtEmail"];
                            DataTable GrdReport1 = grdDataset.Tables[0];
                            string    PDFmail    = string.Empty;
                            //string Email = Request.QueryString["Email"];
                            string Email      = DS.Tables[0].Rows[0]["Email"].ToString();
                            string PCName     = DS.Tables[0].Rows[0]["Property"].ToString();     //Request.QueryString["PCName"];
                            Int64  TotalFiles = System.IO.Directory.GetFiles(Server.MapPath("~/ReceiptEmail/")).Count();
                            PDFmail = Server.MapPath(@"~/ReceiptEmail/" + "Email - " + (DateTime.Now).ToString("dd-MMM-yyyy") + TotalFiles.ToString() + ".pdf");
                            CRpt.Load(Server.MapPath("~/PrintReport/CryRptReceiptWithoutDetails.rpt"));
                            CRpt.SetDataSource(DS);
                            //CRpt.SetParameterValue(0, int.Parse(DS.Tables[0].Rows[0]["PrintCnt"].ToString()));
                            //CRpt.SetParameterValue(1, DS.Tables[1].Rows[0]["Company"].ToString());
                            CRpt.ExportToDisk(ExportFormatType.PortableDocFormat, PDFmail);
                            string MsgFormat;



                            System.Net.Mail.SmtpClient  smtpClient = new System.Net.Mail.SmtpClient();
                            System.Net.Mail.MailMessage msg1       = new System.Net.Mail.MailMessage();
                            System.Net.Mail.MailMessage msg11      = new System.Net.Mail.MailMessage();
                            string emailAddrofCust = DS.Tables[0].Rows[0]["Email"].ToString();
                            //string emailAddrofCust = "*****@*****.**";
                            // string emailAddrofCust = "*****@*****.**";
                            //string emailAddrofCust = "*****@*****.**";

                            if (emailAddrofCust == "")
                            {
                                Obj_Comm.ShowPopUpMsg("Email address not present", this.Page);
                                return;
                            }
                            else
                            {
                                #region EmailBody
                                emailAddrofCust = emailAddrofCust.Replace(';', ',');
                                //msg1.From = new System.Net.Mail.MailAddress("*****@*****.**");
                                msg1.From = new System.Net.Mail.MailAddress("*****@*****.**");
                                msg1.To.Add(emailAddrofCust);
                                msg1.CC.Add("*****@*****.**");
                                msg1.Subject = "Receipt Voucher";
                                MsgFormat    = "<font face='Arial'>" + "<b>" + "Dear Sir/Madam," + "<b>" + "<p>" + Environment.NewLine + "<b>" + "Greetings from Atur India." + "<b>" + "<p>";
                                MsgFormat    = MsgFormat + "<p>This is with reference to your Rent with us in the Property known as " + PCName + ".";     //+ DS1.Tables[0].Rows[0]["Project"].ToString() +
                                MsgFormat    = MsgFormat + " A Receipt Voucher has been attached here with. ";
                                MsgFormat    = MsgFormat + "<p>" + Environment.NewLine + "Please download the attachment for your ready reference." + Environment.NewLine;
                                MsgFormat    = MsgFormat + "</p><br>Thanking you,</p><p>";
                                MsgFormat    = MsgFormat + "</p><br>Regards,</p><p>" + Environment.NewLine;
                                //MsgFormat = MsgFormat + " " + DS1.Tables[0].Rows[0]["Company"].ToString() + "<br></font>";
                                //"Sales Executive<br></font>";
                                msg1.Body       = MsgFormat;
                                msg1.IsBodyHtml = true;
                                System.Net.Mail.Attachment mtl = new System.Net.Mail.Attachment(PDFmail);
                                msg1.Attachments.Add(mtl);
                                /*** For Gmail ****/
                                //smtpClient.Host = "smtp.gmail.com";  // We use gmail as our smtp client
                                //smtpClient.Port = 587;
                                /*****End***/

                                /*** For Yahoo ****/
                                smtpClient.Host = "smtp.mail.yahoo.com";          // We use gmail as our smtp client
                                smtpClient.Port = 587;
                                /*****End***/

                                smtpClient.EnableSsl             = true;
                                smtpClient.UseDefaultCredentials = true;
                                //smtpClient.Credentials = new System.Net.NetworkCredential("*****@*****.**", "sanjay1234567");
                                smtpClient.Credentials = new System.Net.NetworkCredential("*****@*****.**", "revosacred123");

                                System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate(object s, System.Security.Cryptography.X509Certificates.X509Certificate certificate, System.Security.Cryptography.X509Certificates.X509Chain chain, System.Net.Security.SslPolicyErrors sslPolicyErrors)
                                {
                                    return(true);
                                };
                                #endregion
                                smtpClient.Send(msg1);
                                //cnt1 = cnt1 + 1;
                                Obj_Comm.ShowPopUpMsg("Mail Successfully Send..!", this.Page);
                            }
                        }

                        break;
                    }

                    #endregion
                }
                break;
            }
                #endregion
            }
            ScriptManager.RegisterStartupScript(this, this.GetType(), "paisa_conver", "paisa_conver()", true);
        }
        catch (Exception ex)
        {
            Obj_Comm.ShowPopUpMsg("Please try after Some Time..!", this.Page);
        }
    }
Пример #12
0
        public int GetPostFixIndex(WordAmount amount, WordCase aCase)
        {
            switch (amount)
            {
                case WordAmount.Plural:
                    {
                        if (pluralPostfixSelector.ContainsKey(aCase))
                            return pluralPostfixSelector[aCase];
                        break;
                    }

                case WordAmount.Singular:
                    {
                        if (singularPostfixSelector.ContainsKey(aCase))
                            return singularPostfixSelector[aCase];
                        break;
                    }
            }

            return 0;
        }
Пример #13
0
        public string GetForm(WordCase aCase, WordAmount amount)
        {
            WordToken token = new WordToken(null, aCase, amount);
            foreach (WordToken tok in irregulars)
                if (tok.Is(token))
                    return tok.Text;

            return null;
        }
Пример #14
0
        public void SetPostIndex(WordCase aCase, WordAmount amount, int postFixIndex)
        {
            switch (amount)
            {
                case WordAmount.Plural:
                    {
                        if (postFixIndex > 0)
                        {
                            if (pluralPostfixSelector.ContainsKey(aCase))
                                pluralPostfixSelector[aCase] = postFixIndex;
                            else
                                pluralPostfixSelector.Add(aCase, postFixIndex);
                        }
                        else
                            if (pluralPostfixSelector.ContainsKey(aCase))
                                pluralPostfixSelector.Remove(aCase);

                        break;
                    }

                case WordAmount.Singular:
                    {
                        if (postFixIndex > 0)
                        {
                            if (singularPostfixSelector.ContainsKey(aCase))
                                singularPostfixSelector[aCase] = postFixIndex;
                            else
                                singularPostfixSelector.Add(aCase, postFixIndex);
                        }
                        else
                            if (singularPostfixSelector.ContainsKey(aCase))
                                singularPostfixSelector.Remove(aCase);

                        break;
                    }
            }

        }
Пример #15
0
        public bool AnalyzeLine(string line)
        {
            if (!string.IsNullOrEmpty(line))
            {
                string[] elements = line.Split('|');

                this.Root = elements[0]; // always will be at last one element in nonempty string

                if (elements.Length > 1)
                {
                    for (int i = 1; i < elements.Length; i++)
                    {
                        string str = elements[i];
                        if (string.IsNullOrEmpty(str))
                        {
                            continue;
                        }

                        switch (str[0])
                        {
                            #region Irregular levelling

                        case '*':
                        {
                            if (str.Length > 1)
                            {
                                this.IsLevelledComplex = false;

                                if (str[1] == '+')
                                {
                                    this.LevelHighestForm = str.Substring(2);
                                }
                                else
                                {
                                    this.LevelHigherForm = str.Substring(1);
                                }
                            }
                            else
                            {
                                // err
                                return(false);
                            }

                            break;
                        }

                            #endregion

                            #region Nondeclinative item

                        case '#':
                        {
                            this.IsConstant = true;

                            break;
                        }

                        case '!':
                        {
                            this.canBeLevelled = false;

                            break;
                        }

                            #endregion

                            #region Exception Cases

                        case '%':
                        {
                            if (str.Length > 5)
                            {
                                this.IsException = true;
                                WordCase       aCase  = EnumHelper.GetWordCase(str[1]);
                                WordAmount     amount = EnumHelper.GetWordAmount(str[2]);
                                WordGenre      genre  = EnumHelper.GetWordGenre(str[3]);
                                AdjectiveLevel level  = EnumHelper.GetAdjectiveLevel(str[4]);
                                string         txt    = str.Substring(5);

                                AdjectiveWordToken token = new
                                                           AdjectiveWordToken(txt, aCase, genre, amount, level);
                                this.Irregulars.Add(token);
                            }
                            else
                            {
                                // err
                                return(false);
                            }

                            break;
                        }

                            #endregion

                            #region Categories

                        case '$':
                        {
                            string cats = str.Substring(1);
                            categories.Clear();
                            if (!string.IsNullOrEmpty(cats))
                            {
                                string[] arr = cats.Split(',');
                                foreach (string catId in arr)
                                {
                                    int id = int.Parse(catId);

                                    if (!categories.Contains(id))
                                    {
                                        categories.Add(id);
                                    }
                                }
                            }

                            break;
                        }

                            #endregion
                        }
                    }
                }
                else
                {
                    // set defaults
                    this.IsException = false;
                    this.IsConstant  = false;
                }

                //if (adj.IsException && adj.IsLevelledComplex)
                //{
                //    // not supported
                //}
                //else

                return(true);
            }

            return(false);
        }