示例#1
0
        /// <summary>
        /// ��ȡ��λ����
        /// </summary>
        /// <returns></returns>
        public UnitModel Unit_GetUnit()
        {
            DataSet ds = dal.Unit_GetInfo("*");
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                DataRow dr = ds.Tables[0].Rows[0];
                UnitModel model = new UnitModel();
                model.ADDRESS = dr["ADDRESS"].ToString();
                model.BANK_NAME = dr["BANK_NAME"].ToString();
                model.BANK_NO = dr["BANK_NO"].ToString();
                model.EMAIL = dr["EMAIL"].ToString();
                model.FAX_NO = dr["FAX_NO"].ToString();
                model.POST_NO = dr["POST_NO"].ToString();
                model.TEL_NO = dr["TEL_NO"].ToString();
                model.UNIT_NAME = dr["UNIT_NAME"].ToString();
                model.URL = dr["URL"].ToString();

                return model;
            }
            else
            {
                return null;
            }
        }
示例#2
0
        /// <summary>
        /// 更改单位信息
        /// </summary>
        /// <param name="model">单位</param>
        /// <returns></returns>
        public int Unit_Update(UnitModel model)
        {
            SqlParameter[] paras =
            {
                new SqlParameter("@UNIT_NAME",SqlDbType.NVarChar,100),
                new SqlParameter("@TEL_NO",SqlDbType.NVarChar,100),
                new SqlParameter("@FAX_NO",SqlDbType.NVarChar,100),
                new SqlParameter("@POST_NO",SqlDbType.NVarChar,50),
                new SqlParameter("@ADDRESS",SqlDbType.NVarChar,200),
                new SqlParameter("@URL",SqlDbType.NVarChar,200),
                new SqlParameter("@EMAIL",SqlDbType.NVarChar,200),
                new SqlParameter("@BANK_NAME",SqlDbType.NVarChar,200),
                new SqlParameter("@BANK_NO",SqlDbType.NVarChar,200),
            };

            paras[0].Value = model.UNIT_NAME;
            paras[1].Value = model.TEL_NO;
            paras[2].Value = model.FAX_NO;
            paras[3].Value = model.POST_NO;
            paras[4].Value = model.ADDRESS;
            paras[5].Value = model.URL;
            paras[6].Value = model.EMAIL;
            paras[7].Value = model.BANK_NAME;
            paras[8].Value = model.BANK_NO;

            try
            {
                int iReturn;
                int i = DbHelperSQL.RunProcedure("Unit_Update", paras, out iReturn);
                return iReturn;
            }
            catch
            {
                return -1;
            }
        }
示例#3
0
 /// <summary>
 /// ���ĵ�λ��Ϣ
 /// </summary>
 /// <param name="model">��λ</param>
 /// <returns></returns>
 public int Unit_Update(UnitModel model)
 {
     return dal.Unit_Update(model);
 }