Пример #1
0
        public TaxCalculationMaster4Deduction objGetTaxCalculationMaster4Deduction(string EmployeeId)
        {
            TaxCalculationMaster4Deduction argTaxCalculationMaster4Deduction = new TaxCalculationMaster4Deduction();
            DataSet DataSetToFill = new DataSet();

            if (EmployeeId.ToString().Trim() == "")
            {
                goto ErrorHandlers;
            }

            DataSetToFill = this.GetTaxCalculationMaster4Deduction4ID(EmployeeId.ToString().Trim());

            if (DataSetToFill.Tables[0].Rows.Count <= 0)
            {
                goto Finish;
            }

            argTaxCalculationMaster4Deduction = this.objCreteTaxCalculationMaster4Deduction((DataRow)DataSetToFill.Tables[0].Rows[0]);

            goto Finish;

ErrorHandlers:

Finish:
            DataSetToFill = null;

            return(argTaxCalculationMaster4Deduction);
        }
Пример #2
0
        private TaxCalculationMaster4Deduction objCreteTaxCalculationMaster4Deduction(DataRow dr)
        {
            TaxCalculationMaster4Deduction tTaxCalculationMaster4Deduction = new TaxCalculationMaster4Deduction();

            tTaxCalculationMaster4Deduction.SetObjectInfo(dr);

            return(tTaxCalculationMaster4Deduction);
        }
Пример #3
0
        public void InsertTaxCalculationMaster4Deduction(TaxCalculationMaster4Deduction argTaxCalculationMaster4Deduction, DataAccess da, List <ErrorHandlerClass> lstErr)
        {
            da.Open_Connection();

            SqlParameter[] param = new SqlParameter[10];
            param[0] = new SqlParameter("@EmployeeId", argTaxCalculationMaster4Deduction.EmployeeId);
            param[1] = new SqlParameter("@TDSNo", argTaxCalculationMaster4Deduction.TDSNo);
            param[2] = new SqlParameter("@ItemNo", argTaxCalculationMaster4Deduction.ItemNo);
            param[3] = new SqlParameter("@TaxableDeduction", argTaxCalculationMaster4Deduction.TaxableDeduction);
            param[4] = new SqlParameter("@TaxableAmount", argTaxCalculationMaster4Deduction.TaxableAmount);

            param[5] = new SqlParameter("@CreatedBy", argTaxCalculationMaster4Deduction.CreatedBy);
            param[6] = new SqlParameter("@ModifiedBy", argTaxCalculationMaster4Deduction.ModifiedBy);


            param[7]           = new SqlParameter("@Type", SqlDbType.Char);
            param[7].Size      = 1;
            param[7].Direction = ParameterDirection.Output;

            param[8]           = new SqlParameter("@Message", SqlDbType.VarChar);
            param[8].Size      = 255;
            param[8].Direction = ParameterDirection.Output;

            param[9]           = new SqlParameter("@returnvalue", SqlDbType.VarChar);
            param[9].Size      = 20;
            param[9].Direction = ParameterDirection.Output;

            int i = da.NExecuteNonQuery("Proc_InsertTDSDeductions", param);

            string strMessage  = Convert.ToString(param[8].Value);
            string strType     = Convert.ToString(param[7].Value);
            string strRetValue = Convert.ToString(param[9].Value);

            objErrorHandlerClass.Type        = strType;
            objErrorHandlerClass.MsgId       = 0;
            objErrorHandlerClass.Message     = strMessage.ToString();
            objErrorHandlerClass.RowNo       = 0;
            objErrorHandlerClass.FieldName   = "";
            objErrorHandlerClass.LogCode     = "";
            objErrorHandlerClass.ReturnValue = strRetValue;
            lstErr.Add(objErrorHandlerClass);
            //return i;
        }
Пример #4
0
        public ICollection <ErrorHandlerClass> SaveTaxCalculationMaster4Deduction(TaxCalculationMaster4Deduction objTaxCalculationMaster4Deduction)
        {
            List <ErrorHandlerClass> lstErr = new List <ErrorHandlerClass>();
            DataAccess da = new DataAccess();

            try
            {
                da.Open_Connection();
                da.BEGIN_TRANSACTION();

                if (blnIsTaxCalculationMaster4DeductionExist(objTaxCalculationMaster4Deduction.EmployeeId, objTaxCalculationMaster4Deduction.ItemNo, objTaxCalculationMaster4Deduction.TDSNo) == false)
                {
                    InsertTaxCalculationMaster4Deduction(objTaxCalculationMaster4Deduction, da, lstErr);

                    foreach (ErrorHandlerClass objerr in lstErr)
                    {
                        if (objerr.Type == "E")
                        {
                            da.ROLLBACK_TRANSACTION();
                            return(lstErr);
                        }
                    }
                    da.COMMIT_TRANSACTION();
                }
                else
                {
                    UpdateTaxCalculationMaster4Deduction(objTaxCalculationMaster4Deduction, da, lstErr);
                    foreach (ErrorHandlerClass objerr in lstErr)
                    {
                        if (objerr.Type == "E")
                        {
                            da.ROLLBACK_TRANSACTION();
                            return(lstErr);
                        }
                    }
                    da.COMMIT_TRANSACTION();
                }
            }
            catch (Exception ex)
            {
                if (da != null)
                {
                    da.ROLLBACK_TRANSACTION();
                }
                objErrorHandlerClass.Type      = ErrorConstant.strAboartType;
                objErrorHandlerClass.MsgId     = 0;
                objErrorHandlerClass.Message   = ex.Message.ToString();
                objErrorHandlerClass.RowNo     = 0;
                objErrorHandlerClass.FieldName = "";
                objErrorHandlerClass.LogCode   = "";
                lstErr.Add(objErrorHandlerClass);
            }
            finally
            {
                if (da != null)
                {
                    da.Close_Connection();
                    da = null;
                }
            }
            return(lstErr);
        }