Пример #1
0
        /// <summary>
        /// Nguyen Hai Duong
        /// </summary>
        /// <param name="iv"></param>
        /// <returns></returns>
        public static bool UpdatetoTemp(INVOICE iv)
        {
            object i = SqlHelper.ExecuteScalar("spUpdatetoTempIV"
                                               , iv.IV_DOCUMENTID
                                               , iv.FICI_AUTOID
                                               , iv.TR_AUTOID
                                               , iv.CUR_AUTOID
                                               , iv.OBJ_AUTOID
                                               , iv.OBJ_NAME
                                               , iv.Obj_TaxID
                                               , iv.Obj_Address
                                               , iv.IV_DOCUMENTNUM
                                               // , iv.IV_VATTAXPER
                                               , iv.IV_DISCOUNTPER
                                               , iv.DOTY_AUTOID
                                               , iv.IV_BALANCE
                                               , iv.IV_SIGNEDBILL
                                               , iv.IV_ISUSE
                                               //  , iv.IV_ISTAXAPPLY
                                               , iv.IV_CURENTCYRATE
                                               , iv.PTE_AUTOID
                                               , iv.PTE_DESCRIPTION
                                               , iv.PTE_DUEDATE
                                               , iv.IV_ISINVOICEVAT
                                               , iv.IV_ISPOST
                                               );

            if (Convert.ToInt64(i) < 1)
            {
                return(false);
            }
            return(true);
        }
Пример #2
0
        /// <summary>
        /// thêm, Cập nhật invoice Auto INVOICE bao gồm cả chứng từ
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public static Int64 InsertUpdate(INVOICE obj)
        {
            string StoreName = "sp_InsertUpdate_Invoice";

            SqlParameter[] Parramter = vnyi.DLL.DataObject.MapParramter(obj, StoreName);
            object         resul     = SqlHelper.ExecuteScalar("", Parramter);

            return(vnyi.DLL.DataObject.ConvertInt64(resul));
        }
Пример #3
0
        public static bool InserttoTemp(INVOICE iv)
        {
            object i = SqlHelper.ExecuteScalar("spInserttoTempIV",
                                               iv.IV_DOCUMENTID
                                               , iv.IV_DOCUMENTNUM
                                               , iv.IV_TYPE
                                               , iv.FICI_AUTOID
                                               , iv.TR_AUTOID
                                               , iv.CUR_AUTOID
                                               , iv.OBJ_AUTOID
                                               , iv.OBJ_NAME
                                               , iv.Obj_TaxID
                                               , iv.Obj_Address
                                               , iv.DOTY_AUTOID
                                               , iv.IV_SIGNEDBILL
                                               , iv.PTE_AUTOID
                                               , iv.IV_ISUSE
                                               , iv.IV_ISINVOICEVAT
                                               , iv.IV_ISPOST
                                               , iv.ST_AUTOID
                                               , iv.IV_CURENTCYRATE
                                               , iv.IV_USEIN
                                               , iv.PTE_DUEDATE
                                               , iv.IV_ITEMAMOUNT
                                               , iv.IV_ITEMBASEAMOUNT
                                               , iv.IV_VATAMOUNT
                                               , iv.IV_VATBASEAMOUNT
                                               , iv.IV_DISCOUNTPER
                                               , iv.IV_DISAMOUNT
                                               , iv.IV_DISBASEAMOUNT
                                               , iv.IV_EXCISETAXAMOUNT
                                               , iv.IV_EXCISETAXBASEAMOUNT
                                               , iv.IV_IMEXPORTTAXAMOUNT
                                               , iv.IV_IMEXPORTTAXBASEAMOUNT
                                               , iv.IV_AMOUNT
                                               , iv.IV_BASEAMOUNT
                                               , iv.IV_BALANCE
                                               , iv.PTE_DESCRIPTION
                                               );

            if (Convert.ToInt64(i) < 1)
            {
                return(false);
            }
            return(true);
        }
Пример #4
0
        /// <summary>
        ///Select data full for table INVOICE
        /// return oneINVOICE
        /// you must set attribute at application tier
        /// </summary>
        /// <param name="IV_DOCUMENTID"> type of IV_DOCUMENTID</param>
        public static INVOICE SelectByID(Int64 IV_DOCUMENTID, bool isTmp)
        {
            string  _strProc = isTmp ? "spINVOICEtmpGetByID" : "spINVOICEGetByID";
            DataSet ds       = new DataSet();
            INVOICE result   = new INVOICE();

            SqlHelper.ExecuteDataset(ds, _strProc, IV_DOCUMENTID);
            if (ds != null)
            {
                if (ds.Tables.Count > 0)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        result = new INVOICE(ds.Tables[0].Rows[0]);
                    }
                }
            }
            ds.Dispose();
            return(result);
        }
