Esempio n. 1
0
        public virtual bool AddContractInvoiceApply(ContractInvoiceApplyInfo entity)
        {
            string    SqlAdd = null;
            DataTable DtAdd  = null;
            DataRow   DrAdd  = null;

            SqlAdd = "SELECT TOP 0 * FROM Contract_Invoice_Apply";
            DtAdd  = DBHelper.Query(SqlAdd);
            DrAdd  = DtAdd.NewRow();

            DrAdd["Invoice_Apply_ID"]          = entity.Invoice_Apply_ID;
            DrAdd["Invoice_Apply_ContractID"]  = entity.Invoice_Apply_ContractID;
            DrAdd["Invoice_Apply_InvoiceID"]   = entity.Invoice_Apply_InvoiceID;
            DrAdd["Invoice_Apply_ApplyAmount"] = entity.Invoice_Apply_ApplyAmount;
            DrAdd["Invoice_Apply_Amount"]      = entity.Invoice_Apply_Amount;
            DrAdd["Invoice_Apply_Status"]      = entity.Invoice_Apply_Status;
            DrAdd["Invoice_Apply_Note"]        = entity.Invoice_Apply_Note;
            DrAdd["Invoice_Apply_Addtime"]     = entity.Invoice_Apply_Addtime;

            DtAdd.Rows.Add(DrAdd);
            try
            {
                DBHelper.SaveChanges(SqlAdd, DtAdd);
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                DtAdd.Dispose();
            }
        }
Esempio n. 2
0
        public virtual IList <ContractInvoiceApplyInfo> GetContractInvoiceApplysByContractID(int Contract_ID)
        {
            IList <ContractInvoiceApplyInfo> entitys = null;
            ContractInvoiceApplyInfo         entity  = null;
            string        SqlList;
            SqlDataReader RdrList = null;

            try
            {
                SqlList = "Select * From Contract_Invoice_Apply Where Invoice_Apply_ContractID=" + Contract_ID + " Order By Invoice_Apply_ID";
                RdrList = DBHelper.ExecuteReader(SqlList);
                if (RdrList.HasRows)
                {
                    entitys = new List <ContractInvoiceApplyInfo>();
                    while (RdrList.Read())
                    {
                        entity = new ContractInvoiceApplyInfo();
                        entity.Invoice_Apply_ID          = Tools.NullInt(RdrList["Invoice_Apply_ID"]);
                        entity.Invoice_Apply_ContractID  = Tools.NullInt(RdrList["Invoice_Apply_ContractID"]);
                        entity.Invoice_Apply_InvoiceID   = Tools.NullInt(RdrList["Invoice_Apply_InvoiceID"]);
                        entity.Invoice_Apply_ApplyAmount = Tools.NullDbl(RdrList["Invoice_Apply_ApplyAmount"]);
                        entity.Invoice_Apply_Amount      = Tools.NullDbl(RdrList["Invoice_Apply_Amount"]);
                        entity.Invoice_Apply_Status      = Tools.NullInt(RdrList["Invoice_Apply_Status"]);
                        entity.Invoice_Apply_Note        = Tools.NullStr(RdrList["Invoice_Apply_Note"]);
                        entity.Invoice_Apply_Addtime     = Tools.NullDate(RdrList["Invoice_Apply_Addtime"]);

                        entitys.Add(entity);
                        entity = null;
                    }
                }
                return(entitys);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (RdrList != null)
                {
                    RdrList.Close();
                    RdrList = null;
                }
            }
        }
Esempio n. 3
0
        public virtual ContractInvoiceApplyInfo GetContractInvoiceApplyByID(int ID)
        {
            ContractInvoiceApplyInfo entity  = null;
            SqlDataReader            RdrList = null;

            try
            {
                string SqlList;
                SqlList = "SELECT * FROM Contract_Invoice_Apply WHERE Invoice_Apply_ID = " + ID;
                RdrList = DBHelper.ExecuteReader(SqlList);
                if (RdrList.Read())
                {
                    entity = new ContractInvoiceApplyInfo();

                    entity.Invoice_Apply_ID          = Tools.NullInt(RdrList["Invoice_Apply_ID"]);
                    entity.Invoice_Apply_ContractID  = Tools.NullInt(RdrList["Invoice_Apply_ContractID"]);
                    entity.Invoice_Apply_InvoiceID   = Tools.NullInt(RdrList["Invoice_Apply_InvoiceID"]);
                    entity.Invoice_Apply_ApplyAmount = Tools.NullDbl(RdrList["Invoice_Apply_ApplyAmount"]);
                    entity.Invoice_Apply_Amount      = Tools.NullDbl(RdrList["Invoice_Apply_Amount"]);
                    entity.Invoice_Apply_Status      = Tools.NullInt(RdrList["Invoice_Apply_Status"]);
                    entity.Invoice_Apply_Note        = Tools.NullStr(RdrList["Invoice_Apply_Note"]);
                    entity.Invoice_Apply_Addtime     = Tools.NullDate(RdrList["Invoice_Apply_Addtime"]);
                }

                return(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (RdrList != null)
                {
                    RdrList.Close();
                    RdrList = null;
                }
            }
        }
Esempio n. 4
0
        public virtual bool EditContractInvoiceApply(ContractInvoiceApplyInfo entity)
        {
            string    SqlAdd = null;
            DataTable DtAdd  = null;
            DataRow   DrAdd  = null;

            SqlAdd = "SELECT * FROM Contract_Invoice_Apply WHERE Invoice_Apply_ID = " + entity.Invoice_Apply_ID;
            DtAdd  = DBHelper.Query(SqlAdd);
            try
            {
                if (DtAdd.Rows.Count > 0)
                {
                    DrAdd = DtAdd.Rows[0];
                    DrAdd["Invoice_Apply_ID"]          = entity.Invoice_Apply_ID;
                    DrAdd["Invoice_Apply_ContractID"]  = entity.Invoice_Apply_ContractID;
                    DrAdd["Invoice_Apply_InvoiceID"]   = entity.Invoice_Apply_InvoiceID;
                    DrAdd["Invoice_Apply_ApplyAmount"] = entity.Invoice_Apply_ApplyAmount;
                    DrAdd["Invoice_Apply_Amount"]      = entity.Invoice_Apply_Amount;
                    DrAdd["Invoice_Apply_Status"]      = entity.Invoice_Apply_Status;
                    DrAdd["Invoice_Apply_Note"]        = entity.Invoice_Apply_Note;
                    DrAdd["Invoice_Apply_Addtime"]     = entity.Invoice_Apply_Addtime;

                    DBHelper.SaveChanges(SqlAdd, DtAdd);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                DtAdd.Dispose();
            }
            return(true);
        }
Esempio n. 5
0
 public virtual bool EditContractInvoiceApply(ContractInvoiceApplyInfo entity)
 {
     return(MyDAL.EditContractInvoiceApply(entity));
 }