コード例 #1
0
        private CallAdvReplacementReceipt objCreateCallAdvReplacementReceipt(DataRow dr)
        {
            CallAdvReplacementReceipt tCallAdvReplacementReceipt = new CallAdvReplacementReceipt();

            tCallAdvReplacementReceipt.SetObjectInfo(dr);

            return tCallAdvReplacementReceipt;

        }
コード例 #2
0
        public void UpdateCallAdvReplacementReceipt(CallAdvReplacementReceipt argCallAdvReplacementReceipt, DataAccess da, List<ErrorHandler> lstErr)
        {
            SqlParameter[] param = new SqlParameter[24];
            param[0] = new SqlParameter("@CallAdvRepReceiptCode", argCallAdvReplacementReceipt.CallAdvRepReceiptCode);
            param[1] = new SqlParameter("@CallAdvRepDocTypeCode", argCallAdvReplacementReceipt.CallAdvRepDocTypeCode);
            param[2] = new SqlParameter("@CallCode", argCallAdvReplacementReceipt.CallCode);
            param[3] = new SqlParameter("@CallItemNo", argCallAdvReplacementReceipt.CallItemNo);
            param[4] = new SqlParameter("@SerialNo1", argCallAdvReplacementReceipt.SerialNo1);
            param[5] = new SqlParameter("@SerialNo2", argCallAdvReplacementReceipt.SerialNo2);
            param[6] = new SqlParameter("@MaterialCode", argCallAdvReplacementReceipt.MaterialCode);
            param[7] = new SqlParameter("@MatGroup1Code", argCallAdvReplacementReceipt.MatGroup1Code);
            param[8] = new SqlParameter("@Quantity", argCallAdvReplacementReceipt.Quantity);
            param[9] = new SqlParameter("@UOMCode", argCallAdvReplacementReceipt.UOMCode);
            param[10] = new SqlParameter("@UnitPrice", argCallAdvReplacementReceipt.UnitPrice);
            param[11] = new SqlParameter("@PartnerCode", argCallAdvReplacementReceipt.PartnerCode);
            param[12] = new SqlParameter("@StoreCode", argCallAdvReplacementReceipt.StoreCode);
            param[13] = new SqlParameter("@StockIndicator", argCallAdvReplacementReceipt.StockIndicator);
            param[14] = new SqlParameter("@PartnerEmployeeCode", argCallAdvReplacementReceipt.PartnerEmployeeCode);
            param[15] = new SqlParameter("@MaterialDocTypeCode", argCallAdvReplacementReceipt.MaterialDocTypeCode);
            param[16] = new SqlParameter("@PGoodsMovementCode", argCallAdvReplacementReceipt.PGoodsMovementCode);
            param[17] = new SqlParameter("@GMItemNo", argCallAdvReplacementReceipt.GMItemNo);
            param[18] = new SqlParameter("@ClientCode", argCallAdvReplacementReceipt.ClientCode);
            param[19] = new SqlParameter("@CreatedBy", argCallAdvReplacementReceipt.CreatedBy);
            param[20] = new SqlParameter("@ModifiedBy", argCallAdvReplacementReceipt.ModifiedBy);
         
            param[21] = new SqlParameter("@Type", SqlDbType.Char);
            param[21].Size = 1;
            param[21].Direction = ParameterDirection.Output;

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

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

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


            string strMessage = Convert.ToString(param[22].Value);
            string strType = Convert.ToString(param[21].Value);
            string strRetValue = Convert.ToString(param[23].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);

        }
コード例 #3
0
        public CallAdvReplacementReceipt objGetCallAdvReplacementReceipt(string argCallAdvRepReceiptCode, string argCallCode, int argCallItemNo, string argPartnerCode, string argClientCode)
        {
            CallAdvReplacementReceipt argCallAdvReplacementReceipt = new CallAdvReplacementReceipt();
            DataSet DataSetToFill = new DataSet();

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

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

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

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

            DataSetToFill = this.GetCallAdvReplacementReceipt(argCallAdvRepReceiptCode, argCallCode, argCallItemNo,argPartnerCode, argClientCode);

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

            argCallAdvReplacementReceipt = this.objCreateCallAdvReplacementReceipt((DataRow)DataSetToFill.Tables[0].Rows[0]);

            goto Finish;

        ErrorHandlers:

        Finish:
            DataSetToFill = null;


            return argCallAdvReplacementReceipt;
        }
コード例 #4
0
        public void colGetCallAdvReplacementReceipt(string argCallAdvRepReceiptCode, string argCallCode, string argPartnerCode, string argClientCode, ref CallAdvRepReceiptCol argCallAdvRepReceiptCol)
        {
            DataSet DataSetToFill = new DataSet();
            CallAdvReplacementReceipt tCallAdvReplacementReceipt = new CallAdvReplacementReceipt();

            DataSetToFill = this.GetCallAdvReplacementReceipt(argCallAdvRepReceiptCode, argCallCode, argPartnerCode, argClientCode);

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

        Finish:
            DataSetToFill = null;
        }
コード例 #5
0
        public ICollection<CallAdvReplacementReceipt> colGetCallAdvReplacementReceipt(string argCallAdvRepReceiptCode, string argCallCode, string argPartnerCode, string argClientCode)
        {
            List<CallAdvReplacementReceipt> lst = new List<CallAdvReplacementReceipt>();
            DataSet DataSetToFill = new DataSet();
            CallAdvReplacementReceipt tCallAdvReplacementReceipt = new CallAdvReplacementReceipt();

            DataSetToFill = this.GetCallAdvReplacementReceipt(argCallAdvRepReceiptCode,argCallCode, argPartnerCode, argClientCode);

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

        Finish:
            DataSetToFill = null;


            return lst;
        }
コード例 #6
0
        public ICollection<ErrorHandler> SaveCallAdvReplacementReceipt(CallAdvReplacementReceipt argCallAdvReplacementReceipt)
        {
            List<ErrorHandler> lstErr = new List<ErrorHandler>();
            DataAccess da = new DataAccess();
            try
            {
                if (blnIsCallAdvReplacementReceiptExists(argCallAdvReplacementReceipt.CallAdvRepReceiptCode, argCallAdvReplacementReceipt.CallCode, argCallAdvReplacementReceipt.CallItemNo, argCallAdvReplacementReceipt.PartnerCode, argCallAdvReplacementReceipt.ClientCode) == false)
                {

                    da.Open_Connection();
                    da.BEGIN_TRANSACTION();
                    InsertCallAdvReplacementReceipt(argCallAdvReplacementReceipt, da, lstErr);
                    foreach (ErrorHandler objerr in lstErr)
                    {
                        if (objerr.Type == "E")
                        {
                            da.ROLLBACK_TRANSACTION();
                            return lstErr;
                        }
                    }
                }
                else
                {
                    da.Open_Connection();
                    da.BEGIN_TRANSACTION();
                    UpdateCallAdvReplacementReceipt(argCallAdvReplacementReceipt, da, lstErr);
                    foreach (ErrorHandler objerr in lstErr)
                    {
                        if (objerr.Type == "E")
                        {
                            da.ROLLBACK_TRANSACTION();
                            return lstErr;
                        }
                    }
                }
            }
            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;
        }