Exemplo n.º 1
0
        /// <summary>
        ///[to_InvoiceDetial]表查询实体的方法
        /// </summary>
        public static To_InvoiceDetial getTo_InvoiceDetialById(int id)
        {
            To_InvoiceDetial to_invoicedetial = null;

            string sql = "select * from to_InvoiceDetial where id=@id";

            SqlParameter[] sp = new SqlParameter[]
            {
                new SqlParameter("@id", id)
            };
            DataTable dt = DBHelper.GetDataSet(sql, sp);

            if (dt.Rows.Count > 0)
            {
                to_invoicedetial = new To_InvoiceDetial();
                foreach (DataRow dr in dt.Rows)
                {
                    to_invoicedetial.Id           = Convert.ToInt32(dr["id"]);
                    to_invoicedetial.InvoiceID    = Convert.ToInt32(dr["invoiceID"]);
                    to_invoicedetial.PolicyID     = Convert.ToString(dr["policyID"]);
                    to_invoicedetial.CusName      = Convert.ToString(dr["cusName"]);
                    to_invoicedetial.Cost         = Convert.ToDouble(dr["cost"]);
                    to_invoicedetial.DetialReamrk = Convert.ToString(dr["detialReamrk"]);
                }
            }

            return(to_invoicedetial);
        }
Exemplo n.º 2
0
        //添加详细信息
        private void addcombank()
        {
            string policyList = this.HidPolicy.Value;

            if (policyList != "")
            {
                string[] row  = null;
                string[] cell = null;
                EtNet_Models.To_InvoiceDetial invoiceDetial = null;
                if (policyList.IndexOf(',') >= 0)
                {
                    row = policyList.Split(',');
                }
                else
                {
                    row = new string[1] {
                        policyList
                    };
                }
                for (int i = 0; i < row.Length; i++)
                {
                    invoiceDetial              = new To_InvoiceDetial();
                    cell                       = row[i].Split('|');
                    invoiceDetial.PolicyID     = cell[0];
                    invoiceDetial.CusName      = cell[1];
                    invoiceDetial.Cost         = float.Parse(cell[2]);
                    invoiceDetial.DetialReamrk = "";
                    invoiceDetial.InvoiceID    = To_InvoiceManager.getTo_InvoiceLastONE().Id;
                    To_InvoiceDetialManager.addTo_InvoiceDetial(invoiceDetial);
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        ///[to_InvoiceDetial]表添加的方法
        /// </summary>
        public static int addTo_InvoiceDetial(To_InvoiceDetial to_invoicedetial)
        {
            string sql = "insert into to_InvoiceDetial([invoiceID],[policyID],[cusName],[cost],[detialReamrk]) values (@invoiceID,@policyID,@cusName,@cost,@detialReamrk)";

            SqlParameter[] sp = new SqlParameter[]
            {
                new SqlParameter("@invoiceID", to_invoicedetial.InvoiceID),
                new SqlParameter("@policyID", to_invoicedetial.PolicyID),
                new SqlParameter("@cusName", to_invoicedetial.CusName),
                new SqlParameter("@cost", to_invoicedetial.Cost),
                new SqlParameter("@detialReamrk", to_invoicedetial.DetialReamrk)
            };
            return(DBHelper.ExecuteCommand(sql, sp));
        }
Exemplo n.º 4
0
        /// <summary>
        ///[to_InvoiceDetial]表修改的方法
        /// </summary>
        public static int updateTo_InvoiceDetialById(To_InvoiceDetial to_invoicedetial)
        {
            string sql = "update to_InvoiceDetial set invoiceID=@invoiceID,policyID=@policyID,cusName=@cusName,cost=@cost,detialReamrk=@detialReamrk where id=@id";

            SqlParameter[] sp = new SqlParameter[]
            {
                new SqlParameter("@id", to_invoicedetial.Id),
                new SqlParameter("@invoiceID", to_invoicedetial.InvoiceID),
                new SqlParameter("@policyID", to_invoicedetial.PolicyID),
                new SqlParameter("@cusName", to_invoicedetial.CusName),
                new SqlParameter("@cost", to_invoicedetial.Cost),
                new SqlParameter("@detialReamrk", to_invoicedetial.DetialReamrk)
            };
            return(DBHelper.ExecuteCommand(sql, sp));
        }
Exemplo n.º 5
0
        /// <summary>
        ///根据SQL语句获取实体
        /// </summary>
        public static To_InvoiceDetial getTo_InvoiceDetialBySql(string sql)
        {
            To_InvoiceDetial to_invoicedetial = null;
            DataTable        dt = DBHelper.GetDataSet(sql);

            if (dt.Rows.Count > 0)
            {
                to_invoicedetial = new To_InvoiceDetial();
                foreach (DataRow dr in dt.Rows)
                {
                    to_invoicedetial.Id           = Convert.ToInt32(dr["id"]);
                    to_invoicedetial.InvoiceID    = Convert.ToInt32(dr["invoiceID"]);
                    to_invoicedetial.PolicyID     = Convert.ToString(dr["policyID"]);
                    to_invoicedetial.CusName      = Convert.ToString(dr["cusName"]);
                    to_invoicedetial.Cost         = Convert.ToDouble(dr["cost"]);
                    to_invoicedetial.DetialReamrk = Convert.ToString(dr["detialReamrk"]);
                }
            }
            return(to_invoicedetial);
        }
 public static int addTo_InvoiceDetial(To_InvoiceDetial to_invoicedetial)
 {
     return(To_InvoiceDetialService.addTo_InvoiceDetial(to_invoicedetial));
 }
 public static int updateTo_InvoiceDetial(To_InvoiceDetial to_invoicedetial)
 {
     return(To_InvoiceDetialService.updateTo_InvoiceDetialById(to_invoicedetial));
 }