Exemple #1
0
        public PartnerServiceTax objGetPartnerServiceTax(int argServiceTaxID, string argClientCode)
        {
            PartnerServiceTax argPartnerServiceTax = new PartnerServiceTax();
            DataSet           DataSetToFill        = new DataSet();

            if (argServiceTaxID <= 0)
            {
                goto ErrorHandlers;
            }

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

            DataSetToFill = this.GetPartnerServiceTax(argServiceTaxID, argClientCode);

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

            argPartnerServiceTax = this.objCreatePartnerServiceTax((DataRow)DataSetToFill.Tables[0].Rows[0]);

            goto Finish;

ErrorHandlers:

Finish:
            DataSetToFill = null;


            return(argPartnerServiceTax);
        }
Exemple #2
0
        private PartnerServiceTax objCreatePartnerServiceTax(DataRow dr)
        {
            PartnerServiceTax tPartnerServiceTax = new PartnerServiceTax();

            tPartnerServiceTax.SetObjectInfo(dr);

            return(tPartnerServiceTax);
        }
Exemple #3
0
        public void InsertPartnerServiceTax(PartnerServiceTax argPartnerServiceTax, DataAccess da, List <ErrorHandler> lstErr)
        {
            SqlParameter[] param = new SqlParameter[11];
            param[0] = new SqlParameter("@ServiceTaxID", argPartnerServiceTax.ServiceTaxID);
            param[1] = new SqlParameter("@ServiceTaxPer", argPartnerServiceTax.ServiceTaxPer);
            param[2] = new SqlParameter("@ValidFrom", argPartnerServiceTax.ValidFrom);
            param[3] = new SqlParameter("@ValidTo", argPartnerServiceTax.ValidTo);
            param[4] = new SqlParameter("@ProcedureType", argPartnerServiceTax.ProcedureType);
            param[5] = new SqlParameter("@ClientCode", argPartnerServiceTax.ClientCode);
            param[6] = new SqlParameter("@CreatedBy", argPartnerServiceTax.CreatedBy);
            param[7] = new SqlParameter("@ModifiedBy", argPartnerServiceTax.ModifiedBy);

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

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

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

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


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


            objErrorHandler.Type       = strType;
            objErrorHandler.MsgId      = 0;
            objErrorHandler.Module     = ErrorConstant.strInsertModule;
            objErrorHandler.ModulePart = ErrorConstant.strMasterModule;
            objErrorHandler.Message    = strMessage.ToString();
            objErrorHandler.RowNo      = 0;
            objErrorHandler.FieldName  = "";
            objErrorHandler.LogCode    = "";
            lstErr.Add(objErrorHandler);
        }
Exemple #4
0
        public ICollection <PartnerServiceTax> colGetPartnerServiceTax(string argClientCode)
        {
            List <PartnerServiceTax> lst         = new List <PartnerServiceTax>();
            DataSet           DataSetToFill      = new DataSet();
            PartnerServiceTax tPartnerServiceTax = new PartnerServiceTax();

            DataSetToFill = this.GetPartnerServiceTax(argClientCode);

            if (DataSetToFill != null)
            {
                foreach (DataRow dr in DataSetToFill.Tables[0].Rows)
                {
                    lst.Add(objCreatePartnerServiceTax(dr));
                }
            }
            goto Finish;

Finish:
            DataSetToFill = null;


            return(lst);
        }
Exemple #5
0
        public ICollection <ErrorHandler> SavePartnerServiceTax(PartnerServiceTax argPartnerServiceTax)
        {
            List <ErrorHandler> lstErr = new List <ErrorHandler>();
            DataAccess          da     = new DataAccess();

            try
            {
                if (blnIsPartnerServiceTaxExists(argPartnerServiceTax.ServiceTaxID, argPartnerServiceTax.ClientCode) == false)
                {
                    da.Open_Connection();
                    da.BEGIN_TRANSACTION();
                    InsertPartnerServiceTax(argPartnerServiceTax, da, lstErr);
                    foreach (ErrorHandler objerr in lstErr)
                    {
                        if (objerr.Type == "E")
                        {
                            da.ROLLBACK_TRANSACTION();
                            return(lstErr);
                        }
                    }
                }
                else
                {
                    da.Open_Connection();
                    da.BEGIN_TRANSACTION();
                    UpdatePartnerServiceTax(argPartnerServiceTax, da, lstErr);
                    foreach (ErrorHandler objerr in lstErr)
                    {
                        if (objerr.Type == "E")
                        {
                            da.ROLLBACK_TRANSACTION();
                            return(lstErr);
                        }
                    }
                }
                da.COMMIT_TRANSACTION();
            }
            catch (Exception ex)
            {
                if (da != null)
                {
                    da.ROLLBACK_TRANSACTION();
                }
                objErrorHandler.Type       = ErrorConstant.strAboartType;
                objErrorHandler.MsgId      = 0;
                objErrorHandler.Module     = ErrorConstant.strInsertModule;
                objErrorHandler.ModulePart = ErrorConstant.strMasterModule;
                objErrorHandler.Message    = ex.Message.ToString();
                objErrorHandler.RowNo      = 0;
                objErrorHandler.FieldName  = "";
                objErrorHandler.LogCode    = "";
                lstErr.Add(objErrorHandler);
            }
            finally
            {
                if (da != null)
                {
                    da.Close_Connection();
                    da = null;
                }
            }
            return(lstErr);
        }