Пример #1
0
        private AccDeterminPro objCreateAccDeterminPro(DataRow dr)
        {
            AccDeterminPro tAccDeterminPro = new AccDeterminPro();

            tAccDeterminPro.SetObjectInfo(dr);

            return(tAccDeterminPro);
        }
Пример #2
0
        public void UpdateAccDeterminPro(AccDeterminPro argAccDeterminPro, DataAccess da, List <ErrorHandler> lstErr)
        {
            SqlParameter[] param = new SqlParameter[23];
            param[0]  = new SqlParameter("@AccDeterminProCode", argAccDeterminPro.AccDeterminProCode);
            param[1]  = new SqlParameter("@AccDMTableCode", argAccDeterminPro.AccDMTableCode);
            param[2]  = new SqlParameter("@CustGroupCode", argAccDeterminPro.CustGroupCode);
            param[3]  = new SqlParameter("@MatGroup1Code", argAccDeterminPro.MatGroup1Code);
            param[4]  = new SqlParameter("@AccKeyCode", argAccDeterminPro.AccKeyCode);
            param[5]  = new SqlParameter("@SalesOrganizationCode", argAccDeterminPro.SalesOrganizationCode);
            param[6]  = new SqlParameter("@DistChannelCode", argAccDeterminPro.DistChannelCode);
            param[7]  = new SqlParameter("@PlantCode", argAccDeterminPro.PlantCode);
            param[8]  = new SqlParameter("@AccAssignGroupCodeCust", argAccDeterminPro.AccAssignGroupCodeCust);
            param[9]  = new SqlParameter("@AccAssignGroupCodeMat", argAccDeterminPro.AccAssignGroupCodeMat);
            param[10] = new SqlParameter("@SOTypeCode", argAccDeterminPro.SOTypeCode);
            param[11] = new SqlParameter("@DeliveryDocTypeCode", argAccDeterminPro.DeliveryDocTypeCode);
            param[12] = new SqlParameter("@BillingDocTypeCode", argAccDeterminPro.BillingDocTypeCode);
            param[13] = new SqlParameter("@AccountDocTypeCode", argAccDeterminPro.AccountDocTypeCode);
            param[14] = new SqlParameter("@PlantStateCode", argAccDeterminPro.PlantStateCode);
            param[15] = new SqlParameter("@ChartACCode", argAccDeterminPro.ChartACCode);
            param[16] = new SqlParameter("@GLCode", argAccDeterminPro.GLCode);
            param[17] = new SqlParameter("@ClientCode", argAccDeterminPro.ClientCode);
            param[18] = new SqlParameter("@CreatedBy", argAccDeterminPro.CreatedBy);
            param[19] = new SqlParameter("@ModifiedBy", argAccDeterminPro.ModifiedBy);

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

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

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

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


            string strMessage  = Convert.ToString(param[21].Value);
            string strType     = Convert.ToString(param[20].Value);
            string strRetValue = Convert.ToString(param[22].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     = "";
            objErrorHandler.ReturnValue = strRetValue;
            lstErr.Add(objErrorHandler);
        }
Пример #3
0
        public AccDeterminPro objGetAccDeterminPro(int argAccDeterminProCode, string argAccDMTableCode, string argClientCode)
        {
            AccDeterminPro argAccDeterminPro = new AccDeterminPro();
            DataSet        DataSetToFill     = new DataSet();

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

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

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

            DataSetToFill = this.GetAccDeterminPro(argAccDeterminProCode, argAccDMTableCode, argClientCode);

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

            argAccDeterminPro = this.objCreateAccDeterminPro((DataRow)DataSetToFill.Tables[0].Rows[0]);

            goto Finish;

ErrorHandlers:

Finish:
            DataSetToFill = null;


            return(argAccDeterminPro);
        }
Пример #4
0
        public ICollection <AccDeterminPro> colGetAccDeterminPro(string argAccDMTableCode, string argClientCode)
        {
            List <AccDeterminPro> lst      = new List <AccDeterminPro>();
            DataSet        DataSetToFill   = new DataSet();
            AccDeterminPro tAccDeterminPro = new AccDeterminPro();

            DataSetToFill = this.GetAccDeterminPro(argAccDMTableCode, argClientCode);

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

Finish:
            DataSetToFill = null;


            return(lst);
        }