Exemplo n.º 1
0
 public void SaveSOPriceCondition(SOPriceCondition argSOPriceCondition, DataAccess da, List <ErrorHandler> lstErr)
 {
     try
     {
         if (blnIsSOPriceConditionExists(argSOPriceCondition.SODocCode, argSOPriceCondition.ItemNo, argSOPriceCondition.CalculationType, argSOPriceCondition.ClientCode, da) == false)
         {
             InsertSOPriceCondition(argSOPriceCondition, da, lstErr);
         }
         else
         {
             UpdateSOPriceCondition(argSOPriceCondition, da, lstErr);
         }
     }
     catch (Exception ex)
     {
         objErrorHandler.Type       = ErrorConstant.strAboartType;
         objErrorHandler.MsgId      = 0;
         objErrorHandler.Module     = ErrorConstant.strInsertModule;
         objErrorHandler.ModulePart = ErrorConstant.strDetailModule;
         objErrorHandler.Message    = ex.Message.ToString();
         objErrorHandler.RowNo      = 0;
         objErrorHandler.FieldName  = "";
         objErrorHandler.LogCode    = "";
         lstErr.Add(objErrorHandler);
     }
 }
Exemplo n.º 2
0
        private SOPriceCondition objCreateSOPriceCondition(DataRow dr)
        {
            SOPriceCondition tSOPriceCondition = new SOPriceCondition();

            tSOPriceCondition.SetObjectInfo(dr);

            return(tSOPriceCondition);
        }
Exemplo n.º 3
0
        public void UpdateSOPriceCondition(SOPriceCondition argSOPriceCondition, DataAccess da, List <ErrorHandler> lstErr)
        {
            SqlParameter[] param = new SqlParameter[16];
            param[0]  = new SqlParameter("@SODocCode", argSOPriceCondition.SODocCode);
            param[1]  = new SqlParameter("@ItemNo", argSOPriceCondition.ItemNo);
            param[2]  = new SqlParameter("@ConditionType", argSOPriceCondition.ConditionType);
            param[3]  = new SqlParameter("@CalculationType", argSOPriceCondition.CalculationType);
            param[4]  = new SqlParameter("@Amount", argSOPriceCondition.Amount);
            param[5]  = new SqlParameter("@Currency", argSOPriceCondition.Currency);
            param[6]  = new SqlParameter("@PerUnit", argSOPriceCondition.PerUnit);
            param[7]  = new SqlParameter("@UOMCode", argSOPriceCondition.UOMCode);
            param[8]  = new SqlParameter("@ConditionValue", argSOPriceCondition.ConditionValue);
            param[9]  = new SqlParameter("@SOLevel", argSOPriceCondition.SOLevel);
            param[10] = new SqlParameter("@ClientCode", argSOPriceCondition.ClientCode);
            param[11] = new SqlParameter("@CreatedBy", argSOPriceCondition.CreatedBy);
            param[12] = new SqlParameter("@ModifiedBy", argSOPriceCondition.ModifiedBy);

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

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

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

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


            string strMessage  = Convert.ToString(param[14].Value);
            string strType     = Convert.ToString(param[13].Value);
            string strRetValue = Convert.ToString(param[15].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);
        }
Exemplo n.º 4
0
        public SOPriceCondition objGetSOPriceCondition(string argSODocCode, string argItemNo, string argConditionType, string argClientCode)
        {
            SOPriceCondition argSOPriceCondition = new SOPriceCondition();
            DataSet          DataSetToFill       = new DataSet();

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

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

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

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

            DataSetToFill = this.GetSOPriceCondition(argSODocCode, argItemNo, argConditionType, argClientCode);

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

            argSOPriceCondition = this.objCreateSOPriceCondition((DataRow)DataSetToFill.Tables[0].Rows[0]);

            goto Finish;

ErrorHandlers:

Finish:
            DataSetToFill = null;


            return(argSOPriceCondition);
        }
Exemplo n.º 5
0
        public ICollection <SOPriceCondition> colGetSOPriceCondition(string argSODocCode, string argClientCode)
        {
            List <SOPriceCondition> lst        = new List <SOPriceCondition>();
            DataSet          DataSetToFill     = new DataSet();
            SOPriceCondition tSOPriceCondition = new SOPriceCondition();

            DataSetToFill = this.GetSOPriceCondition(argSODocCode, argClientCode);

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

Finish:
            DataSetToFill = null;


            return(lst);
        }