Exemplo n.º 1
0
Arquivo: UserDac.cs Projeto: ue96/ue96
        public int InsertRequestAccount(RequestAccountInfo oParam)
        {
            string sql = @"INSERT INTO Sys_RequestAccount
                            (
                            Name,Account,
                            DepartMent,Phone,MobilePhone,Email,Note
                            )
                            VALUES (
                            @Name,@Account,
                            @DepartMent,@Phone,@MobilePhone,@Email,@Note
                            )";
            SqlCommand cmd = new SqlCommand(sql);

            SqlParameter paramName = new SqlParameter("@Name", SqlDbType.VarChar, 50);
            SqlParameter paramAccount = new SqlParameter("@Account", SqlDbType.VarChar, 50);
            SqlParameter paramDepartMent = new SqlParameter("@DepartMent", SqlDbType.VarChar, 100);
            SqlParameter paramPhone = new SqlParameter("@Phone", SqlDbType.VarChar, 50);
            SqlParameter paramMobilePhone = new SqlParameter("@MobilePhone", SqlDbType.VarChar, 50);
            SqlParameter paramEmail = new SqlParameter("@Email", SqlDbType.VarChar, 50);
            SqlParameter paramNote = new SqlParameter("@Note", SqlDbType.VarChar, 200);

            paramName.Value = oParam.Name; ;
            paramAccount.Value = oParam.Account;
            paramDepartMent.Value = oParam.DepartMent;
            if (oParam.Phone != AppConst.StringNull)
                paramPhone.Value = oParam.Phone;
            else
                paramPhone.Value = System.DBNull.Value;
            paramMobilePhone.Value = oParam.MobilePhone;
            paramEmail.Value = oParam.Email;

            if (oParam.Note != AppConst.StringNull)
                paramNote.Value = oParam.Note;
            else
                paramNote.Value = System.DBNull.Value;

            cmd.Parameters.Add(paramName);
            cmd.Parameters.Add(paramAccount);
            cmd.Parameters.Add(paramDepartMent);
            cmd.Parameters.Add(paramPhone);
            cmd.Parameters.Add(paramMobilePhone);
            cmd.Parameters.Add(paramEmail);
            cmd.Parameters.Add(paramNote);

            return SqlHelper.ExecuteNonQuery(cmd);
        }
Exemplo n.º 2
0
 /// <summary>
 /// �����������˻�����Ϣ
 /// </summary>
 /// <param name="oParam"></param>
 /// <returns></returns>
 public int InsertRequestAccount(RequestAccountInfo oParam)
 {
     return new UserDac().InsertRequestAccount(oParam);
 }