示例#1
0
 /// <summary>
 /// 新增一条烟农记录
 /// </summary>
 /// <param name="farmer">System.String[]<param>
 /// <returns>返回烟农受影响的行数</returns>
 public virtual int Add(Farmer farmer)
 {
     return db.ExecuteNoQuery(@"INSERT INTO T_BASE_FARMER (FARMER_ID, FARMAR_CODE, FARMER_RFID, FARMER_NAME, FARMER_PY, FARMER_PHONE, FARMER_EMAIL, FARMER_ADDRESS, FARMER_RMARK, FARMER_SEX, FARMER_BIRTH, FARMER_CARD_ID, FARMER_CREATE_DATE)
     VALUES (@FARMER_ID, @FARMAR_CODE, @FARMER_RFID, @FARMER_NAME, @FARMER_PY, @FARMER_PHONE, @FARMER_EMAIL, @FARMER_ADDRESS, @FARMER_RMARK, @FARMER_SEX, @FARMER_BIRTH, @FARMER_CARD_ID, now())",
         db.GetDataParameter("@FARMER_ID", farmer.FarmerId),
         db.GetDataParameter("@FARMAR_CODE", farmer.FarmarCode),
         db.GetDataParameter("@FARMER_RFID", farmer.FarmerRfid),
         db.GetDataParameter("@FARMER_NAME", farmer.FarmerName),
         db.GetDataParameter("@FARMER_PY", farmer.FarmerPy),
         db.GetDataParameter("@FARMER_PHONE", farmer.FarmerPhone),
         db.GetDataParameter("@FARMER_EMAIL", farmer.FarmerEmail),
         db.GetDataParameter("@FARMER_ADDRESS", farmer.FarmerAddress),
         db.GetDataParameter("@FARMER_RMARK", farmer.FarmerRmark),
         db.GetDataParameter("@FARMER_SEX", farmer.FarmerSex),
         db.GetDataParameter("@FARMER_BIRTH", farmer.FarmerBirth),
         db.GetDataParameter("@FARMER_CARD_ID", farmer.FarmerCardId)
         //db.GetDataParameter("@FARMER_CREATE_DATE", farmer.FarmerCreateDate),
         //db.GetDataParameter("@FARMER_IS_DELETED", farmer.FarmerIsDeleted),
         //db.GetDataParameter("@FARMER_DELETED_DATE", farmer.FarmerDeletedDate)
         );
 }
示例#2
0
 /// <summary>
 /// 根据 FarmerId 更新烟农表记录
 /// </summary>
 /// <returns>返回烟农受影响的行数</returns>
 public virtual int Update(Farmer farmer)
 {
     return db.ExecuteNoQuery(@"UPDATE T_BASE_FARMER SET FARMAR_CODE = @FARMAR_CODE, FARMER_RFID = @FARMER_RFID, FARMER_NAME = @FARMER_NAME, FARMER_PY = @FARMER_PY,
     FARMER_PHONE = @FARMER_PHONE, FARMER_EMAIL = @FARMER_EMAIL, FARMER_ADDRESS = @FARMER_ADDRESS, FARMER_RMARK = @FARMER_RMARK, FARMER_SEX = @FARMER_SEX, FARMER_BIRTH = @FARMER_BIRTH,
     FARMER_CARD_ID = @FARMER_CARD_ID WHERE FARMER_ID = @FARMER_ID",
         db.GetDataParameter("@FARMER_ID", farmer.FarmerId),
         db.GetDataParameter("@FARMAR_CODE", farmer.FarmarCode),
         db.GetDataParameter("@FARMER_RFID", farmer.FarmerRfid),
         db.GetDataParameter("@FARMER_NAME", farmer.FarmerName),
         db.GetDataParameter("@FARMER_PY", farmer.FarmerPy),
         db.GetDataParameter("@FARMER_PHONE", farmer.FarmerPhone),
         db.GetDataParameter("@FARMER_EMAIL", farmer.FarmerEmail),
         db.GetDataParameter("@FARMER_ADDRESS", farmer.FarmerAddress),
         db.GetDataParameter("@FARMER_RMARK", farmer.FarmerRmark),
         db.GetDataParameter("@FARMER_SEX", farmer.FarmerSex),
         db.GetDataParameter("@FARMER_BIRTH", farmer.FarmerBirth),
         db.GetDataParameter("@FARMER_CARD_ID", farmer.FarmerCardId)
         //db.GetDataParameter("@FARMER_CREATE_DATE", farmer.FarmerCreateDate),
         //db.GetDataParameter("@FARMER_IS_DELETED", farmer.FarmerIsDeleted),
         //db.GetDataParameter("@FARMER_DELETED_DATE", farmer.FarmerDeletedDate)
         );
 }
示例#3
0
        private Farmer SetValue()
        {
            Farmer m_Base = new Farmer();
            m_Base.FarmarCode = txtFarmarCode.Text;//烟农编码
            m_Base.FarmerRfid = txtFarmerRfid.Text;//烟农RFID标识
            m_Base.FarmerName = txtFarmerName.Text;//烟农名称
            m_Base.FarmerPy = txtFarmerPy.Text;//烟农拼音缩写
            m_Base.FarmerPhone = txtFarmerPhone.Text;//烟农电话
            m_Base.FarmerEmail = txtFarmerEmail.Text;//烟农电子邮箱
            m_Base.FarmerAddress = txtFarmerAddress.Text;//烟农地址
            m_Base.FarmerRmark = txtFarmerRmark.Text;//备注
            m_Base.FarmerSex = dpdFarmerSex.Text;//性别
            if (!string.IsNullOrEmpty(txtFarmerBirth.Text))
            {
                m_Base.FarmerBirth = Convert.ToDateTime(txtFarmerBirth.Text);//出生日期
            }
            m_Base.FarmerCardId = txtFarmerCardId.Text;//身份证
            //m_Base.FarmerCreateDate = Convert.ToDateTime(txtFarmerCreateDate.Text);//创建日期
            //m_Base.FarmerIsDeleted = txtFarmerIsDeleted.Text;//是否删除
            //m_Base.FarmerDeletedDate = Convert.ToDateTime(txtFarmerDeletedDate.Text);//删除日期

            return m_Base;
        }