Пример #5
0
        public static SqlMessage INSERTUPDATETmp(INVOICE IV, Int64?DOCUMENTID_TMP, SqlTransaction tran, string TYPE, Int16?LANG_AUTOID, string SESSION_ID)
        {
            SqlMessage sqlMessa = new SqlMessage();
            DataSet    ds       = (DataSet)SqlHelper.ExecuteDataset(null, tran, "SP_COMMON_INSERTUPDATECM_INVOICETmp",
                                                                    IV.IV_DOCUMENTID,
                                                                    IV.IV_DOCUMENTNUM,
                                                                    IV.IV_TYPE,
                                                                    IV.FICI_AUTOID,
                                                                    IV.TR_AUTOID,
                                                                    IV.CUR_AUTOID,
                                                                    IV.OBJ_AUTOID,
                                                                    IV.DOTY_AUTOID,
                                                                    IV.IV_SIGNEDBILL,
                                                                    IV.PTE_AUTOID,
                                                                    IV.IV_ISUSE,
                                                                    IV.IV_ISINVOICEVAT,
                                                                    IV.IV_ISPOST,
                                                                    IV.ST_AUTOID,
                                                                    IV.IV_CURENTCYRATE,
                                                                    IV.IV_USEIN,
                                                                    IV.PTE_DUEDATE,
                                                                    IV.IV_ITEMAMOUNT,
                                                                    IV.IV_ITEMBASEAMOUNT,
                                                                    IV.IV_VATAMOUNT,
                                                                    IV.IV_VATBASEAMOUNT,
                                                                    IV.IV_DISCOUNTPER,
                                                                    IV.IV_DISAMOUNT,
                                                                    IV.IV_DISBASEAMOUNT,
                                                                    IV.IV_REDUCEAMOUNT,
                                                                    IV.IV_REDUCEBASEAMOUNT,
                                                                    IV.IV_EXCISETAXAMOUNT,
                                                                    IV.IV_EXCISETAXBASEAMOUNT,
                                                                    IV.IV_IMEXPORTTAXAMOUNT,
                                                                    IV.IV_IMEXPORTTAXBASEAMOUNT,
                                                                    IV.IV_AMOUNT,
                                                                    IV.IV_BASEAMOUNT,
                                                                    IV.IV_BALANCE,
                                                                    IV.PTE_DESCRIPTION,
                                                                    IV.DOC_CREATEBY,
                                                                    IV.DOC_CREATEDATE,
                                                                    IV.DOC_UPDATEBY,
                                                                    IV.DOC_LASTUPDATE,
                                                                    IV.DOC_DOCUMENTDATE,
                                                                    IV.ORG_AUTOID,
                                                                    IV.DOC_DESCRIPTION,
                                                                    IV.DOC_OFSYSTEM,
                                                                    IV.DOC_OFSUBSYSTEM,
                                                                    DOCUMENTID_TMP,
                                                                    TYPE,
                                                                    LANG_AUTOID,
                                                                    SESSION_ID
                                                                    );

            if (ds != null)
            {
                if (ds.Tables.Count > 0)
                {
                    string error = ds.Tables[0].Rows[0]["ERROR"].ToString();
                    switch (error)
                    {
                    case "1":     // insert thành công
                    {
                        sqlMessa.Message  = "1";
                        sqlMessa.Status   = sqlMessagerType.Success;
                        sqlMessa.ResulObj = ds;
                    }
                    break;

                    case "2":     // update thanh công
                    {
                        sqlMessa.Message  = "2";
                        sqlMessa.Status   = sqlMessagerType.Success;
                        sqlMessa.ResulObj = ds;
                    }
                    break;

                    case "-2":     // dữ liệu đã bị xóa
                    {
                        sqlMessa.Message = "-2";
                        sqlMessa.Status  = sqlMessagerType.Success;
                    }
                    break;

                    case "0":     // lưu bị lỗi
                    {
                        sqlMessa.Status  = sqlMessagerType.Error;
                        sqlMessa.Message = "0";
                    }
                    break;
                    }
                }
            }
            return(sqlMessa);
        }