private void BindCrtl(Detail_CAW_MONTHTZ p)
 {
     this.ddlYear.SelectedValue = p.YEAR;
     this.ddlMonth.SelectedValue = p.MONTH;
     this.txtTHISMONTHTHINGS.Text = p.THISMONTHTHINGS;
     this.ntxtCXNUM.Text = p.CXNUM == 0 ? string.Empty : p.CXNUM.ToString();
     this.ntxtCXPERSON.Text = p.CXPERSON == 0 ? string.Empty : p.CXPERSON.ToString();
     this.ntxtZXJCNUM.Text = p.ZXJCNUM == 0 ? string.Empty : p.ZXJCNUM.ToString();
     this.ntxtJWNUM.Text = p.JWNUM == 0 ? string.Empty : p.JWNUM.ToString();
     this.ntxtCFNUM.Text = p.CFNUM == 0 ? string.Empty : p.CFNUM.ToString();
     this.ntxtXZZGNUM.Text = p.XZZGNUM == 0 ? string.Empty : p.XZZGNUM.ToString();
     this.ntxtSTARTGL.Text = p.STARTGL == 0 ? string.Empty : p.STARTGL.ToString();
     this.ntxtENDGL.Text = p.ENDGL == 0 ? string.Empty : p.ENDGL.ToString();
     this.ntxtOIL.Text = p.OIL == 0 ? string.Empty : p.OIL.ToString();
     this.txtTHISIMPORTANT.Text = p.THISIMPORTANT;
     this.txtNEXTIMPORTANT.Text = p.NEXTIMPORTANT;
     this.txtREMARK.Text = p.REMARK;
 }
예제 #2
0
        /// <summary>
        /// 
        /// 编写日期:2010-4-8
        /// 编写人:GWF
        /// </summary>
        /// <param name="GUID"></param>
        public Detail_CAW_MONTHTZ GetDetail(string GUID)
        {
            Database db = DatabaseFactory.CreateDatabase(CawConnStr);
            string strSql = (db.DbProviderFactory.ToString() != "System.Data.OracleClient.OracleClientFactory") ?
                "SELECT * FROM CAW_MONTHTZ WHERE  GUID=@GUID " :
                "SELECT * FROM CAW_MONTHTZ WHERE  GUID=:GUID ";
            DbCommand cmd = db.GetSqlStringCommand(strSql);

            db.AddInParameter(cmd, "GUID", DbType.String, GUID);

            Detail_CAW_MONTHTZ myDetail = new Detail_CAW_MONTHTZ();

            using (IDataReader myReader = db.ExecuteReader(cmd))
            {
                if (myReader.Read())
                {
                    if (!Convert.IsDBNull(myReader["GUID"]))
                    {
                        myDetail.GUID = Convert.ToString(myReader["GUID"]);
                    }
                    if (!Convert.IsDBNull(myReader["YEAR"]))
                    {
                        myDetail.YEAR = Convert.ToString(myReader["YEAR"]);
                    }
                    if (!Convert.IsDBNull(myReader["MONTH"]))
                    {
                        myDetail.MONTH = Convert.ToString(myReader["MONTH"]);
                    }
                    if (!Convert.IsDBNull(myReader["CXNUM"]))
                    {
                        myDetail.CXNUM = Convert.ToInt32(myReader["CXNUM"]);
                    }
                    if (!Convert.IsDBNull(myReader["CXPERSON"]))
                    {
                        myDetail.CXPERSON = Convert.ToInt32(myReader["CXPERSON"]);
                    }
                    if (!Convert.IsDBNull(myReader["ZXJCNUM"]))
                    {
                        myDetail.ZXJCNUM = Convert.ToInt32(myReader["ZXJCNUM"]);
                    }
                    if (!Convert.IsDBNull(myReader["JWNUM"]))
                    {
                        myDetail.JWNUM = Convert.ToInt32(myReader["JWNUM"]);
                    }
                    if (!Convert.IsDBNull(myReader["CFNUM"]))
                    {
                        myDetail.CFNUM = Convert.ToInt32(myReader["CFNUM"]);
                    }
                    if (!Convert.IsDBNull(myReader["XZZGNUM"]))
                    {
                        myDetail.XZZGNUM = Convert.ToInt32(myReader["XZZGNUM"]);
                    }
                    if (!Convert.IsDBNull(myReader["STARTGL"]))
                    {
                        myDetail.STARTGL = Convert.ToDecimal(myReader["STARTGL"]);
                    }
                    if (!Convert.IsDBNull(myReader["ENDGL"]))
                    {
                        myDetail.ENDGL = Convert.ToDecimal(myReader["ENDGL"]);
                    }
                    if (!Convert.IsDBNull(myReader["OIL"]))
                    {
                        myDetail.OIL = Convert.ToDecimal(myReader["OIL"]);
                    }
                    if (!Convert.IsDBNull(myReader["THISIMPORTANT"]))
                    {
                        myDetail.THISIMPORTANT = Convert.ToString(myReader["THISIMPORTANT"]);
                    }
                    if (!Convert.IsDBNull(myReader["NEXTIMPORTANT"]))
                    {
                        myDetail.NEXTIMPORTANT = Convert.ToString(myReader["NEXTIMPORTANT"]);
                    }
                    if (!Convert.IsDBNull(myReader["REMARK"]))
                    {
                        myDetail.REMARK = Convert.ToString(myReader["REMARK"]);
                    }
                    if (!Convert.IsDBNull(myReader["CREATDATE"]))
                    {
                        myDetail.CREATDATE = Convert.ToDateTime(myReader["CREATDATE"]);
                    }
                    if (!Convert.IsDBNull(myReader["THISMONTHTHINGS"]))
                    {
                        myDetail.THISMONTHTHINGS = Convert.ToString(myReader["THISMONTHTHINGS"]);
                    }
                }
            }
            return myDetail;
        }